流场可视化工程dlb-dynamicdr部署日志:阶段三: 服务器集群部署
前期工作
已经在本地端进行库的安装部署 流场可视化工程dlb-dynamicdr部署日志:阶段一: 库安装部署
已经在本地成功编译工程 流场可视化工程dlb-dynamicdr部署日志:阶段二:工程本地编译
经过前期工作准备,工程已经可以成功编译,但由于是大型并行粒子追踪程序,运行需要在集群超算上。本地没有大量存储空间容纳巨量的数据。故这个阶段我们在实验室的服务器集群上进行安装测试。
本阶段将一并对库进行安装调试以及工程编译。
库部署阶段
首先说明,实验室账号是新建的空账号,所以各种库基本都没有,这倒是一个比较好的条件,不会被环境扰乱。
首先用echo命令对环境变量进行检查如下:
$ echo $PATH
/home/tianrui.cui/include:/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin:/opt/bin:/home/tianrui.cui/bin
$ echo $LD_LIBRARY_PATH
/usr/local/lib:
2022-02-26
阶段一
首先对CMake进行安装。
最开始的想法是直接指定目录,在PATH和LD_LIBRARY_PATH中添加变量。但会有报错如下。
cmake: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
考虑是否是因为在新环境下需要重新安装,而不能仅仅是拷贝过来应用。于是进行重新安装。(我之前在Ubuntu20.04LTS下进行的安装,现在的服务器应该是CentOS系统)
重新安装在configure环节遇到报错如下:
[tianrui.cui@array build]$ ../configure --prefix=/home/tianrui.cui/dlb-lib/CMake/installed_lab_server/
---------------------------------------------
CMake 3.22.2, Copyright 2000-2021 Kitware, Inc. and Contributors Found GNU toolchain
C compiler on this system is: gcc
---------------------------------------------
Error when bootstrapping CMake: Cannot find a C++ compiler that supports both C++11 and the specified C++ flags. Please specify one using environment variable CXX. The C++ flags are "".
They can be changed using the environment variable CXXFLAGS. See cmake_bootstrap.log for compilers attempted. ---------------------------------------------
Log of errors: home/tianrui.cui/dlblib/CMake/cmake3.22.2/build/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
进行搜索后发现可能是因为gcc/g++版本太低了。
对工程部署说明进行查验后发现gcc/g++要求的版本是4.8.5及以上,而当前的版本为:4.1.2
$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
故下一个阶段应该是对GCC进行重新安装,或指定我目录下的GCC版本号,而非进行全局的重新安装。(可以有两个版本的GNU,我指定使用我安装的版本即可)
2022-02-27
GCC重新部署(阶段一)
首先安装新版本的GCC
GCC版本:11.2.0
由于之前在本地使用默认版本的gcc,故在此重新进行一遍安装总结:
$ cd GCC/
$ mkdir installed
$ tar -zxvf gcc-11.2.0.tar.gz
$ cd gcc-11.2.0
$ mkdir build
$ cd build/
$ ../configure --prefix=/home/tianrui.cui/dlb-lib/GCC/installed
报错信息如下:
configure: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify their locations.
Source code for these libraries can be found at their respective hosting sites as well as at https://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP, MPFR and/or MPC from a vendor distribution package, make sure that you have installed both the libraries and the header files.
They may be located in separate packages.
说明GCC编译依赖GMP、MPFR、MPC。接下来去安装这几个库: 参考链接:GCC安装依赖库参考链接
GMP安装
GMP版本:6.2.1
$ cd /home/tianrui.cui/dlb-lib/GCC/Dependent/GMP
$ mkdir installed
$ xz -d gmp-6.2.1.tar.xz
$ tar -xvf gmp-6.2.1.tar
$ cd gmp-6.2.1.tar
$ mkdir build
$ cd build
$ ../configure --prefix=/home/tianrui.cui/dlb-lib/GCC/Dependent/GMP/installed
$ make
$ make install
configure 阶段最终输出信息如下
config.status: executing libtool commands
configure: summary of build options:
Version: GNU MP 6.2.1
Host type: sandybridgenoavx-pc-linux-gnu
ABI: 64
Install prefix: /home/tianrui.cui/dlb-lib/GCC/Dependent/GMP/installed
Compiler: gcc -std=gnu99
Static libraries: yes
Shared libraries: yes
添加环境变量,这里我们在服务器上进行部署,仅对个人用户生效即可,即修改.bashrc即可,加入如下几行:
export GMP_ROOT=$CTR_CPP_LIB_ROOT/GCC/Dependent/GMP/installed
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$GMP_ROOT/include
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$GMP_ROOT/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GMP_ROOT/lib
MPFR安装
MPFR版本:4.1.0
$ cd /home/tianrui.cui/dlb-lib/GCC/Dependent/MPFR
$ mkdir installed
$ tar -zxvf mpfr-4.1.0.tar.gz
$ cd mpfr-4.1.0
$ mkdir build
$ cd build
$ ../configure --prefix=/home/tianrui.cui/dlb-lib/GCC/Dependent/MPFR/installed
configure阶段报错发现无法找到gmp.h,但考虑到已经在CPLUS_INCLUDE_PATH中添加了头文件路径,故考虑是否其只对C_INCLUDE_PATH进行搜索,故继续为.bashrc中添加C_INCLUDE_PATH部分。之后问题解决继续configure。
继续更新configure阶段报错如下:
......
checking for gmp.h... yes
checking for recent GMP... yes
checking usable gmp.h at link time... yes
checking for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency... yes
checking for __gmpz_init in -lgmp... no
configure: error: libgmp not found or uses a different ABI (including static vs shared).
Please read the INSTALL file -- see "In case of problem".
但是我添加了LD_LIBRARY_PATH啊,echo查看结果如下:
echo $LD_LIBRARY_PATH
/usr/local/lib:/home/tianrui.cui/dlb-lib/GCC/Dependent/GMP/installed/lib
于是考虑是否编译中只对静态链接库路径进行搜索,尝试为其添加LIBRARY_PATH,如下:
export LIBRARY_PATH=/usr/local/lib
export LIBRARY_PATH=$LIBRARY_PATH:$GMP_ROOT/lib
使用source命令让环境变量生效,继续configure。
果然,以上的修改奏效,configure阶段通过。
$ make
$ make install
成功。
更新.bashrc文件,加入如下:
export MPFR_ROOT=$CTR_CPP_LIB_ROOT/GCC/Dependent/MPFR/installed
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MPFR_ROOT/include
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$MPFR_ROOT/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MPFR_ROOT/lib
export LIBRARY_PATH=$LIBRARY_PATH:$MPFR_ROOT/lib
并使用source命令使其生效。
MPC安装
MPC版本:1.2.1
$ cd /home/tianrui.cui/dlb-lib/GCC/Dependent/MPC
$ mkdir installed
$ tar -zxvf mpc-1.2.1.tar.gz
$ cd mpc-1.2.1
$ mkdir build
$ cd build
$ ../configure --prefix=/home/tianrui.cui/dlb-lib/GCC/Dependent/MPC/installed
$ make
$ make install
成功的比较顺利。
添加环境变量如下,为.bashrc添加:
export MPC_ROOT=$CTR_CPP_LIB_ROOT/GCC/Dependent/MPC/installed
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MPC_ROOT/include
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$MPC_ROOT/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MPC_ROOT/lib
export LIBRARY_PATH=$LIBRARY_PATH:$MPC_ROOT/lib
GCC重新部署(阶段二)
安装完之前代表依赖库后,继续GCC的configure阶段:
$ cd /home/tianrui.cui/dlb-lib/GCC/gcc-11.2.0/build
$ ../configure --prefix=/home/tianrui.cui/dlb-lib/GCC/installed
输出报错信息如下:
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... yes
checking for isl 0.15 or later... no
required isl version is 0.15 or later
The following languages will be built: c,c++,fortran,lto,objc
*** This configuration is not supported in the following subdirectories:
gnattools gotools target-libada target-libhsail-rt target-libphobos target-zlib target-libgo target-libffi target-liboffloadmic (Any other directories should still work fine.)
checking for default BUILD_CONFIG... bootstrap-debug
checking for --enable-vtable-verify... no
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.
前面几行说明之前配置的依赖库GPM、MPFR、MPF都成功找到了,目前的问题是监测到系统没有32位指令集/开发库,如果不对该部分进行安装则需要使用 --disable-multilib命令符。
我们不需要32位库,于是输入如下:
$ ../configure --prefix=/home/tianrui.cui/dlb-lib/GCC/installed --disable-multilib
成功。
继续make以及make install
$ make
make阶段报错如下:
......
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
......
checking for uint8_t... no
checking for uint16_t... no
checking for uint32_t... no
checking for uint64_t... no
checking for uintmax_t... no
checking for uintptr_t... no
configure: error: uint64_t or int64_t not found
make[2]: *** [configure-stage1-gcc] Error 1
......
主要问题就是有很多基础库找不到。查看我们的基本头文件路径,发现路径为/usr/include,而我们的C_INCLUDE_PATH以及CPLUS_INCLUDE_PATH仅包含了/usr/local/include。故更新为如下:
export PATH=/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin:/opt/bin
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
export LIBRARY_PATH=/usr/local/lib:/usr/lib
export CPLUS_INCLUDE_PATH=/usr/local/include:usr/include
export C_INCLUDE_PATH=/usr/local/include:usr/include
source生效后继续make
但还是报错。
怀疑是没有清除上一次的cache,于是删除build文件夹后重新跑了一遍configure,但还是报错。搜索了一下这个错误原因,发现大多是指向没有安装g++导致的,于是跑去安装g++。
G++安装
我参考了这篇blog发现也提到了,GCC的安装除了之前的几个依赖之外,确实需要G++的依赖支持。 GCC的安装依赖G++
我们选择的版本为:
在这里插入代码片
我查询了一些文档,发现g++在之后不会单独发行,已经变成了GCC不可或缺的一部分被融合进了之后的GCC版本包。
注意这里的说明
晚上回去看看,先去陪舍友过生日了!!
|