u盘电脑cp系统安装步骤-()

192.168.1.1 次浏览手机阅读
()

本次部署CP2K全离线安装(集群安装不能自动下载工具链,太坑爹了。。我暂时没有时间调查原因。pass了)。注意,安装CP2K-2022.2需要GCC 88以上的支持下,老系统的小伙伴需要安装新版本gcc。


软件包下载地址涉及安装过程:

链接:https://pan.baidu.com/s/1fj9i-Wu1PVHAy8dCmQvJqA?pwd=1rjy

提取码:1rjy


参考博文:

1. GCC一键安装/升级脚本参考(白嫖)学术朋友微信官方账号Tamas共享的脚本。

2. CP2K参考安装过程(复制)《CP2K第一原理程序在CentOS简易安装方法:http://sobereva.com/586


一、安装GCC 9.3 (不需要的学生直接忽略了这部分的安装)

(1) 进入CP2K-2022.2/gcc_install目录,直接运行install_online_gcc_9.3.0.sh,这里安装gcc所需的四个工具包已经在同一目录下,不需要在网上下载。

./install_online_gcc_9.3.0.sh

这个脚本很傻,整个过程不需要人为干涉。你只需要设置它gcc在这里,我把它放在安装位置gcc安装在/home/yjy/softwares/gcc9/目录下。


(2) 最后要记住的是如何激活gcc,那就是

source ~/softwares/gcc9/env.sh

这里附上install_online_gcc_9.3.0.sh内部代码供您参考:

#!/bin/bash#来自学术之友微信官方账号的#Tamas,我把7.1.0改成了9.3.0wget https://www.mpfr.org/mpfr-current/mpfr-4.1.0.tar.gzwget http://mirrors.nju.edu.cn/gnu/mpc/mpc-1.2.0.tar.gzwget http://mirrors.nju.edu.cn/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.gzwget https://ftp.gnu.org/pub/gnu/gmp/gmp-6.2.0.tar.bz2if[[ -f \\"mpfr-4.1.0.tar.gz\\" ]]&&[[ -f \\"mpc-1.2.0.tar.gz\\" ]]&&[[ -f \\"gcc-9.3.0.tar.gz\\" ]]&&[[ -f \\"gmp-6.2.0.tar.bz2\\" ]];thentrueelseecho \\"One of mpfr-4.1.0.tar.gz,mpc-1.2.0.tar.gz,gmp-6.2.0.tar.bz2,gcc-9.3.0.tar.gz is missing.\\"exit 1fi
gcc1=`gcc -dumpversion | awk '{split($0,a,\\".\\"); print a[1]}'`
if[ $gcc1 -gt 9 ];thenecho \\"GCC version is higher than 9, no need to install gcc-9\\"exit 1firead -p \\"Input installation directory for 9.3.0--->\\" gcc9dir# gcc9dir=/home/yjy/softwares/gcc9/if[ ! -n \\"$gcc9dir\\" ]; thenecho \\"Wrong: not a valid directory\\";exit 1fimkdir -p $gcc9dirif[ ! -d \\"$gcc9dir\\" ]; thenecho \\"Wrong: no permission or not a valid directory.\\"exit 1fi
read -p \\"To use 9.3.0 after installation: source $gcc9dir/env.sh hit ENTER to continue!\\" ok
function install_needed(){echo \\"installing gmp ...\\"tar -jxvf gmp-6.2.0.tar.bz2cd gmp-6.2.0
CC=gcc CXX=g ./configure --prefix=$gcc9dir/gmp-6.2.0makemake installexport GMP_HOME=$gcc9dir/gmp-6.2.0export PATH=$GMP_HOME/bin:$PATHexport LD_LIBRARY_PATH=$GMP_HOME/lib:$LD_LIBRARY_PATHexport INCLUDE=$GMP_HOME/include:$INCLUDE
cd ../rm -rf gmp-6.2.0
echo \\"installing mpfr ...\\"tar -zxvf 电脑 mpfr-4.1.0.tar.gzcd mpfr-4.1.0CC=gcc CXX=g ./configure --prefix=$gcc9dir/mpfr-4.1.0 --with-gmp=$GMP_HOMEmakemake install
export MPFR_HOME=$gcc9dir/mpfr-4.1.0export PATH=$MPFR_HOME/bin:$PATHexport LD_LIBRARY_PATH=$MPFR_HOME/lib:$LD_LIBRARY_PATHexport INCLUDE=$MPFR_HOME/include:$INCLUDE
cd ../rm -rf mpfr-4.1.0
echo \\"installing mpc ...\\"tar -zxvf mpc-1.2.0.tar.gzcd mpc-1.2.0CC=gcc CXX=g ./configure --prefix=$gcc9dir/mpc-1.2.0 --with-gmp=$GMP_HOME --with-mpfr=$MPFR_HOMEmakemake install
export MPC_HOME=$gcc9dir/mpc-1.2.0export PATH=电脑$MPC_HOME/bin:$PATHexport LD_LIBRARY_PATH=$MPC_HOME/lib:$LD_LIBRARY_PATHexport INCLUDE=$MPC_HOME/include:$INCLUDE
cd ../rm -rf mpc-1.2.0}
install_needed
#to prevent LIBRARY_PATH containing the current directoryunset LIBRARY_PATHecho \\"installing gcc-9 ...\\"tar -zxvf gcc-9.3.0.tar.gzcd gcc-9.3.0CC=gcc CXX=g ./configure --prefix=$gcc9dir/gcc-9.3.0 --with-gmp=$GMP_HOME --with-mpfr=$MPFR_HOME --with-mpc=$MPC_HOME --disable-multilib --enable-languages=c,c ,fortran
makemake installexport GCC_HOME=$gcc9dir/gcc-9.3.0export PATH=$GCC_HOME/bin:$PATHexport 电脑 LD_LIBRARY_PATH=$GCC_HOME/lib:$GCC_HOME/lib64:$LD_LIBRARY_PATHexport INCLUDE=$GCC_HOME/include:$INCLUDEcd ../rm -rf gcc-9.3.0
echo \\"export GMP_HOME=$gcc9dir/gmp-6.2.0\\" >> $gcc9dir/env.shecho 'export PATH=$GMP_HOME/bin:$PATH' >> $gcc9dir/env.shecho 'export LD_LIBRARY_PATH=$GMP_HOME/lib:$LD_LIBRARY_PATH' >> $gcc9dir/env.shecho 'export INCLUDE=$GMP_HOME/include:$INCLUDE' >> $gcc9dir/env.shecho \\"export MPFR_HOME=$gcc9dir/mpfr-4.1.0\\" >> $gcc9dir/env.shecho 'export PATH=$MPFR_HOME/bin:$PATH' >> $gcc9dir/env.shecho 'export LD_LIBRARY_PATH=$MPFR_HOME/lib:$LD_LIBRARY_PATH' >> $gcc9dir/env.shecho 'export INCLUDE=$MPFR_HOME/include:$INCLUDE' >> $gcc9dir/env.shecho \\"export MPC_HOME=$gcc9dir/mpc-1.2.0\\" >> $gcc9dir/env.shecho 'export PATH=$MPC_HOME/bin:$PATH' >> $gcc9dir/env.shecho 'export LD_LIBRARY_PATH=$MPC_HOME/li b:











电脑
喜欢 ()