Windows: Build Alembic 1.5.8 (last version) for Maya 2015 and 2016 with Visual Studio 2012.

873 views
Skip to first unread message

jer...@eightvfx.com

unread,
Jul 14, 2015, 7:38:56 PM7/14/15
to alembic-d...@googlegroups.com
Hi,

I have been trying for several days to compile the last version of Alembic (1.5.8 on July 14th 2015) for a Maya 2015 and 2016 usage on Windows. The latest version of Alembic provides some features I need but that are not included in the version used by Maya 2015 or Exocortex Crate (1.5.5 ?).
Also, Autodesk suggests to use Visual studio 2012 Update 4 in order to build plugins for Maya 2015 and 2016 (see Compiler Requirement: http://help.autodesk.com/view/MAYAUL/2016/ENU//?guid=__files_Setting_up_your_build_env_Windows_env_32bit_and_64bit_htm ).

Here are my references for building Alembic on Windows:
Alembic Github: https://github.com/alembic/alembic with the "Windows build steps" HTML file provided
Build Alembic for Maya 2013: http://renderloop.blogspot.com/2013/06/build-abcexportabcimport-on-windows.html
Sebastian Lipponer Alembic fork (1.5.5) with Visual Studio 2013: https://github.com/sebastianlipponer/alembic
Jonnygarrett Alembic fork (also 1.5.5) with VS 2012: https://github.com/jonnygarrett/alembic_vs2012

Unfortunately, after following all this tutorials (trying to adapt them for Alembic 1.5.8) and using many combinations of versions of the external dependencies, I'm still stuck at the final step: building the Alembic solution in VS 2012... The problem is mainly about Ilmbase and HDF5.

Here are the libraries I have been using on my last try, with CMake 2.8.12.2:
- IlmBase 1.0.3 (probably the version used in Maya 2015)
- ZLib 1.2.8
- Boost 1.53.0 (used in Maya 2015)
- HFL5 1.8.12
- Glut 3.7.6
- Freeglut 2.8.1
- Glew 1.11

You'll find just below all the informations about the errors I have in the Alembic Visual Studio project.

If anyone has been facing the same problem and found a solution, I'm very curious about how you did it!
Hoping this topic will make the Alembic Windows support not so experimental anymore ;-)

Thank you very much!

Jeremie






Here is a summary of the error logs (200 errors) that Visual Studio is providing, with a small sample of the code with the error when possible:

1) Issues about HDF5 and SZIP on this projects:
- AbcCollection_CollectionTest
- AbcCoreAbstractCompoundPropsTest
- All projects with "AbcGeom_"
- All projects with "AbcMaterial_"
- All projects with "AbcCoreHDF5"
- playground

Always the same 4 errors for all the projects above:
error LNK2019: unresolved external symbol SZ_encoder_enabled referenced in function H5Z_init_interface    E:\lib-alembic\alembic-1.5.8\lib\Alembic\AbcGeom\Tests\hdf5.lib(H5Z.obj)
error LNK2019: unresolved external symbol SZ_BufftoBuffCompress referenced in function H5Z_filter_szip    E:\lib-alembic\alembic-1.5.8\lib\Alembic\AbcGeom\Tests\hdf5.lib(H5Zszip.obj)
error LNK2019: unresolved external symbol SZ_BufftoBuffDecompress referenced in function H5Z_filter_szip    E:\lib-alembic\alembic-1.5.8\lib\Alembic\AbcGeom\Tests\hdf5.lib(H5Zszip.obj)
error LNK1120: 3 unresolved externals


2) Issues about Ilmbase in "AlembicAbcCoreOgawa" project. The "half" class of Ilmbase is involved in all the following errors.

- halfLimits.h - lines 72, 73, 85, 86, 87, 88 (all of the following for each line):
error C2146: syntax error : missing ';' before identifier 'epsilon'
error C4430
: missing type specifier - int assumed. Note: C++ does not support default-int
error C2365
: 'std::numeric_limits<half>::half' : redefinition; previous definition was 'member function'
Code sample (line 72): static half epsilon () throw () {return HALF_EPSILON;}
On error C2146, all the identifiers are : line73='round_error', line85='infinity', line86='quiet_NaN', line87='signaling_NaN', line88='denorm_min',

- halfLimits.h - lines 63 and 64 (all of the following for each line):
error C2059: syntax error : '('
error C2143
: syntax error : missing ',' before '?'
error C4430
: missing type specifier - int assumed. Note: C++ does not support default-int
error C2059
: syntax error : 'throw'
error C2334
: unexpected token(s) preceding '{'; skipping apparent function body
Plus for line 64:
error C2535: 'int std::numeric_limits<half>::half(void)' : member function already defined or declared
Code sample (line 64): static half max () throw () {return HALF_MAX;}

- Readutil.cpp - lines 130, 139, 148 (still for each line):
error C2589: '(' : illegal token on right side of '::'
error C2059
: syntax error : '::'
Code sample (line 130): iMax = std::numeric_limits<Util::float16_t>::max();

- IPoints.h in AbcWFObjConvert, line 156:
error C2589: '(' : illegal token on right side of '::'
error C2059
: syntax error : '::'  
Code sample: { return std::max( m_positionsProperty.getNumSamples(), m_idsProperty.getNumSamples() ); }

Jonathan Garrett

unread,
Jul 17, 2015, 1:50:37 AM7/17/15
to alembic-d...@googlegroups.com
hi Jeremy

I've built 1.5.7 with vs2012 (and also the maya plugins) - I built directly in visual studio, avoiding cmake

- here's my instructions for 1.5.5: https://github.com/jonnygarrett/alembic_vs2012

I haven't updated it to the latest Alembic release, but I'm imagining it'll be straightforward

Jonny

jer...@eightvfx.com

unread,
Jul 21, 2015, 7:31:13 PM7/21/15
to alembic-discussion
Hi Jonny,

Thanks a lot for your reply.
Actually, I already built Alembic 1.5.8 with your project. It works fine. The problem is that the Maya plugins are not included in it and I didn't manage to build them separately before.

I did some other research and it finally worked by doing the following for each Maya plugin (AbcImport + AbcExport):

- Build Alembic following Jonny's tutorial. The library files are in "$Alembic_root\build\vs2012\x64\Release"
- Go into the Ilmbase library directory. Create an "include" directory and put all the headers of the different libraries (Half, Iex, IexMath, IlmThread, IMath) in this directory
- In the directory "<Alembic_root_dir> \ maya \ <Plugin_dir>", create a Visual Studio solution and project with the plugin name
(Note: if possible, create the VS project using the Maya Plugin Wizard. You'll just have to remove/delete the source files that will be generated)
- Import all the .cpp and header files from the same folder into the project
- Go in the project properties and make sure there are all the following stuff:
- general properties: Configuration type = Dynamic library; target extension = .mll
- in C++ \ General: Additionnal include dirs = . ; C:\Program Files\Autodesk\Maya20xx\include (depending on Maya version and installation directory) ; $Alembic_root_dir\lib ; $Ilmbase_lib_dir\include ; $Boost_lib_dir\boost_1_xx.0\boost
- in C++ \ Preprocessor: Definitions = NDEBUG(Release) or _DEBUG(Debug);WIN32;_WINDOWS;_USRDLL;NT_PLUGIN;_HAS_ITERATOR_DEBUGGING=0;_SECURE_SCL=0;_SECURE_SCL_THROWS=0;_SECURE_SCL_DEPRECATE=0;_CRT_SECURE_NO_DEPRECATE;TBB_USE_DEBUG=0;__TBB_LIB_NAME=tbb.lib;REQUIRE_IOSTREAM;AW_NEW_IOSTREAMS;Bits64_
- in Linker \ General: Additionnal library directories = C:\Program Files\Autodesk\Maya20xx\lib; $HDF5_root_dir\lib; $Alembic_root_dir\build\vs2012\x64\Release (following Jonny's tutorial)
- in Linker \ Input: Additionnal dependencies = Foundation.lib; OpenMaya.lib; OpenMayaUI.lib; OpenMayaAnim.lib; OpenMayaFX.lib; OpenMayaRender.lib; Image.lib; AlembicAbcCoreFactory.lib; AlembicAbcCoreHDF5.lib; AlembicAbcCoreOgawa.lib; AlembicAbcGeom.lib; AlembicAbc.lib; AlembicAbcCoreAbstract.lib; AlembicAbcMaterial.lib; AlembicAbcCollection.lib; AlembicOgawa.lib; AlembicUtil.lib; hdf5_hl.lib; hdf5.lib; zlib.lib; szip.lib; AlembicOpenEXR.lib; AlembicIlmBase.lib
(Note: instead of AlembicOpenEXR.lib and AlembicIlmBase.lib, you could have something like AlembicIMath.lib, AlembicIEx,lib, AlembicHalf.lib... Check in the directory where you built Alembic)
- in Linker \ Command Line: /export:initializePlugin /export:uninitializePlugin

Build the project. You obtain a .mll file for the plugin in your Visual Studio directory.
The plugins are supposed to work in Maya. For me, it worked fine.


I'll do some other research to see if we can use CMake or at least more recent library versions.

Thanks again Jonny.
Reply all
Reply to author
Forward
0 new messages