AcademySoftwareFoundation / openvdb

OpenVDB - Sparse volume data structure and tools
http://www.openvdb.org/
Mozilla Public License 2.0
2.62k stars 647 forks source link

[BUILD] -lHalf/imath_half_to_float_table missing from Ubuntu 23.04 #1662

Closed lucasw closed 1 year ago

lucasw commented 1 year ago

Environment

Ubuntu 23.04 v10.0.1 cmake version 3.25.1 gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0

Describe the problem

I can install this with apt or build from source but I get the same error when I try to link an application (vdb_mapping)- either -lHalf is missing or I removed that from the CMakeLists.txt and get this:

/usr/bin/ld: CMakeFiles/mapping_tests.dir/mapping.cpp.o: undefined reference to symbol 'imath_half_to_float_table'
/usr/bin/ld: /lib/x86_64-linux-gnu/libImath-3_1.so.29: error adding symbols: DSO missing from command line

I don't see a libhalf-dev in 23.04, do I need to build that from source?

To Reproduce

Steps to reproduce the behavior:

  1. Checkout repo https://github.com/fzi-forschungszentrum-informatik/vdb_mapping
  2. Run catkin build vdb_mapping
  3. See error

Probably this would be demonstrated by a non-ros/catkin application as well- I'm trying enabling OPENVDB_BUILD_UNITTESTS now.

Maybe this is strictly a Ubuntu 23.04 issue for not having that library- but if that's the case why is libopenvdb-dev apt installable? Or this error has nothing to do with openvdb?

Additional context

https://github.com/fzi-forschungszentrum-informatik/vdb_mapping/issues/5

lucasw commented 1 year ago

OPENVDB_BUILD_UNITTESTS set true works, ./openvdb/openvdb/unittest/vdb_test builds and runs and tests pass.

I can comment all of the vdb_mapping tests (https://github.com/lucasw/vdb_mapping/blob/ubuntu_2304/tests/mapping.cpp) and just have the following I get the same linker error:

  using GridT2 = openvdb::Grid<typename openvdb::tree::Tree4<float, 5, 4, 3>::Type>;
  if (!GridT2::isRegistered())
  {
    GridT2::registerGrid();
  }

Commenting out the registerGrid() links fine.

Inserting that all into openvdb/unittest/TestGrid.cc links fine.

update But vdb_mapping is linking to Imath libImath-3_1.so.29 => /lib/x86_64-linux-gnu/libImath-3_1.so.29 (0x00007ff6e99b0000) and vdb_tests had it disabled, so I'll try with it enabled.

lucasw commented 1 year ago

I just needed to add -lImath to vdb_mapping