之前尝试在CentOS7上部署ROOT集群,却发现无论是源码包安装,还是官方提供的二进制包,都缺少了关键的xproofd可执行文件,导致PoD不能运行。没有办法,只能尝试在其他OS上部署,这里我选择了Ubuntu 14.04。
部署准备 修改apt源修改/etc/apt/sources.list,换成国内的163源,下载会更快和稳定一些。
# vim /etc/apt/sources.list deb trusty main restricted universe multiverse deb trusty-security main restricted universe multiverse deb trusty-updates main restricted universe multiverse deb trusty-proposed main restricted universe multiverse deb trusty-backports main restricted universe multiverse deb-src trusty main restricted universe multiverse deb-src trusty-security main restricted universe multiverse deb-src trusty-updates main restricted universe multiverse deb-src trusty-proposed main restricted universe multiverse deb-src trusty-backports main restricted universe multiverse再调用apt-get update更新index。
安装gcc,g++如果系统已经安装gcc和g++,可跳过此步骤。
# apt-get install gcc # apt-get install g++ 安装cmake直接通过apt-get安装的cmake在安装ROOT组件时会出现问题,所以这里建议源码安装,我这里使用的是2.8.8版本。官网下载地址:https://cmake.org/files/,可选择自己适合的版本。
- 解压:tar xvf cmake-2.8.8.tar.gz - 进入解压目录:cd cmake-2.8.8 - ./bootstrap - make - make install 安装zlib库 github上(https://github.com/madler/zlib)可下载对应的zlib库,我使用的是1.2.3版本,下载地址为:https://github.com/madler/zlib/archive/v1.2.3.zip
- 解压:unzip zlib-1.2.3.zip
- 进入解压目录:cd zlib-1.2.3
- ./configure
注意:在make之前,需要修改Makefile,否则调用库时会出现错误。找到 CFLAGS=-O3 -DUSE_MMAP这一行,在后面加入-fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC
- make
- make install
apt-get install procmail
部署ROOT集群 安装ROOTbinary安装:https://root.cern.ch/content/release-60606 。选择对应的OS系统编译包。解压并将其移动至/opt目录下:
# tar zxvf root_v6.06.06.Linux-ubuntu14-x86_64-gcc4.8.tar.gz # mv root /opt再将ROOT相关配置写入初始化文件,这里在/etc/profile.d/root.sh末尾加入以下语句:
export ROOTSYS=/opt/root export PATH=$PATH:$ROOTSYS/bin source $ROOTSYS/bin/thisroot.shsource /etc/profile.d/root.sh让配置生效。运行命令root -b测试root是否能正常运行:
#root -b root: error while loading shared libraries: libXpm.so.4: cannot open shared object file: No such file or directory缺少libXpm库,运行apt-get install libxpm4命令安装。安装时有可能会提示缺少安装包,这和本地的源index有关系,需要先向远端源同步后(运行apt-get update命令),再安装xpm包。安装成功。
# apt-get install libxpm4 Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: libxpm4 0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Need to get 37.0 kB of archives. ……再次运行root -b命令来测试,再次报错。
# root -b ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths! Invoking: echo | LC_ALL=C c++ -pipe -m64 -Wall -W -Woverloaded-virtual -fsigned-char -fPIC -pthread -std=c++11 -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-missing-field-initializers -fPIC -fvisibility-inlines-hidden -std=c++11 -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-unused-local-typedefs -O2 -DNDEBUG -xc++ -E -v - 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | grep -E "(c|g)\+\+" results in results in with exit code 256 input_line_1:1:10: fatal error: 'new' file not found #include <new>