Causing cmake to ignore /usr/lib64

_ROOT Version: 6.16.00
_Platform: CentOS 7
_Compiler: gcc 7.2.0

I’m trying to build root with an alternative set of compilers and libraries, but I’m having trouble making cmake use the alternative libraries instead of those in /usr/lib64. For example, cmake will generate makefiles that refer to /usr/lib64/, /usr/lib64/, and /usr/lib64/, rather than alternative versions of those libraries located elsewhere.

I’ve piled on various attempts to coerce cmake into preferring the alternative directories, so that my build process now looks like this:

export PYTHONHOME=`which python | sed -e 's"/bin/python""'`

export LIBRARY_PATH="$LIBRARY_PATH:$BOOST_ROOT/lib:$PYTHONHOME/lib:$PYTHONHOME/pkgs/xorg-libxrender-0.9.10-h470a237_2/lib:$PYTHONHOME/pkgs/xorg-libxau-1.0.8-h470a237_6/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BOOST_ROOT/lib:$PYTHONHOME/lib:$PYTHONHOME/pkgs/xorg-libxrender-0.9.10-h470a237_2/lib:$PYTHONHOME/pkgs/xorg-libxau-1.0.8-h470a237_6/lib"
export LDFLAGS="-Wl,-rpath,$PYTHONHOME/lib -Wl,-rpath,$PYTHONHOME/pkgs/xorg-libxrender-0.9.10-h470a237_2/lib -Wl,-rpath,$PYTHONHOME/pkgs/xorg-libxau-1.0.8-h470a237_6/lib"

cmake -DCMAKE_INSTALL_PREFIX=/share/apps/physics/lmdx/root \
      -DCMAKE_CXX_COMPILER=`which g++` \
      -DCMAKE_C_COMPILER=`which gcc` \
      -DPYTHON_EXECUTABLE=`which python` \
      -DCMAKE_PREFIX_PATH="$BOOST_ROOT:$PYTHONHOME:$PYTHONHOME/pkgs/xorg-libxrender-0.9.10-h470a237_2/:$PYTHONHOME/pkgs/xorg-libxau-1.0.8-h470a237_6:/usr:/" \
      -DPYTHON_INCLUDE_DIR=${PYTHONHOME}/include/python2.7 \
      -Dgdml=ON \

The alternative versions of libpcre and liblzma (etc.) live in $PYTHONHOME/lib, but cmake is still finding the versions in /usr/lib64. What am I missing?

You need to pass only CMAKE_PREFIX_PATH, but the list is separated by semicolons, not colons.

Thanks! I finally figured that out. I kept looking at the cmake documentation and somehow reading “colon” instead of “semicolon”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.