Fix: Add GNUInstallDirs to resolve CMAKE_INSTALL_FULL_LIBDIR undefined error#9
Fix: Add GNUInstallDirs to resolve CMAKE_INSTALL_FULL_LIBDIR undefined error#9aayushyatiwari wants to merge 3 commits intoML4EP:devfrom
Conversation
There was a problem hiding this comment.
Hi @aayushyatiwari
Thanks for your PR. One question, do you see these errors after you have sourced a pre-compiled binary of ROOT and the setup.sh file?
|
Hi @sanjibansg, I encountered this error using ROOT built from source (v6.39.01 on the sofie-dev branch) rather than a pre-built binary. I haven't tested with a pre-built binary. The fix still applies since RootMacros.cmake uses CMAKE_INSTALL_FULL_LIBDIR regardless of how ROOT was built, i think. but I can verify with a pre-built binary if needed. |
The source of the ROOT installation should not make a difference. Can you send the steps you performed to reproduce the error on our side? |
|
machine: Ubuntu 24.04 Steps: git clone https://github.com/sanjibansg/SOFIE.git
cd SOFIE
mkdir build && cd build
cmake -Dtesting=ON -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cmake --build . --target install -j10the exact error was this: -- Could NOT find Python module torch. Corresponding tests will be disabled.
CMake Error at /home/imaayush/code/root_build/RootMacros.cmake:2257 (cmake_path):
cmake_path undefined variable for input path.
Call Stack (most recent call first):
/home/imaayush/code/root_build/RootMacros.cmake:1470 (ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH)
src/SOFIE_core/test/CMakeLists.txt:127 (ROOT_EXECUTABLE)
CMake Error at /home/imaayush/code/root_build/RootMacros.cmake:2257 (cmake_path):
cmake_path undefined variable for input path.
Call Stack (most recent call first):
/home/imaayush/code/root_build/RootMacros.cmake:1470 (ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH)
src/SOFIE_core/test/CMakeLists.txt:130 (ROOT_EXECUTABLE)
-- Configuring incomplete, errors occurred!
gmake: Makefile: No such file or directory
gmake: *** No rule to make target 'Makefile'. Stop. |
Could you try sourcing the installed ROOT libraries after you have built it? |
|
The error occurs during cmake configuration, before the build step. Sourcing ROOT's thisroot.sh was already done before running cmake. (torchgpu) _sofie\ $ root --version
ROOT Version: 6.39.01
Built for linuxx8664gcc on Mar 05 2026, 20:20:44
From heads/sofie-dev@41e48a99Could you clarify which thisroot.sh you're referring to? |
|
For clearance, I had build root_src from official root build from source website. Does that clear the setup part a bit? |
While building standalone SOFIE with -Dtesting=ON, cmake configuration
failed with the following error:
CMake Error at RootMacros.cmake:2257 (cmake_path):
cmake_path undefined variable for input path.
RootMacros.cmake uses CMAKE_INSTALL_FULL_LIBDIR internally in
ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH, which is only defined by CMake's
GNUInstallDirs module. Since standalone SOFIE never included it, the
variable was undefined causing the error.
Fix: Added include(GNUInstallDirs) after include(${ROOT_USE_FILE})
in
CMakeLists.txt.