Maya 2017 Build

924 views
Skip to first unread message

brian...@roosterteeth.com

unread,
Aug 24, 2017, 1:35:52 PM8/24/17
to OpenVDB Forum
My end goal is get a plugin for Maya 2017 working but starting off by compiling vdb 4.0.0. After a day of fighting I was able to output a solution for vs 2015. I'm running into the following errors and was wondering if anyone had suggestions?

Severity Code Description Project File Line Suppression State
Error C2375 'initpyopenvdb': redefinition; different linkage pyopenvdb C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\python\pyOpenVDBModule.cc 654
Error LNK2019 unresolved external symbol "private: static unsigned short const * const half::_eLut" (?_eLut@half@@0QBGB) referenced in function "public: __cdecl openvdb::v5_0_0::math::Vec3<class half>::Vec3<class half><float>(class openvdb::v5_0_0::math::Vec3<float> const &)" (??$?0M@?$Vec3@Vhalf@@@math@v5_0_0@openvdb@@QEAA@AEBV?$Vec3@M@123@@Z) openvdb_shared C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\points.obj 1
Error LNK2019 unresolved external symbol "private: static unsigned short const * const half::_eLut" (?_eLut@half@@0QBGB) referenced in function "public: __cdecl openvdb::v5_0_0::math::Vec2<class half>::Vec2<class half><float>(class openvdb::v5_0_0::math::Tuple<2,float> const &)" (??$?0M@?$Vec2@Vhalf@@@math@v5_0_0@openvdb@@QEAA@AEBV?$Tuple@$01M@123@@Z) vdb_print C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\main.obj 1
Error LNK2001 unresolved external symbol "private: static unsigned short const * const half::_eLut" (?_eLut@half@@0QBGB) openvdb_shared C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\openvdb.obj 1
Error LNK2019 unresolved external symbol "private: static union half::uif const * const half::_toFloat" (?_toFloat@half@@0QBTuif@1@B) referenced in function "class openvdb::v5_0_0::math::Vec3<float> * __cdecl std::copy<class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class openvdb::v5_0_0::math::Vec3<class half> > > >,class openvdb::v5_0_0::math::Vec3<float> *>(class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class openvdb::v5_0_0::math::Vec3<class half> > > >,class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class openvdb::v5_0_0::math::Vec3<class half> > > >,class openvdb::v5_0_0::math::Vec3<float> *)" (??$copy@V?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@V?$Vec3@Vhalf@@@math@v5_0_0@openvdb@@@std@@@std@@@std@@PEAV?$Vec3@M@math@v5_0_0@openvdb@@@std@@YAPEAV?$Vec3@M@math@v5_0_0@openvdb@@V?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@V?$Vec3@Vhalf@@@math@v5_0_0@openvdb@@@std@@@std@@@0@0PEAV1234@@Z) vdb_render C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\main.obj 1
Error LNK2019 unresolved external symbol "private: static union half::uif const * const half::_toFloat" (?_toFloat@half@@0QBTuif@1@B) referenced in function "class openvdb::v5_0_0::math::Vec3<float> * __cdecl std::copy<class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class openvdb::v5_0_0::math::Vec3<class half> > > >,class openvdb::v5_0_0::math::Vec3<float> *>(class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class openvdb::v5_0_0::math::Vec3<class half> > > >,class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class openvdb::v5_0_0::math::Vec3<class half> > > >,class openvdb::v5_0_0::math::Vec3<float> *)" (??$copy@V?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@V?$Vec3@Vhalf@@@math@v5_0_0@openvdb@@@std@@@std@@@std@@PEAV?$Vec3@M@math@v5_0_0@openvdb@@@std@@YAPEAV?$Vec3@M@math@v5_0_0@openvdb@@V?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@V?$Vec3@Vhalf@@@math@v5_0_0@openvdb@@@std@@@std@@@0@0PEAV1234@@Z) vdb_print C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\main.obj 1
Error LNK2019 unresolved external symbol "private: static union half::uif const * const half::_toFloat" (?_toFloat@half@@0QBTuif@1@B) referenced in function "bool __cdecl openvdb::v5_0_0::math::isExactlyEqual<class openvdb::v5_0_0::math::Vec3<class half>,class openvdb::v5_0_0::math::Vec3<class half> >(class openvdb::v5_0_0::math::Vec3<class half> const &,class openvdb::v5_0_0::math::Vec3<class half> const &)" (??$isExactlyEqual@V?$Vec3@Vhalf@@@math@v5_0_0@openvdb@@V1234@@math@v5_0_0@openvdb@@YA_NAEBV?$Vec3@Vhalf@@@012@0@Z) openvdb_shared C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\points.obj 1
Error LNK2001 unresolved external symbol "private: static union half::uif const * const half::_toFloat" (?_toFloat@half@@0QBTuif@1@B) openvdb_shared C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\openvdb.obj 1
Error C1128 number of sections exceeded object file format limit: compile with /bigobj vdb_test C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\unittest\TestTools.cc 1
Error LNK1120 2 unresolved externals openvdb_shared C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\Release\openvdb.dll 1
Error LNK1120 2 unresolved externals vdb_print C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\Release\vdb_print.exe 1
Error LNK1120 1 unresolved externals vdb_render C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\Release\vdb_render.exe 1


These are the external versions I'm using:
tbb2017_20160916oss
cppunit-1.13.2
boost_1_62_0
c-blosc-1.7.0
glew-1.13.0
glfw-3.2.1
ilmbase-2.2.0
openexr-2.2.0
zlib-1.2.11

Brian Mumm

unread,
Aug 24, 2017, 3:40:47 PM8/24/17
to OpenVDB Forum
So I ended up solving the "number of sections exceeded object file format limit: compile with /bigobj". By adding /bigobj to the command line.

Pretty sure the rest of these link errors are due to OpenEXR.

Oleg Bliznuk

unread,
Aug 24, 2017, 4:25:12 PM8/24/17
to OpenVDB Forum
If i recall correctly  from vdb 3.0, it uses the half float class from the exr/ilmbase suite, and that half class is always a headache, at least under win, as it does some config-time LUT generation for the f16<->f32 conversion. I ended up using my own simple implementation of these conversion functions on the fly, without luts. It does not properly (i.e. conforming the IEEE standards) handles various NaNs and stuff like that, but you would be in troubles anyway if encounter those values on your input .
i have attached modified half.h if you interested , also make sure you have
HALF_EXPORTS
OPENVDB_OPENEXR_STATICLIB
defined.

ps I never compiled the standalone vdb viewer/python bindings so not sure how it goes with these .
-Oleh
half.h

Brian Mumm

unread,
Aug 24, 2017, 7:19:46 PM8/24/17
to OpenVDB Forum
Thank you Oleg! That ended up fixing the linker errors. 

Is there a reason why the Maya plug-in is not in the base of nyue_openvdb_git? Do you have compile that in the openvdb_maya folder? This is the example of my cmake command.

set ILMBASE_ROOT=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static
set OPENEXR_ROOT=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static
set BOOST_ROOT=C:\Systems\x64\vc14\boost\v1.62.0
set GLFW3_ROOT=C:\Systems\x64\vc14\glfw\v3.2.1
set BLOSC_ROOT=C:\Systems\x64\vc14\c-blosc\v1.7.0
set CPPUNIT_ROOT=C:\Systems\x64\vc14\cppunit-1.13.2
set MAYA_LOCATION="C:\Program Files\Autodesk\Maya2017"
set Maya_DIR="C:\Program Files\Autodesk\Maya2017"
set TBB_ROOT=$MAYA_LOCATION
cmake ^
    -D Tbb_TBB_LIBRARY=$MAYA_LOCATION/lib/libtbb.so ^
    -D Tbb_TBBMALLOC_LIBRARY=$MAYA_LOCATION/lib/libtbbmalloc.so ^
    -D OPENVDB_ENABLE_3_ABI_COMPATIBLE=ON ^
    -D OPENVDB_BUILD_MAYA_PLUGIN=ON ^
    -D OPENVDB_ENABLE_RPATH=ON ^
    -D PYTHON_LIBRARY="C:\Program Files\Autodesk\Maya2016\Python\libs" ^
    -D PYTHON_INCLUDE_DIR="C:\Program Files\Autodesk\Maya2016\Python\include" ^
    -D MINIMUM_BOOST_VERSION=1.52 ^
    -D ILMBASE_NAMESPACE_VERSIONING=OFF ^
    -D OPENEXR_NAMESPACE_VERSIONING=OFF ^
    -D USE_GLFW3=ON ^
    -D Boost_USE_STATIC_LIBS=ON ^
    -D Blosc_USE_STATIC_LIBS=ON ^
    -D CPPUnit_USE_STATIC_LIBS=ON ^
    -G "Visual Studio 14 2015 Win64" ^
    -D CMAKE_INSTALL_PREFIX=..\openvdb_maya\MayaBuild ^
    ../openvdb_maya


It's not very happy with me doing this and is printing this error out.

  By not providing "FindMaya.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Maya", but
  CMake did not find one.

  Could not find a package configuration file provided by "Maya" with any of
  the following names:

    MayaConfig.cmake
    maya-config.cmake

Brian Mumm

unread,
Aug 24, 2017, 9:06:03 PM8/24/17
to OpenVDB Forum
Found out you had to turn on -D OPENVDB_BUILD_MAYA_PLUGIN=ON  in the master nyue_openvdb_git folder. 

Getting a good amount of undefined errors from the maya plugin looks like need to include some gl library will look into this further.

identifier "GL_VERTEX_SHADER" is undefined
identifier "GL_STATIC_DRAW" is undefined
identifier "GL_STATIC_DRAW" is undefined
identifier "GL_STATIC_DRAW" is undefined
identifier "GL_STATIC_DRAW" is undefined
identifier "GL_LINK_STATUS" is undefined
identifier "GL_LINK_STATUS" is undefined
identifier "GL_FRAGMENT_SHADER" is undefined
identifier "GL_ELEMENT_ARRAY_BUFFER" is undefined
identifier "GL_ELEMENT_ARRAY_BUFFER" is undefined
identifier "GL_ARRAY_BUFFER" is undefined
identifier "GL_ARRAY_BUFFER" is undefined
identifier "GL_ARRAY_BUFFER" is undefined
identifier "GL_ARRAY_BUFFER" is undefined
identifier "glUseProgram" is undefined
identifier "glUseProgram" is undefined
identifier "glShaderSource" is undefined
identifier "glShaderSource" is undefined
identifier "glLinkProgram" is undefined
identifier "glLinkProgram" is undefined
identifier "glIsShader" is undefined
identifier "glIsShader" is undefined
identifier "glIsShader" is undefined
identifier "glIsShader" is undefined
identifier "glIsShader" is undefined
identifier "glIsProgram" is undefined
identifier "glIsProgram" is undefined
identifier "glIsProgram" is undefined
identifier "glIsProgram" is undefined
identifier "glIsBuffer" is undefined
identifier "glIsBuffer" is undefined
identifier "glIsBuffer" is undefined
identifier "glIsBuffer" is undefined
identifier "glIsBuffer" is undefined
identifier "glIsBuffer" is undefined
identifier "glGetProgramiv" is undefined
identifier "glGetProgramiv" is undefined
identifier "glGetAttachedShaders" is undefined
identifier "glGenBuffers" is undefined
identifier "glGenBuffers" is undefined
identifier "glGenBuffers" is undefined
identifier "glGenBuffers" is undefined
identifier "glDetachShader" is undefined
identifier "glDeleteShader" is undefined
identifier "glDeleteProgram" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glDeleteBuffers" is undefined
identifier "glCreateShader" is undefined
identifier "glCreateShader" is undefined
identifier "glCreateProgram" is undefined
identifier "glCreateProgram" is undefined
identifier "glCompileShader" is undefined
identifier "glCompileShader" is undefined
identifier "GLchar" is undefined
identifier "GLchar" is undefined
identifier "glBufferData" is undefined
identifier "glBufferData" is undefined
identifier "glBufferData" is undefined
identifier "glBufferData" is undefined
identifier "glBindBuffer" is undefined
identifier "glBindBuffer" is undefined
identifier "glBindBuffer" is undefined
identifier "glBindBuffer" is undefined
identifier "glBindBuffer" is undefined
identifier "glBindAttribLocation" is undefined
identifier "glAttachShader" is undefined
identifier "glAttachShader" is undefined
identifier "glAttachShader" is undefined
identifier "glAttachShader" is undefined

James Burgess

unread,
Aug 24, 2017, 9:24:07 PM8/24/17
to OpenVDB Forum
Hi Brian,

 Those are OpenGL. Sadly Windows itself only ships OpenGL 1.1 (basically useless) and those symbols you're missing are at least a decade newer than that. 

So you will need to use something like glew to get those symbols. Maya uses glew but I don't see glew.lib anywhere in my 2017 install. Maybe you could find it somewhere on autodesk's site?

Alternatively you could download glew and compile and link against that. You'll need to build it statically otherwise you're plugin will get Maya's one and you'll run the risk of it being a different version.

Cheers,
- James

Brian Mumm

unread,
Aug 24, 2017, 10:15:53 PM8/24/17
to OpenVDB Forum
Thanks for the reply James I must be linking wrong in my cmake file because its not wanting to find those glew libs at all. 

setlocal
del /f CMakeCache.txt
set BOOST_ROOT=C:\Systems\x64\vc14\boost\v1.62.0
set GLEW_ROOT=C:\Systems\x64\vc14\glew\v2.1.0
set GLFW3_ROOT=C:\Systems\x64\vc14\glfw\v3.2.1
set ILMBASE_ROOT=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static
set OPENEXR_ROOT=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static
set TBB_ROOT=C:\Systems\x64\tbb2017_20160916oss
set BLOSC_ROOT=C:\Systems\x64\vc14\c-blosc\v1.7.0
set MAYA_LOCATION="C:\Program Files\Autodesk\Maya2017"
cmake ^
      -D Blosc_USE_STATIC_LIBS=OFF ^
      -D USE_GLFW3=ON ^
      -D GLFW3_USE_STATIC_LIBS=ON ^
      -D GLEW_USE_STATIC_LIBS=ON ^
      -D Boost_USE_STATIC_LIBS=ON ^
      -D OPENVDB_BUILD_MAYA_PLUGIN=ON ^
      -D GLEW_LIBRARY_PATH=C:\Systems\x64\vc14\glew\v2.1.0\lib\glew32.lib ^
      -D GLEW_LIBRARY_PATH=C:\Systems\x64\vc14\glew\v2.1.0\lib\glew32s.lib ^
      -D MAYA_LOCATION="C:\Program Files\Autodesk\Maya2017" ^
      -D GLFW3_glfw_LIBRARY=C:\Systems\x64\vc14\glfw\v3.2.1\src\Release\glfw3.lib ^
      -D BOOST_LIBRARYDIR=C:\Systems\x64\vc14\boost\v1.62.0\libs ^
      -D ZLIB_INCLUDE_DIR=C:/Systems/x64/vc14/zlib/v1.2.11 ^
      -D ZLIB_LIBRARY=C:/Systems/x64/vc14/zlib/v1.2.11/lib/zlibstatic.lib ^
      -D TBB_LIBRARY_PATH=%TBB_ROOT%\lib\intel64\vc14 ^
      -D Tbb_TBB_LIBRARY=%TBB_ROOT%\lib\intel64\vc14\tbb.lib ^
      -D Tbb_TBBMALLOC_LIBRARY=%TBB_ROOT%\lib\intel64\vc14\tbbmalloc.lib ^
      -D Tbb_TBB_PREVIEW_LIBRARY=%TBB_ROOT%\lib\intel64\vc14\tbb_preview.lib ^
      -D CPPUNIT_LOCATION=C:\Systems\x64\vc14\cppunit-1.13.2 ^
      -D CPPUnit_cppunit_LIBRARY=C:\Systems\x64\vc14\cppunit-1.13.2\lib\cppunit.lib ^
      -D Openexr_ILMIMF_LIBRARY=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static\lib\IlmImf-2_2.lib ^
      -D Ilmbase_ILMTHREAD_LIBRARY=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static\lib\IlmThread-2_2.lib ^
      -D Ilmbase_IEX_LIBRARY=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static\lib\Iex-2_2.lib ^
      -D Ilmbase_HALF_LIBRARY=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static\lib\Half.lib ^
      -D Ilmbase_IEXMATH_LIBRARY=C:\Systems\x64\vc14\OpenEXR\v2.2.0-static\lib\IexMath-2_2.lib ^
      -D OpenVDB_LIBRARY_DIR=C:\Users\RT\Desktop\nyue_openvdb_git\openvdb\Release ^
      -D CMAKE_INSTALL_PREFIX=..\nyue_openvdb_gitopenvdb\v4.0.0 ^
      -G "Visual Studio 14 2015 Win64" ^
      ..\nyue_openvdb_git

Brian Mumm

unread,
Aug 25, 2017, 11:33:57 AM8/25/17
to OpenVDB Forum
So the OpenVDBUtil.h is including #include <GL/gl.h> #include <GL/glu.h> at the top if its windows. I removed most of the errors by messing around with includes. 

Getting two errors right now.

Error C2065 'GLchar': undeclared identifier openvdb_maya
Error C1189 #error:  gl.h included before glew.h openvdb_maya

I tried including glew.h before the other includes that creates even more issues. I will post here with more updates as I work throughout the day.
Message has been deleted

Brian Mumm

unread,
Aug 25, 2017, 4:57:35 PM8/25/17
to OpenVDB Forum

So got past the compile steps by adding #include <glew.h> to OpenVDBUtil.h and removing the scope on boost for isnaan since it was conflicting with Maya's MTypes isnaan

Now getting linker errors like this example:

Error LNK2005 "struct HINSTANCE__ * MhInstPlugin" (?MhInstPlugin@@3PEAUHINSTANCE__@@EA) already defined in OpenVDBCopyNode.obj openvdb_maya C:\Users\RT\Desktop\nyue_openvdb_git\openvdb_maya\OpenVDBWriteNode.obj 1

Anyone else run into these before?

James Burgess

unread,
Aug 30, 2017, 2:02:10 AM8/30/17
to OpenVDB Forum
Hi Brian,

 Yes, this comes from how Maya's MFnPlugin.h works. Every file in a plugin will need to be compiled with -DMNoPluginEntry except one. Your problem is you are trying to link more than one file that has been compiled without that define. OpenVDBWriteNode.cpp and OpenVDBCopyNode.cpp by the looks of it.

I don't think the absence of -DMNoPluginEntry does anything other than define the global variable MhInstPlugin and the DllMain routine, so it won't matter which .cpp gets it and which do not.


Cheers,
- James

Juan Cristóbal Quesada

unread,
May 31, 2018, 10:39:35 AM5/31/18
to OpenVDB Forum
Hi,
Im trying to make openvdb maya work for maya 2017 with visual studio 2012 x64.
ive followed the instructions of rchoetzlein as a base and then been tweaking the cmakelists and playing with the compiling options in visual studio to the point where i have managed to build openvdb.lib as static library and also the openvdb_maya.mll maya plugin.
My problem comes when maya tries to load the plugin, im getting a 

// Error: line 1: A dynamic link library (DLL) initialization routine failed openvdb_maya.mll

error.

Ive recompiled the plugin with the "openvdb::initialize()" line commented as well as returning NULL in the "openVDBData::creator()" to discard possible issues with openvdb.lib, in the "initializePlugin()" function.

Moreover, ive built correctly the openvdb_cookbook project provided and it runs well, so im starting to think that openvdb.lib is not the problem... How can i debug this?

Here are some snapshots of  my openvdb_maya_plugin folder.

Could i be missing any dll or lib?






Captura5.PNG
Captura.PNG
Captura2.PNG
Captura3.PNG
Reply all
Reply to author
Forward
0 new messages