After successfully building ROOT 6 from source using a script that does effectively the following:
cd
git clone http://root.cern.ch/git/root.git root_src
mkdir root_build
cd root_build
unset ROOTSYS
cmake -Dall="ON" -Dsoversion="ON" -Dqtgsi="OFF" ../root_src >> cmake.out.txt 2>&1
cmake --build . -- -j4 >> cmake.out.txt 2>&1
I am then trying to use the CMake commands outlined on the “Building ROOT” page to install it in /usr/local/root/
However, when I do
cd /usr/local/
mkdir root
cd ~/root_build/
sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local/root/
I get
CMake Error: The source directory "/home/mcf/root_build" does not appear to contain CMakeLists.txt.
and the only CMakeLists.txt in the build dir is in the tutorials sub dir, which shouldn’t be it.
If I do
sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local/root -P cmake_install.cmake
then everything gets to /usr/local/root/ just fine
$ cd /usr/local/root/
$ ls -d */
aclocal// config// fonts// include// man// tmva//
bin// emacs// geom// lib// README// tutorials//
cmake// etc// icons// macros// test//
and I can do
but if I try and run a script with RooStats code in it I get things like
cling::DynamicLibraryManager::loadLibrary(): libpng16.so.16: cannot open shared object file: No such file or directory
and a seg fault. Yet if I source root from the build directory
source ~/root_build/bin/thisroot.sh
and try to run the RooStats script everything works fine so I have obviously done something wrong in the installation.
I realize that this is probably something very trivial and that in the past [url=https://root-forum.cern.ch/t/locate-like-command/65/1 and Axel have offered some comments[/url] about installation using CMake, however I haven’t really understood. I am finding proper installation using CMake style commands confusing (though I admittedly need to go RTFM on CMake), and any pointers here could be useful.