AcademySoftwareFoundation / AcademySoftwareFoundation/xstudio
`Imath` dependency missing from various component target builds
- Dominant language
- C++
- Stars
- 769
- Forks
- 129
- Avg merge
- 9d 1m
- Merged PRs (30d)
- 10
Description
When attempting to build xstudio from the v0.11.2 tag on CentOS 7, it appears there are some broken CMake recipes related to the lack of `Imath` inclusion.
#### CMake Command:
```
cmake \
-D CMAKE_INSTALL_PREFIX=/path/to/install_prefix \
-D CMAKE_EXE_LINKER_FLAGS=-Wl,--enable-new-dtags \
-D CMAKE_SHARED_LINKER_FLAGS=-Wl,--enable-new-dtags \
-D CMAKE_CXX_EXTENSIONS=OFF \
-D CMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \
-D CMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
-D Python_ROOT_DIR=/path/to/python_root \ # This doesn't work right, but I will open a separate issue for it
-D Qt5_DIR=/path/to/qt5_root \
-D BUILD_DOCS=OFF \
/path/to/source_dir
```
The `Imath` install is being located at build time by its bundled `ImathConfig.cmake`, which is discovered from the `CMAKE_PREFIX_PATH` environment variable.
The first error encountered is this:
```
[ 5%] Building CXX object src/utility/src/CMakeFiles/utility_static.dir/container.cpp.o
cd /lumalocal/bonus/dev/rez-build/xstudio/dev/build/platform-linux/gcc-9.3.1/python-3.9/src/utility/src && /opt/rh/devtoolset-9/root/usr/bin/g++ -DBINARY_DIR=\"/lumalocal/bonus/dev/rez-build/xstudio/dev/build/platform-linux/gcc-9.3.1/python-3.9/bin\" -DFMT_LOCALE -DFMT_SHARED -DPROJECT_VERSION=\"0.1.0\" -DROOT_DIR=\"/lumalocal/bonus/dev/rez-build/xstudio/dev/src\" -DSPDLOG_COMPILED_LIB -DSPDLOG_SHARED_LIB -DTEST_RESOURCE=\"/lumalocal/bonus/dev/rez-build/xstudio/dev/src/test_resource\" -DXSTUDIO_GLOBAL_NAME=\"xStudio\" -DXSTUDIO_GLOBAL_VERSION=\"0.11.2\" -D__linux__ -Dtest_private=private -I/lumalocal/bonus/dev/rez-build/xstudio/dev/build/platform-linux/gcc-9.3.1/python-3.9/src/utility/src -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/include -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/src -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/SYSTEM -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/extern/include -I/lumalocal/bonus/dev/rez-build/xstudio/dev/src/extern/reproc/reproc++/include -isystem /luma/dev/ruschn/rez-release/actor_framework/0.18.4/platform-linux/gcc-9.3.1/include -isystem /luma/dev/ruschn/rez-release/fmt/8.0.1/platform-linux/gcc-9.3.1/include -isystem /luma/dev/ruschn/rez-release/nlohmann_json/3.11.2/platform-linux/include -isystem /luma/dev/ruschn/rez-release/spdlog/1.9.2/platform-linux/gcc-9.3.1/include -D_GLIBCXX_USE_CXX11_ABI=0 -fpic -fmax-errors=5 -fdiagnostics-color=always -O3 -DNDEBUG -fdiagnostics-color=always -pthread -std=c++17 -MD -MT src/utility/src/CMakeFiles/utility_static.dir/container.cpp.o -MF CMakeFiles/utility_static.dir/container.cpp.o.d -o CMakeFiles/utility_static.dir/container.cpp.o -c /lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/container.cpp
In file included from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/utility/uuid.hpp:19,
from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/atoms.hpp:18,
from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/utility/container.hpp:18,
from /lumalocal/bonus/dev/rez-build/xstudio/dev/src/src/utility/src/container.cpp:5:
/lumalocal/bonus/dev/rez-build/xstudio/dev/src/include/xstudio/utility/json_store.hpp:14:10: fatal error: Imath/ImathBox.h: No such file or directory
14 | #include
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
```
This same issue affects quite a few of the component object builds:
- `broadcast`
- `global_store`
- `json_store`
- `ui`
- `utility`
In general, the fact that `find_package` calls are localized and repeated within each dependent object's build definition, instead of performed once at the top level of the project, makes resolving these issues much more repetitive and error-prone than it needs to be.
Also, components that are dependencies of other components should include things like the `Imath` include directories/libraries in their public include directories/link libraries, so that builds of dependent targets will pull them in automatically.
I'm currently hacking my way through these to get the project to build, but it seems like a re-work of the dependency discovery/resolution might be in order.
#### Versions
- CentOS 7.9.2009
- GCC 9.3.1 (installed via devtoolset-9 RPM)
- CMake 3.25.1
- Imath 3.1.9
- Python 3.9.13
Contributor guide
Research direction
Start with the CMake build definitions for broadcast, global_store, json_store, ui, and utility, then inspect how the top-level configuration discovers Imath. Reproduce the v0.11.2 CentOS 7 build using the shown CMake setup and verify that dependent targets receive Imath include directories and libraries and all listed component builds compile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100