AcademySoftwareFoundation / openvdb

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

[BUILD] cmake fails to configure vdb_tool when -DOPENVDB_TOOL_USE_EXR=ON #1541

Open waebbl opened 1 year ago

waebbl commented 1 year ago

Environment

Operating System: Gentoo 2.9 Version / Commit SHA: VDB 10.0.1 CMake Version: 3.25.1 Compiler: gcc 11

Describe the problem

Trying to build the vdb_tool binary fails in cmake configuration, because it uses OpenEXR-2 library OpenEXR:IlmImf. Replacing the link line and using OpenEXR:OpenEXR as the link library for OpenEXR-3 let the tool be built. The error is:

-- Configuring done
CMake Error at openvdb_cmd/vdb_tool/CMakeLists.txt:96 (target_link_libraries):
  The link interface of target "vdb_tool_common" contains:

    OpenEXR::IlmImf

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

-- Generating done

To Reproduce

Steps to reproduce the behavior:

  1. Download the 10.0.1 release tarball from GitHub
  2. Run CMake
    cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_DOCDIR=share/doc/openvdb-10.0.1/ -DOPENVDB_ABI_VERSION_NUMBER=10 -DOPENVDB_BUILD_DOCS=no -DOPENVDB_BUILD_UNITTESTS=yes -DOPENVDB_BUILD_VDB_LOD=yes -DOPENVDB_BUILD_VDB_RENDER=yes -DOPENVDB_BUILD_VDB_TOOL=yes -DOPENVDB_BUILD_VDB_VIEW=yes -DOPENVDB_CORE_SHARED=ON -DOPENVDB_CORE_STATIC=no -DOPENVDB_ENABLE_RPATH=OFF -DUSE_AX=no -DUSE_BLOSC=no -DUSE_CCACHE=OFF -DUSE_COLORED_OUTPUT=ON -DUSE_EXR=yes -DUSE_IMATH_HALF=ON -DUSE_LOG4CPLUS=ON -DUSE_NANOVDB=no -DUSE_PKGCONFIG=ON -DUSE_PNG=yes -DUSE_STATIC_DEPENDENCIES=no -DUSE_TBB=ON -DUSE_ZLIB=no -DBUILD_TEST=yes -DOPENVDB_BUILD_VDB_AX=no -DOPENVDB_TOOL_NANO_USE_BLOSC=OFF -DOPENVDB_TOOL_USE_ABC=OFF -DOPENVDB_TOOL_USE_EXR=ON -DOPENVDB_TOOL_USE_JPG=ON -DOPENVDB_TOOL_USE_NANO=no -DOPENVDB_TOOL_USE_PNG=ON -DOPENVDB_SIMD=AVX -DCMAKE_BUILD_TYPE=RelWithDebInfo
  3. See error above

Additional context

I removed the command line options for our toolchain file and initial cache from the above command for better readability. They don't have an influence on the outcome.

cederom commented 11 months ago

This IlmBase vs Imath also causes build problems on FreeBSD and dependencies such as BambuStudio (see https://github.com/bambulab/BambuStudio/issues/2606).

Please update dependency on OpenEXR to 3.X (3.2.1 is out already!) and Imath in place of OpenEXR 2.X and IlmBase :-)

Here is the FreeBSD port of OpenVDB that patches cmake in order to work with modern OpenEXR 3.X + Imath: https://cgit.freebsd.org/ports/tree/misc/openvdb.

cederom commented 11 months ago

Here goest the example IlmBase -> Imath fix that comes from the FreeBSD Ports: https://github.com/AcademySoftwareFoundation/openvdb/pull/1678.

This further requires update of OpenVDB upstream to use OpenEXR 3.x + Imath.