Skip to content

Fix: Add GNUInstallDirs to resolve CMAKE_INSTALL_FULL_LIBDIR undefined error#9

Open
aayushyatiwari wants to merge 3 commits intoML4EP:devfrom
aayushyatiwari:dev
Open

Fix: Add GNUInstallDirs to resolve CMAKE_INSTALL_FULL_LIBDIR undefined error#9
aayushyatiwari wants to merge 3 commits intoML4EP:devfrom
aayushyatiwari:dev

Conversation

@aayushyatiwari
Copy link

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.

Copy link
Member

@sanjibansg sanjibansg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@aayushyatiwari
Copy link
Author

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.

@sanjibansg
Copy link
Member

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?

@aayushyatiwari
Copy link
Author

aayushyatiwari commented Mar 6, 2026

machine: Ubuntu 24.04
ROOT: v6.39.01 built from source.

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 -j10

the 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.

@sanjibansg
Copy link
Member

sanjibansg commented Mar 6, 2026

machine: Ubuntu 24.04 ROOT: v6.39.01 built from source.

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 -j10

the 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?

source install/bin/thisroot.sh

@aayushyatiwari
Copy link
Author

The error occurs during cmake configuration, before the build step. Sourcing ROOT's thisroot.sh was already done before running cmake.
Before the cmake, I had root built from root_src and doing root --version did

(torchgpu) _sofie\ $ root --version
ROOT Version: 6.39.01
Built for linuxx8664gcc on Mar 05 2026, 20:20:44
From heads/sofie-dev@41e48a99

Could you clarify which thisroot.sh you're referring to?

@aayushyatiwari
Copy link
Author

For clearance, I had build root_src from official root build from source website.
I completed my excersises for improving parsers for pytorch and keras projects and so I was installing sofie standalone for the ML inference for heterogaenous architectures using SOFIE project when I figured I had already built root and sourced it from the root_src folder. So I just did the steps mentioned in this repo's readme.md file.

Does that clear the setup part a bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants