将编译器写到env后source env
export CC=mpiicc
export CXX=mpiicpc
export FC=mpiifort
export F90=mpiifort
export F77=mpiifort
export MPIF90=mpiifort
export MPIF77=mpiifort
export MPICC=mpiicc
export MPICXX=mpiicpc
安装完每个包后添加到环境变量:
export PATH=xxx/bin:$PATH
export LD_LIBRARY_PATH=xxx/lib:$LD_LIBRARY_PATH
简单,不再赘述
https://github.com/HDFGroup/hdf5/releases
这里使用hdf5-1.8.10-patch1
解压后:
$ ./configure --prefix=$PREFIX --enable-fortran --enable-parallel --with-zlib=$ZLIBPATH --with-szlib=$SZIPPATH \
CFLAGS=-O2 -fPIC FCFLAGS=-O2 -fPIC CXXFLAGS=-O2 -fPIC \
CPPFLAGS= -I$ZLIBPATH/include -I$SZIPPATH/include LDFLAGS= -L$ZLIBPATH/lib -L$SZIPPATH/lib LIBS= -lz -lsz
$ make; make install; make check; make distclean
https://github.com/Unidata/netcdf-c
这里使用netcdf-c-4.3.2
解压后:
$ ./configure --prefix=$PREFIX --enable-netcdf4 --enable-extra-example-tests --enable-parallel-tests \
--enable-logging --enable-extra-tests --enable-large-file-tests \
LDFLAGS=-L$HDFPATH/lib -L$SZIPPATH/lib/ -L$ZLIBPATH/lib/ \
LIBS=-lhdf5 -lhdf5_hl -lhdf5hl_fortran -lhdf5_fortran -lz -lsz -lcurl \
CPPFLAGS=-I$HDFPATH/include -I$SZIPPATH/include -I$ZLIBPATH/include
$ make; make install; make check; make distclean
添加到$PATH后使用nc-config --all
检查
https://github.com/Unidata/netcdf-fortran
这里使用netcdf-fortran-4.4.1
解压后:
$ ./configure --prefix=$PREFIX LDFLAGS=-L$HDFPATH/lib -L$SZIPPATH/lib/ -L$ZLIBPATH/lib/ -L$NETCDFPATH/lib \
LIBS=-lhdf5 -lhdf5_hl -lhdf5hl_fortran -lhdf5_fortran -lz -lsz -lcurl -lnetcdf\
CPPFLAGS=-I$HDFPATH/include -I$SZIPPATH/include -I$ZLIBPATH/include -I$NETCDFPATH/include
$ make; make install; make check; make distclean
添加到$PATH后使用nf-config --all
检查
https://parallel-netcdf.github.io/wiki/Download.html
这里使用parallel-netcdf-1.8.1
解压后:
$ ./configure --prefix=$PREFIX --enable-netcdf4 --enable-extra-example-tests --enable-parallel-tests \
--enable-logging --enable-extra-tests --enable-large-file-tests \
LDFLAGS=-L$HDFPATH/lib -L$SZIPPATH/lib/ -L$ZLIBPATH/lib/ -L$NETCDFPATH/lib \
LIBS=-lhdf5 -lhdf5_hl -lhdf5hl_fortran -lhdf5_fortran -lz -lsz -lcurl -lnetcdf -lnetcdff\
CPPFLAGS=-I$HDFPATH/include -I$SZIPPATH/include -I$ZLIBPATH/include -I$NETCDFPATH/include
$ make; make install; make check; make distclean
添加到$PATH后使用pnetcdf-config --all
检查