Build Failure: undefined reference to 'openvdb::v9_1::points::AttributeArray::AttributeArray

Hi all, I’m looking to explore blender code and hopefully make some contributions.

I’m running Arch Linux in a virtual machine in Chrome OS’ Crostini environment.

When installing build deps, OpenSubDivision build failed first, so I skipped it(will post error later)… I managed to install it using Arch Linux packages.

All the Blender code compiles, but I’m getting failure in the final linking phase. Can anyone suggest the next steps for troubleshooting this?

make[2]: Entering directory '/home/spundun/blender-git/build_linux'
[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[100%] Linking CXX executable ../../bin/blender
/opt/lib/usd/lib/libusd_usd_ms.so: error: undefined reference to '__free_hook'
/opt/lib/usd/lib/libusd_usd_ms.so: error: undefined reference to '__realloc_hook'
/opt/lib/usd/lib/libusd_usd_ms.so: error: undefined reference to '__memalign_hook'
/opt/lib/usd/lib/libusd_usd_ms.so: error: undefined reference to '__malloc_hook'
../../lib/libextern_mantaflow.a(iovdb.cpp.o):iovdb.cpp:function openvdb::v9_1::points::TypedAttributeArray<openvdb::v9_1::math::Vec3<float>, openvdb::v9_1::points::TruncateCodec>::copy() const: error: undefined reference to 'openvdb::v9_1::points::AttributeArray::AttributeArray(openvdb::v9_1::points::AttributeArray const&, tbb::spin_mutex::scoped_lock const&)'
../../lib/libextern_mantaflow.a(iovdb.cpp.o):iovdb.cpp:function openvdb::v9_1::points::TypedAttributeArray<float, openvdb::v9_1::points::TruncateCodec>::copy() const: error: undefined reference to 'openvdb::v9_1::points::AttributeArray::AttributeArray(openvdb::v9_1::points::AttributeArray const&, tbb::spin_mutex::scoped_lock const&)'
../../lib/libextern_mantaflow.a(iovdb.cpp.o):iovdb.cpp:function openvdb::v9_1::points::TypedAttributeArray<int, openvdb::v9_1::points::TruncateCodec>::copy() const: error: undefined reference to 'openvdb::v9_1::points::AttributeArray::AttributeArray(openvdb::v9_1::points::AttributeArray const&, tbb::spin_mutex::scoped_lock const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [source/creator/CMakeFiles/blender.dir/build.make:450: bin/blender] Error 1
make[2]: Leaving directory '/home/spundun/blender-git/build_linux'
make[1]: *** [CMakeFiles/Makefile2:7506: source/creator/CMakeFiles/blender.dir/all] Error 2
make[1]: Leaving directory '/home/spundun/blender-git/build_linux'
make: *** [Makefile:166: all] Error 2
make: Leaving directory '/home/spundun/blender-git/build_linux'```

For the USD issue, you’ll need to follow the workaround, in some fashion, as described in their github issue: USD uses deprecated malloc hooks removed in glibc 2.34 · Issue #1592 · PixarAnimationStudios/USD · GitHub

Unsure about that OpenVDB issue though.

Beyond that, the supported build environment is to use the pre-compiled libraries to ensure you’re getting exactly what’s supported, known working, and tested. That’s at least an option to unblock your progress.

Thanks for the response… Your response makes sense, but that didn’t work either. I ran the following commands

cd ~/blender-git/lib
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64
cd ~/blender-git/blender
make

I got a whole slew of link errors this time Build errors during the linking phase when building blender. With precompiled dependencies. · GitHub

I’m going to try to build latest USD locally and see how far I get.

In the mean time I appreciate any thoughts on fixing the linking errors I post in the gist.

We do not ship openvdb 9.1 in the precompiled libs, yet it’s still trying to link it, meaning it must have picked up the 9.1 headers somewhere from your local environment. Switching from system libs to svn generally doesn’t go smoothly with cmake caching all sorts of things, try removing your build folder and see if it sorts it self out.

Thanks for that tip. I’ll try that as well. I guess I have 3 copies of most of the libs now. svn, locally built using the blender script, and system libs.

Yay! That worked! I’m able to start my newly built blender with the familiar spalsh screen.

Thanks a lot for your help!

1 Like