|
因为课题组申请了CASTEP的学术版,所以我折腾了一下安装在自己的个人电脑上面。因为是AMD-zen3的cpu所以用起Intel的mkl感觉不是很方便,就琢磨了一下用openblas的数学库。同时,因为系统是Fedora34自带的gcc-11.3.1版本太高了,编译过程中很多错误,所以采用conda环境安装gcc9,然后试了下只有castep_19.11可以成功编译,其他高版本的不行。现在分享一下我的编译步骤。
note:1)先安装gcc,然后是openmpi,2)如果编译fftw的过程中报错找不到xxx-xxx-gcc什么的,可以在~/anaconda3/envs/xxcastepxx/bin下面用ln -s软连接建立缺失的文件xxx-xxx-gcc. 3)最后我编译完的castep,用mpirun -np 20/30都不好使,会中间突然暂停,找到的原因是可能没有正确编译出并行版本,因为我不管mpirun多少个核,都是全核(32核)计算。所以用不用mpirun命令都可以。
CPU: AMD-7532(zen3); Operation System: Fedora34
compilation env: gcc-9.5.0, make-4.2.1, fftw-3.3.6, openblas-0.3.12, Castep-19.11
1) install anaconda3 (e.g., Anaconda3-2022.05-Linux-x86_64.sh)
2) create an environment in anaconda3: "conda create -n xxnamexx(e.g., castep) python=3" (install python3 as well)
3) add channel (conda-forge): "conda config --add channels conda-forge"
4) install gcc and g++: "conda install -c conda-forge cxx-compiler=1.3.0", then the gcc-9.5.0 and g++-9.5.0 are installed, run "conda list" to have a check.
5) install gfortran: "conda install -c conda-forge fortran-compiler", then we have gfortran-9.5.0, use "gfortran --version" to check if gfortran was installed successfully.
6) install make: "conda install -c conda-forge make=4.2.1", the you have make-4.2.1, use "make --version" to have a check.
7) install openmpi: "conda install -c conda-forge openmpi=4.0.2", use the "mpirun --version" to check if mpirun was installed successfully.
8) donwload (fftw-3.3.6-pl2.tar.gz), "./configure CC=gcc F77=gfortran MPICC=mpicc --prefix=/where/is/your/lib/path --enable-mpi", then "make && make install", then you can find libs in /where/is/your/lib/path
9) donwload (OpenBLAS-0.3.12.tar.gz, https://github.com/xianyi/OpenBLAS/releases?page=1), "make -j2", then "make PREFIX=/where/is/your/lib/path install", the you can find libs in /where/is/your/lib/path
10) download (CASTEP-19.11.tar.gz) if you have a license. "cd CASTEP-19.11", then "make MATHLIBS=openblas FFT=fftw3 COMMS_ARCH=mpi SUBARCH=mpi", meanwhile you need to specify the path where is the libs of openblas and fftw3, then it will automatically compile everything. After that, run "make MATHLIBS=openblas FFT=fftw3 COMMS_ARCH=mpi SUBARCH=mpi install install-tools" to install everything and you can find a path "bin/linux_xxxx--mpi" where every executable file was stored. Finally, run "make MATHLIBS=openblas FFT=fftw3 COMMS_ARCH=mpi SUBARCH=mpi check" to run an automatical default check by castep. If no error reported, you got an excellent castep.
references: https://blog.csdn.net/weixin_39943000/article/details/112374817, https://sulis-hpc.github.io/appnotes/castep.html#compilation, http://hmli.ustc.edu.cn/doc/app/wien2k17u1.htm
|
评分 Rate
-
查看全部评分 View all ratings
|