下载 http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.2.tar.bz2
$tar xjvf openmpi-1.4.2.tar.bz2
$cd openmpi-1.4.2
$./configure --prefix=/opt/openmpi CC=icc F77=ifort FC=ifort CXX=icpc
$make
$make install
$vi ~/.bashrc
#--- for openmpi
MPI=/opt/openmpi
export MPI
PATH=$PATH:$MPI/bin
export PATH
MPI_LIB=$MPI/lib
MPI_INCLUDE=$MPI/include
export MPI_LIB
export MPI_INCLUDE
重新登录或者source ~/.bashrc
$./configure -prefix=/opt/mathlibs/fftw/3.2.2
$make
$make install
$make clean
$./configure -prefix=/opt/mathlibs/fftw/3.2.2 -enable-shared
$make
$make install
$make clean
$./configure -prefix=/opt/mathlibs/fftw/3.2.2 -enable-float
$make
$make install
$make clean
$./configure -prefix=/opt/mathlibs/fftw/3.2.2 -enable-float -enable-shared
$make
$make install
$cp makefile.linux_ifc_P4 Makefile
$vi Makefile
修改下面的内容
将FC=ifc修改为FC=ifort
增加CC=icc
$make
完成后即可获得libdmy.a文件
$cd /opt/intel/mkl/10.2.2.025/interfaces/fftw3xf
$make libem64t compiler=intel
$cp libfftw3xf_intel.a ../../lib/em64t
串行部分
增加下面2行
MKLINCLUDE=/opt/intel/mkl/10.2.2.25/include/
MKLPATH=/opt/intel/mkl/10.2.2.25/lib/em64t/
将BLAS行和LAPACK行注释,并添加BLASLAPACK
BLASLAPACK=-L/opt/intel/mkl/10.2.2.25/lib/em64t/ -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread
fftw采用自带的库或者fftw3.2.2库
FFT3D = fft3dfurth.o fft3dlib.o
或者
FFT3D = fftw3d.o fft3dlib.o /opt/mathlibs/fftw/3.2.2/lib/libfftw3.a
并行部分
取消注释下面部分
FC=mpif90
FCL=$(FC)
BLACS和SCA库
BLACS=-L/opt/intel/mkl/10.2.2.025/lib/em64t/ -wl,--start-group $(MKLPATH)/libmkl_blacs_openmpi_lp64.a --end-group -liomp5 -lpthread
SCA=-L/opt/intel/mkl/10.2.2.025/lib/em64t -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lmkl_scalapack_lp64 -lmkl_lapack -liomp5 -lpthread
取消注释下面部分
CPP = $(CPP_) -DMPI -DHOST=/"LinuxIFC/" -DIFC /
-Dkind8 -DNGZhalf -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc /
-DMPI_BLOCK=500 /
-DRPROMU_DGEMV -DRACCMU_DGEMV
fftw采用fftw3.2.2库或者用MKL自带的库
FFT3D = fftmpi.o fftmpi_map.o fft3dlib.o /opt/mathlibs/fftw/3.2.2/lib/libfftw3.a
或者
FFT3D= fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o /opt/intel/mkl/10.2.2.025/lib/em64t/libfftw3xf_intel.a
拷贝fftw3.f到当前目录
$cp /opt/mathlibs/fftw/3.2.2/include/fftw3.f .
$make
如果没有出现error则会在当前目录生成可执行文件vasp
如果修改了Makefile,运行make clean后需要重新拷贝fftw3.f到当前目录
错误1:
pead.o: In function `pead_mp_calc_polarization_':
pead.f90:(.text+0x18122): undefined reference to `zgeco_'
pead.f90:(.text+0x18183): undefined reference to `zgedi_'
解决:
错误原因: 缺少linpack_double.o。如下
加上最后一行即可
LIB = -I$(MKLINCLUDE) -L$(MKLPATH) /
-L../vasp.5.lib -ldmy /
$(BLASLAPACK) /
../vasp.5.lib/linpack_double.o
错误2:
fftmpiw.o: In function `fftmakeplan_mpi_':
fftmpiw.f90:(.text+0xa4c): undefined reference to `fftmakeplan_'
fftmpiw.o: In function `fftini_mpi_':
fftmpiw.f90:(.text+0xa9d): undefined reference to `fftini_'
解决:
错误原因 ,5.2 makefile 中并行部分的 FFT3D 中缺少一个 .o 文件 , 补上即可。
FFT3D= fftmpiw.o fftmpi_map.o fft3dlib.o /opt/intel/mkl/10.2.1.017/lib/em64t/libfftw3xf_intel.
a
修改为
FFT3D= fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o /opt/intel/mkl/10.2.1.017/lib/em64t/libfftw3
xf_intel.a
http://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-using-intel-mkl-in-vasp
http://qingyan1971.spaces.live.com/blog/cns!90DC91975FC440F6!432.entry
http://blog.163.com/wangle_xq/blog/static/1302592200961025431681/
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/linfengfeiye/archive/2010/06/28/5699176.aspx