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/libpcre.so, /usr/lib64/libpcreposix.so, and /usr/lib64/liblzma.so, 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 PYTHONPATH="$PYTHONPATH:$PYTHONHOME/lib:$ROOTSYS/lib"

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_INCLUDE_PATH=${BOOST_ROOT}/include \
      -DCMAKE_LIBRARY_PATH=${LIBRARY_PATH} \
      -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 \
      -DPYTHON_LIBRARY=$PYTHONHOME/lib/libpython2.7.so \
      -Dgdml=ON \
      ../root-6.16.00

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.