install_QnTools-cxx11.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/bash
  2. #---Option: if set, script stops (with logout) when encounters errors
  3. #set -e
  4. export MPDROOT_CONFIG=/scratch2/parfenov/Soft/MPDROOT/mpdroot_kfparticles/build/config.sh
  5. NPROC=`nproc`
  6. echo "Number of available CPUs: $NPROC"
  7. export STARTING_PWD=$PWD
  8. export INSTALLATION_PATH=$PWD/testQn
  9. mkdir -p $INSTALLATION_PATH
  10. #---Save original environmant
  11. export PATH_Qn_original=$PATH
  12. export LD_LIBRARY_PATH_Qn_original=$LD_LIBRARY_PATH
  13. export BOOST_ROOT_Qn_original=$BOOST_ROOT
  14. export CC_Qn_original=$CC
  15. export CXX_Qn_original=$CXX
  16. #---Install root 6.20 with cxx-11
  17. if [ ! -d "${INSTALLATION_PATH}/root/build-cxx11" ]
  18. then
  19. echo "Installing root ver. 6.20 with c++11 standard ..."
  20. cd $INSTALLATION_PATH
  21. mkdir root/
  22. cd root/
  23. git clone https://github.com/root-project/root.git src/
  24. cd src/
  25. git checkout v6-20-00-patches
  26. cd ../
  27. mkdir build-cxx11 install-cxx11
  28. cd build-cxx11/
  29. source $MPDROOT_CONFIG
  30. # export CC=${INSTALLATION_PATH}/gcc-8.5.0/bin/gcc
  31. # export CXX=${INSTALLATION_PATH}/gcc-8.5.0/bin/g++
  32. # export LD_LIBRARY_PATH=${INSTALLATION_PATH}/gcc-8.5.0/lib64:$LD_LIBRARY_PATH
  33. cmake -Dbuiltin_gsl=ON -Dmathmore=ON -Dbuiltin_xrootd=ON -Dbuiltin_glew=ON -Dbuiltin_afterimage=ON -Dbuiltin_vdt=ON -DCMAKE_INSTALL_PREFIX=${INSTALLATION_PATH}/root/install-cxx11/ -DCMAKE_CXX_STANDARD=11 ../src/
  34. make -j${NPROC} install
  35. else
  36. echo "Directory root/build-cxx11 already exists in the installation path. Skipping this step."
  37. fi
  38. #---Install AnalysisTree core part (with c++11 standard)
  39. if [ ! -d "${INSTALLATION_PATH}/AnalysisTree/build-cxx11" ]
  40. then
  41. echo "Installing AnalysisTree with c++11 standard ..."
  42. cd $INSTALLATION_PATH
  43. git clone https://github.com/HeavyIonAnalysis/AnalysisTree.git
  44. cd AnalysisTree/
  45. git checkout release-1.0
  46. mkdir build-cxx11 install-cxx11
  47. cd build-cxx11/
  48. export CC=$CC_Qn_original
  49. export CXX=$CXX_Qn_original
  50. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_Qn_original
  51. source $MPDROOT_CONFIG
  52. # source ${INSTALLATION_PATH}/root/build-cxx11/bin/thisroot.sh
  53. cmake -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX=${INSTALLATION_PATH}/AnalysisTree/install-cxx11/ ../
  54. make -j${NPROC} install
  55. export AnalysisTreeBase_LIBRARY_DIR=${INSTALLATION_PATH}/AnalysisTree/install-cxx11/lib
  56. export AnalysisTree_INCLUDE_DIR=${INSTALLATION_PATH}/AnalysisTree/install-cxx11/include
  57. else
  58. echo "Directory AnalysisTree/build-cxx11 already exists in the installation path. Skipping this step."
  59. export AnalysisTreeBase_LIBRARY_DIR=${INSTALLATION_PATH}/AnalysisTree/install-cxx11/lib
  60. export AnalysisTree_INCLUDE_DIR=${INSTALLATION_PATH}/AnalysisTree/install-cxx11/include
  61. fi
  62. cd $STARTING_PWD