一半君的总结纸

听话只听一半君

windows 8.1下编译alembic 1.5.8 半自动版 build script

上部是手动的,经常要改.cmake和cmakelists文件,还要在vs里改来改去,很麻烦,所以改了里面自带的script放在了github(原版自带的没法用,错误百出)

需要的工具:
Visual Studio 2012 with update 4 (这几天才出的update 5
Cmake 3.3
sphinx 1.3.1
Graphviz 2.38

需要的library:
boost_1_55_0 prebuilt binary
hdf5-1.8.5-patch1 prebuilt binary
openexr-2.2.0(放进repo里了)
ilmbase-2.2.0 (放进repo里了)
zlib-1.2.8
pyilmbase-2.2.0(放进repo里了)
Autodesk® Maya 2016.1- Developer Kit(非必须)
操作如下:

  1. 随便找个目录比如d:\source
    首先clone我fork的 Alembic Repo
    因为我把ilmbase pyilmbase openexr作为submodule放到了contrib下,所以使用下面的命令

    git clone -b win --recursive https://github.com/oglops/alembic alembic-1.5.8
    
  2. 然后把各种需要的lib的source放到contrib目录下,如果是prebuilt binary放到c:\local下(你要是不想放这里可以去build/windows/init.cmd里面改)
    • boost_1_58_0 prebuilt binary 去网站boost.teeks99.com下载,安装到c:\local
    • hdf5-1.8.5-patch1 prebuilt binary去官网下载,安装到c:\local
    • openexr-2.2.0去OpenEXR官网下载,或者clone github上的,把openexr目录复制到此处
    • ilmbase-2.2.0 因为openexr官网的压缩包里没带cmakelists.txt,所以用了github上的,把ilmbase目录复制到此处
    • pyilmbase-2.2.0 因为openexr官网的压缩包里没带cmakelists.txt,所以用了github上的,把pyilmbase目录复制到此处
    • zlib-1.2.8 在官网下载 并解压
    • glut-2.7.6找不到64bit的了,用freeglut 3.0.0代替,在官网下载 prebuilt binary
    • glew-1.13.0 prebuilt binary在官网下载
    • pyilmbase需要numpy,有prebuilt binary的wheel在 Unofficial Windows Binaries for Python Extension Packages,下载后
      pip install numpy-1.9.2+mkl-cp27-none-win_amd64.whl
      

      全准备好以后,你clone下来的repo看起来是这样的
      source

      contrib

      你的c:\local文件夹看起来是这样的
      local
      其中hdf5是个symlink,因为我把他装到program files下面去了

    • 用build script准备ilmbase openexr pyilmbase
      # 去到你clone的目录里
      cd build\windows
      
      # 设一些环境变量 如果装的版本不一样需要自己在里面改
      init
      
      #然后分别执行如下命令,当然如果运气好,用build_all也行,但是我觉得运气一般不会那么好
      build_zlib
      build_ilmbase
      build_openexr
      build_pyilmbase
      init_Alembic
      build_Albemic
      

      如果运气好,c:\local\alembic-1.5.8里面应该就是得到的结果了

      执行完上面一堆命令以后c:\local下面是这样的
      local after

    • lz在build\windows\wheel下面放了个wheel的setup.py,用于把pyalembic搞成wheel
      可以试运行如下命令

      python setup.py bdist_wheel
      

      如果运气好,就应该有了一个叫做PyAlembic-1.5.8-cp27-none-win_amd64.whl的文件了,可以发给别人装了,下载链接lz放在本文的最后了

      pip install PyAlembic-1.5.8-cp27-none-win_amd64.whl 
      
    • 如果想要帮助文档,在alembic根目录下运行下面命令即可
      如果你Graphviz装这儿了,你得先看看C:\Program Files (x86)\Graphviz2.38\bin在没在%PATH%里

      doxygen Doxyfile
      

      生成的帮助会出现在 doc\html目录下

      doc

lz的bootstrap的设置是

   * Alembic Configuration          ===
   * USE_ARNOLD                     FALSE
   * USE_EXAMPLES                   ON
   * USE_HDF5                       ON
   * USE_MAYA                       FALSE
   * USE_OPENGL                     ON
   * USE_PRMAN                      FALSE
   * USE_PYALEMBIC                  TRUE
   * USE_STATIC_BOOST               OFF
   * USE_STATIC_HDF5                ON
   * USE_TESTS                      ON
   * ALEMBIC_GLEW_LINK_STATIC       ON
   * ALEMBIC_ILMBASE_LINK_STATIC    ON
   * ALEMBIC_SHARED_LIBS            ON
   * ALEMBIC_LIB_USES_BOOST         ON
   * ALEMBIC_LIB_USES_TR1           OFF

试下自带的例子abcview,工作正常(试验用的文件是digital tutors的ncloth教程里的)
abcview

链接:
lz repo 的地址是 https://github.com/oglops/alembic
编译出来的wheel在这里:PyAlembic-1.5.8-cp27-none-win_amd64.whl

update:
之前lz的repo里的submodule由于使用了ssh格式的地址,造成了其他人无法clone,现已经改为相对地址

git config –file=.gitmodules -e
# 将地址改为如下所示

git submodule sync
git submodule update –init –recursive –remote

[submodule "contrib/IlmBase-2.2.0"]
path = contrib/IlmBase-2.2.0
url = ../IlmBase.git
[submodule "contrib/OpenEXR-2.2.0"]
path = contrib/OpenEXR-2.2.0
url = ../openexr.git
[submodule "contrib/PyIlmBase-2.2.0"]
path = contrib/PyIlmBase-2.2.0
url = ../PyIlmBase.git

参考:

Changing remote repository for a git submodule

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: