hdf5安裝_Siesta 安裝教程 【4.1b4】
技術標籤:hdf5安裝lapack安裝linux安裝fortranopenmpi安裝
最新的Siesta版本為: 4.1-b4
提前告知: 本教程與本平臺提供的其它教程一樣,統一將軟體安裝到Linux使用者家目錄的softwares
路徑下。如您希望安裝到其它地方,簡單修改一下編譯配置時的引數即可。
同時本教程,假設你已經將zlib、hdf5、netcdf-c、netcdf-fortran安裝到了家目錄下的softwares
中對應的zlib_install
、hdf5_install
、netcdf_install
路徑下。如果你安裝這些庫是在其它路徑,請對應修改下文arch.make中的引數。
從Siesta官網下載最新版本的Siesta原始碼: https://departments.icmab.es/leem/siesta/。或者使用命令列下載工具curl或者wget來下載:
wget -c -O ${HOME}/softwares/siesta-4.1-b4.tar.gz https://launchpad.net/siesta/4.1/4.1-b4/+download/siesta-4.1-b4.tar.gz
進入程式碼根目錄,下的Obj資料夾:
cd siesta-4.1-b4/Obj
然後執行以下命令:
bash ../Src/obj_setup.sh
這將在執行Siesta的一個指令碼來在當前路徑下產生構建配置檔案,此時需要修改arch.make檔案中的一些引數。
需要修改指定的變數如下:
.SUFFIXES:.SUFFIXES: .f .F .o .c .a .f90 .F90SIESTA_ARCH =x86_64-unknown-linux-gnu--unknownCC = gccFPP = $(FC) -E -P -x cFC = mpif90 #gfortran# FC_SERIAL = gfortranFFLAGS = -O2 -fPIC -ftree-vectorize# FFLAGS=-gAR = arRANLIB = ranlibSYS = nagSP_KIND = 4DP_KIND = 8KINDS = $(SP_KIND) $(DP_KIND)LDFLAGS =COMP_LIBS = libsiestaLAPACK.a libsiestaBLAS.aFPPFLAGS = $(DEFS_PREFIX)-DFC_HAVE_ABORT# Dependency rules ---------FFLAGS_DEBUG = -g -O1 # your appropriate flags here...# added by EmuLab# For GNU compiler# the siesta guide tell me to add the FFLAGS and LIBS parameter below, but it get thing wrong,# after comment them i succeeded in the compilation!# FFLAGS += -fopenmp# LIBS += -fopenmp# OpenBLAS + LAPACK:# OpenBLAS (OpenBLAS will default to build in LAPACK 3.6)# LIBS += -L/opt/openblas/0.2.18/lib -lopenblas# use the LAPACK and BLAS provided by SIESTA# ScaLAPACK# ScaLAPACK Only required for MPI compilation.# LIBS += -L/opt/scalapack/2.0.2/lib -lscalapack# NETCDF added by deqitangINCFLAGS += -I${HOME}/softwares/netcdf_install/includeLDFLAGS += -L${HOME}/softwares/zlib_install/lib -Wl,-rpath=${HOME}/softwares/zlib_install/libLDFLAGS += -L${HOME}/softwares/hdf5_install/lib -Wl,-rpath=${HOME}/softwares/hdf5_install/libLDFLAGS += -L${HOME}/softwares/netcdf_install/lib -Wl,-rpath=${HOME}/softwares/netcdf_install/libLIBS += -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lzCOMP_LIBS += libncdf.a libfdict.aFPPFLAGS += -DCDF -DNCDF -DNCDF_4#DUMMY_FOX = --enable-dummy# For netCDF support. Make sure you get a version compatible# with the other options (for example, 32/64 bit). Don't forget# to set -DCDF below.NETCDF_ROOT = ${HOME}/softwares/netcdf_installNETCDF_LIBS = -L$(NETCDF_ROOT)/lib -lnetcdffNETCDF_INCFLAGS = -I$(NETCDF_ROOT)/include# HDF-5.HDF5_ROOT = ${HOME}/softwares/hdf5_installHDF5_LIBS = -L$(HDF5_ROOT)/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5HDF5_INCFLAGS = -I$(HDF5_ROOT)/include# endCOMP_LIBS += libfdict.aLIBS = $(COMP_LIBS) $(NETCDF_LIBS)#SIESTA needs an F90 interface to MPI#This will give you SIESTA's own implementation#If your compiler vendor offers an alternative, you may change#to it here.# MPI_INTERFACE=libmpi_f90.a#MPI_INCLUDE=${HOME}/softwares/openmpi_install/include# end by [email protected]# The atom.f code is very vulnerable. Particularly the Intel compiler# will make an erroneous compilation of atom.f with high optimization# levels.atom.o: atom.F $(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<.c.o: $(CC) -c $(CFLAGS) $(INCFLAGS) $(CPPFLAGS) $<.F.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<.F90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $<.f.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f) $<.f90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $<
然後執行make構建siesta:
make siesta
構建完siesta後,如果你需要構建transiesta,需執行:
make cleanmake transiesta
還有一個常用的工具是tbtrans,其位於SIesta專案的./Util/TS/TBtrans目錄下,通過下面命令來構建:
cd ../Util/TS/TBtransmake
注意Siesta的構建系統 沒有提供make install。因此我們可以將編譯的到的可執行程式移動到一個目錄,然後將該路徑新增到環境變數中,方便在終端中呼叫程式。
就此,常用的工具構建完畢。
在~/.bashrc檔案中新增如下內容:
export PATH=\$PATH:/home/xxx/softwares/siesta_bin
這裡假設,我們將之前編譯得到的siesta、transiesta、tbtrans程式都拷貝到了/home/xxx/softwares/siesta_bin
中。
更多關於Siesta的構建資訊,請參見Siesta官方網站及其官方手冊。
https://departments.icmab.es/leem/siesta/