官网:https://root.cern/
官网步骤:
# The latest stable branch gets updated automatically on each release.
# You may update your local copy by issuing a `git pull` command from within `root_src/`.
$ git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git root_src
$ mkdir root_build root_install && cd root_build
$ cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src # && check cmake configuration output for warnings or errors
$ cmake --build . -- install -j4 # if you have 4 cores available for compilation
$ source ../root_install/bin/thisroot.sh # or thisroot.{fish,csh}
1.环境要求
g++ gcc cmake python ubuntu 都需要高版本,ubuntu18的默认版本都不满足;
2.cmake -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src报错: Could NOT find X11
sudo apt install libx11-dev
其他错误类似;大概包含以下
sudo apt install libx11-dev libxpm-dev libxft-dev libxext-dev
安装完成之后重复执行:cmake -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src
3.cmake --build . – install -j4 错误记录
错误1:
CMake Error at /home/ubuntu/work/install/rootSrc/root_build/TBB-prefix/src/TBB-stamp/TBB-build-Release.cmake:37 (message):
Command failed: 2
'/usr/bin/make'
See also
/home/ubuntu/work/install/rootSrc/root_build/TBB-prefix/src/TBB-stamp/TBB-build-*.log
TBB-build-err.log内容
/tmp/ccUocy3t.s: Assembler messages:
/tmp/ccUocy3t.s:29207: Error: no such instruction: `tpause %ecx'
/tmp/ccUocy3t.s:30971: Error: no such instruction: `tpause %ecx'
make[5]: *** [src/tbb/CMakeFiles/tbb.dir/arena.cpp.o] Error 1
make[4]: *** [src/tbb/CMakeFiles/tbb.dir/all] Error 2
make[3]: *** [all] Error 2
原因:tpause %ecx supported by binutils >= 2.31.1
#查看binutils当前版本号
ld -v
#ubuntu18.04更新binutils-2.32
#下载
wget https://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.gz
#安装
tar -xzf binutils-2.32.tar.gz
cd binutils-2.32
./configure
make
sudo make install
sudo reboot
#确认是否成功
ld -v
错误2:
See also
/home/ubuntu/work/install/rootSrc/root_build/builtins/xrootd/XROOTD-prefix/src/XROOTD-stamp/XROOTD-configure-*.log
日志内容
Could NOT find libuuid (missing: UUID_INCLUDE_DIR)
解决办法:
sudo apt-get install uuid-dev
错误3:暂时未解决
See also
/home/ubuntu/work/install/rootSrc/root_build/builtins/xrootd/XROOTD-prefix/src/XROOTD-stamp/XROOTD-build-*.log
日志内容
/usr/local/bin/ld: XrdCl/libXrdCl.so.3.0.0: undefined reference to `uuid_unparse'
/usr/local/bin/ld: XrdCl/libXrdCl.so.3.0.0: undefined reference to `uuid_generate'