tunabrain / tungsten

High performance physically based renderer in C++11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linker error on Linux with gcc 7.2

CounterPillow opened this issue · comments

[ 80%] Linking CXX static library libcore.a
[ 80%] Built target core
Scanning dependencies of target scenemanip
Scanning dependencies of target json2xml
Scanning dependencies of target hdrmanip
Scanning dependencies of target obj2json
[ 81%] Building CXX object CMakeFiles/scenemanip.dir/src/scenemanip/scenemanip.cpp.o
[ 82%] Building CXX object CMakeFiles/hdrmanip.dir/src/hdrmanip/hdrmanip.cpp.o
[ 82%] Building CXX object CMakeFiles/obj2json.dir/src/obj2json/obj2json.cpp.o
[ 82%] Building CXX object CMakeFiles/json2xml.dir/src/json2xml/json2xml.cpp.o
[ 82%] Linking CXX executable obj2json
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::AffineMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math9AffineMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math9AffineMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::ScaleTranslateMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math17ScaleTranslateMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math17ScaleTranslateMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::TranslationMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math14TranslationMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math14TranslationMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::ScaleMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math8ScaleMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math8ScaleMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::AffineMap::preShear(double, openvdb::v4_0_2::math::Axis, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math9AffineMap8preShearEdNS1_4AxisES3_[_ZNK7openvdb6v4_0_24math9AffineMap8preShearEdNS1_4AxisES3_]+0xce): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o):GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math17ScaleTranslateMap8preShearEdNS1_4AxisES3_[_ZNK7openvdb6v4_0_24math17ScaleTranslateMap8preShearEdNS1_4AxisES3_]+0xce): more undefined references to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)' follow
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::GridBase::GridBase(openvdb::v4_0_2::GridBase const&)':
VdbGrid.cpp:(.text._ZN7openvdb6v4_0_28GridBaseC2ERKS1_[_ZN7openvdb6v4_0_28GridBaseC5ERKS1_]+0x57): undefined reference to `openvdb::v4_0_2::math::Transform::Transform(std::shared_ptr<openvdb::v4_0_2::math::MapBase> const&)'
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::tree::LeafBuffer<openvdb::v4_0_2::math::Vec2<float>, 3u>::doLoad() const':
VdbGrid.cpp:(.text._ZNK7openvdb6v4_0_24tree10LeafBufferINS0_4math4Vec2IfEELj3EE6doLoadEv[_ZNK7openvdb6v4_0_24tree10LeafBufferINS0_4math4Vec2IfEELj3EE6doLoadEv]+0x13c): undefined reference to `openvdb::v4_0_2::io::setStreamMetadataPtr(std::ios_base&, std::shared_ptr<openvdb::v4_0_2::io::StreamMetadata>&, bool)'
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::tree::LeafBuffer<float, 3u>::doLoad() const':
VdbGrid.cpp:(.text._ZNK7openvdb6v4_0_24tree10LeafBufferIfLj3EE6doLoadEv[_ZNK7openvdb6v4_0_24tree10LeafBufferIfLj3EE6doLoadEv]+0x13c): undefined reference to `openvdb::v4_0_2::io::setStreamMetadataPtr(std::ios_base&, std::shared_ptr<openvdb::v4_0_2::io::StreamMetadata>&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/obj2json.dir/build.make:111: obj2json] Error 1
make[1]: *** [CMakeFiles/Makefile2:197: CMakeFiles/obj2json.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 82%] Linking CXX executable hdrmanip
[ 82%] Built target hdrmanip
[ 82%] Linking CXX executable scenemanip
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::AffineMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math9AffineMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math9AffineMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::ScaleTranslateMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math17ScaleTranslateMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math17ScaleTranslateMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::TranslationMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math14TranslationMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math14TranslationMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::ScaleMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math8ScaleMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math8ScaleMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::AffineMap::preShear(double, openvdb::v4_0_2::math::Axis, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math9AffineMap8preShearEdNS1_4AxisES3_[_ZNK7openvdb6v4_0_24math9AffineMap8preShearEdNS1_4AxisES3_]+0xce): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o):GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math17ScaleTranslateMap8preShearEdNS1_4AxisES3_[_ZNK7openvdb6v4_0_24math17ScaleTranslateMap8preShearEdNS1_4AxisES3_]+0xce): more undefined references to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)' follow
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::GridBase::GridBase(openvdb::v4_0_2::GridBase const&)':
VdbGrid.cpp:(.text._ZN7openvdb6v4_0_28GridBaseC2ERKS1_[_ZN7openvdb6v4_0_28GridBaseC5ERKS1_]+0x57): undefined reference to `openvdb::v4_0_2::math::Transform::Transform(std::shared_ptr<openvdb::v4_0_2::math::MapBase> const&)'
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::tree::LeafBuffer<openvdb::v4_0_2::math::Vec2<float>, 3u>::doLoad() const':
VdbGrid.cpp:(.text._ZNK7openvdb6v4_0_24tree10LeafBufferINS0_4math4Vec2IfEELj3EE6doLoadEv[_ZNK7openvdb6v4_0_24tree10LeafBufferINS0_4math4Vec2IfEELj3EE6doLoadEv]+0x13c): undefined reference to `openvdb::v4_0_2::io::setStreamMetadataPtr(std::ios_base&, std::shared_ptr<openvdb::v4_0_2::io::StreamMetadata>&, bool)'
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::tree::LeafBuffer<float, 3u>::doLoad() const':
VdbGrid.cpp:(.text._ZNK7openvdb6v4_0_24tree10LeafBufferIfLj3EE6doLoadEv[_ZNK7openvdb6v4_0_24tree10LeafBufferIfLj3EE6doLoadEv]+0x13c): undefined reference to `openvdb::v4_0_2::io::setStreamMetadataPtr(std::ios_base&, std::shared_ptr<openvdb::v4_0_2::io::StreamMetadata>&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/scenemanip.dir/build.make:111: scenemanip] Error 1
make[1]: *** [CMakeFiles/Makefile2:277: CMakeFiles/scenemanip.dir/all] Error 2
[ 83%] Linking CXX executable json2xml
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::AffineMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math9AffineMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math9AffineMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::ScaleTranslateMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math17ScaleTranslateMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math17ScaleTranslateMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::TranslationMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math14TranslationMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math14TranslationMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::ScaleMap::postRotate(double, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math8ScaleMap10postRotateEdNS1_4AxisE[_ZNK7openvdb6v4_0_24math8ScaleMap10postRotateEdNS1_4AxisE]+0x7e): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o): In function `openvdb::v4_0_2::math::AffineMap::preShear(double, openvdb::v4_0_2::math::Axis, openvdb::v4_0_2::math::Axis) const':
GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math9AffineMap8preShearEdNS1_4AxisES3_[_ZNK7openvdb6v4_0_24math9AffineMap8preShearEdNS1_4AxisES3_]+0xce): undefined reference to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)'
libcore.a(GridFactory.cpp.o):GridFactory.cpp:(.text._ZNK7openvdb6v4_0_24math17ScaleTranslateMap8preShearEdNS1_4AxisES3_[_ZNK7openvdb6v4_0_24math17ScaleTranslateMap8preShearEdNS1_4AxisES3_]+0xce): more undefined references to `openvdb::v4_0_2::math::simplify(std::shared_ptr<openvdb::v4_0_2::math::AffineMap>)' follow
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::GridBase::GridBase(openvdb::v4_0_2::GridBase const&)':
VdbGrid.cpp:(.text._ZN7openvdb6v4_0_28GridBaseC2ERKS1_[_ZN7openvdb6v4_0_28GridBaseC5ERKS1_]+0x57): undefined reference to `openvdb::v4_0_2::math::Transform::Transform(std::shared_ptr<openvdb::v4_0_2::math::MapBase> const&)'
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::tree::LeafBuffer<openvdb::v4_0_2::math::Vec2<float>, 3u>::doLoad() const':
VdbGrid.cpp:(.text._ZNK7openvdb6v4_0_24tree10LeafBufferINS0_4math4Vec2IfEELj3EE6doLoadEv[_ZNK7openvdb6v4_0_24tree10LeafBufferINS0_4math4Vec2IfEELj3EE6doLoadEv]+0x13c): undefined reference to `openvdb::v4_0_2::io::setStreamMetadataPtr(std::ios_base&, std::shared_ptr<openvdb::v4_0_2::io::StreamMetadata>&, bool)'
libcore.a(VdbGrid.cpp.o): In function `openvdb::v4_0_2::tree::LeafBuffer<float, 3u>::doLoad() const':
VdbGrid.cpp:(.text._ZNK7openvdb6v4_0_24tree10LeafBufferIfLj3EE6doLoadEv[_ZNK7openvdb6v4_0_24tree10LeafBufferIfLj3EE6doLoadEv]+0x13c): undefined reference to `openvdb::v4_0_2::io::setStreamMetadataPtr(std::ios_base&, std::shared_ptr<openvdb::v4_0_2::io::StreamMetadata>&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/json2xml.dir/build.make:111: json2xml] Error 1
make[1]: *** [CMakeFiles/Makefile2:74: CMakeFiles/json2xml.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

openvdb is installed:

$ pacman -Ql openvdb | grep libopenvdb.so
openvdb /usr/lib/libopenvdb.so
openvdb /usr/lib/libopenvdb.so.4.0
openvdb /usr/lib/libopenvdb.so.4.0.2

So far I've only tested with openvdb 3.0.0. It's surprising that it compiles at all with 4.0.0 (and fails only during the linking stage). Can you retry with openvdb v3 and see if that fixes the issue?

Apparently 4.0 contains some ABI changes, which might explain the linker failures.

From their release notes, section ABI changes::

  • Added a NodeUnion template specialization for non-POD value types that significantly expedites construction and destruction of vector-valued grids.
  • Changed Coord’s data representation to facilitate C++11 uniform initialization.
  • Replaced occurrences of boost::shared_ptr with std::shared_ptr.
  • Changed GridBase::copyGrid and Grid::copy to close const-correctness holes.
  • Added virtual function Tree::unallocatedLeafCount.

Might try a downgrade later.

Thanks looking into this! openvdb 4 is pretty low priority, so I will close this for now.