点赞发Nature
关注中Science
GCAM模型太大,在PC上没法正常跑,需要到超算中心上计算,超算是Linux系统,需要把GCAM 再编译成Linux版本才能跑。我花了一个星期,终于把他搞通了,下面是我整个步骤,可能遇到的报错也都贴在这里了,希望对大家有帮助。有问题可以下方评论留言,我看看能不能帮忙解决
Linux compiling GCAM
http://jgcri.github.io/gcam-doc/gcam-build.html#43-building-with-visual-studio Tutorial GCAM
Compile: to make a window executable a Linux executable
-
Boost installation requires at least
C++ 14
compiler. So we must first upgrade compiler in Linux-
Get
gcc
usingwget https://ftp.gnu.org/gnu/gcc/gcc-6.2.0/gcc-6.2.0.tar.bz2
-
unzip with
tar xf gcc-6.2.0.tar.bz2
-
Error:
Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Build
GMP 4.2+
-
wget https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2)
-
tar xf gmp-6.0.0a.tar.bz2
-
./gmp-6.0.0/configure --prefix=${HOME}/YangFan/gmp
set installation folder -
make && make check && make install
Build
MPFR 2.4.0+
wget https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.bz2
-
tar xf mpfr-4.0.2.tar.bz2
-
configure --prefix=${HOME}/YangFan/mpfr
Fail:
GMP 5.0.0 or newer is required
-
Set
GMP
Environmental VariableGMP_DIR="${HOME}/YangFan/gmp" export LD_LIBRARY_PATH=${GMP_DIR}/lib:$LD_LIBRARY_PATH export LIBRARY_PATH=${GMP_DIR}/lib:$LIBRARY_PATH export CPATH=${GMP_DIR}/include:$CPATH
-
`
-
Install
GMP
cd gmp-6.0.0 make make install make check
-
Install
mpfr
cd mpfr-4.0.2 configure --prefix=${ HOME}/YangFan/mpfr --with-gmp=$HOME/YangFan/gmp make && make check && make install export MPFR_DIR="${ HOME}/YangFan/mpfr" export LD_LIBRARY_PATH=${MPFR_DIR}/lib:$LD_LIBRARY_PATH export LIBRARY_PATH=${MPFR_DIR}/lib:$LIBRARY_PATH export CPATH=${MPFR_DIR}/include:$CPATH
Build
MPC
-
Download
wget https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
-
install
tar xf mpc-1.1.0.tar.gz configure --prefix=${ HOME}/YangFan/mpc
configure: error: libmpfr not found or uses a different ABI (including static vs shared).
configure --prefix
-
-