Build CP2K using Intel Fortran compiler Professional Edition
来源:互联网 发布:施一公 开讲啦 知乎 编辑:程序博客网 时间:2024/05/20 21:21
http://software.intel.com/en-us/articles/build-cp2k-using-intel-fortran-compiler-professional-edition/
Introduction :
CP2K (http://cp2k.berlios.de/) is a freely available (GPL) program, written in Fortran, to perform atomistic and molecular simulations of solid state, liquid, molecular and biological systems. It provides a general framework for different methods such as e.g. density functional theory (DFT) using a mixed Gaussian and plane waves approach (GPW), and classical pair and many-body potentials.
Version :
1.08
Obtaining Source Code :
CP2K stable version
- the cp2k-2_1-branch: ftp://ftp.berlios.de/pub/cp2k/cp2k-2_1-branch.tar.gz
- the cp2k-2_2-branch: ftp://ftp.berlios.de/pub/cp2k/cp2k-2_2-branch.tar.gz
CP2K development version
- (nightly snapshot): ftp://ftp.berlios.de/pub/cp2k/cp2k.tar.gz
Prerequisites :
CP2K requires that you already have installed the Fortran compiler, math library with FFTW 2.x/3.x support. We suggest using both Intel Fortran compiler and Intel Math Kernel Library for better performance.
Configuration Set Up :
n/a
Source Code Changes :
n/a
Building the Application :
Here we show the detail on how to build the CP2K source with Intel Fortran Compiler for Intel 64 platform.
Part I. Intel Fortran Composer XE 2011
1) Download and install Intel Fortran Composer XE 2011 (first release version 2011.0.084).
Make sure you select to install both Intel Fortran compiler and Intel Math Kernel Library (MKL). The default installation directory is/opt/intel/composerxe-2011/ .
2) Build FFTW version 3.x wrappers library for Intel MKL Library
From Intel MKL version 10.2 and later, FFTW3 interface for Intel Fortran compiler is pre-built and ntegrated in Intel MKL core libraries. See http://software.intel.com/en-us/articles/intel-mkl-main-libraries-contain-fftw3-interfaces/.
Source code is still available to create wrappers for use with other compilers. Here is example to build Fortran version by gnu compiler.
] cd /opt/intel/composerxe-2011/mkl/interfaces/fftw3xf
] make libintel64 compiler=gnu
3) Untar the CP2K.tar.gz, and modify configuration file “Linux-x86-64-intel.sopt” in cp2k/arch directory, which is targeting for Intel 64 platform.
Here is an example of Linux-x86-64-intel.sopt for reference:
INTEL_MKL = /opt/intel/composerxe-2011/mklNotice: The options (-O2 -xHost) are available for both Intel® and non-Intel microprocessors but it may result in more optimizations for Intel microprocessors than for non-Intel microprocessors.
INTEL_INC = $(INTEL_MKL)/include/fftw
INTEL_LIB = $(INTEL_MKL)/lib/intel64
LIBINT_PATH = /usr/lib/libint-1.1.4
LIBINT_LIB = $(LIBINT_PATH)/lib/libderiv.a $(LIBINT_PATH)/lib/libint.a -lstdc++
FC = ifort
LD = ifort
AR = xiar -r
DFLAGS = -D__INTEL -D__FFTSG -D__FFTW3 -D__FFTMKL -D__LIBINT
CPPFLAGS = -C -traditional $(DFLAGS) -I$(INTEL_INC)
FCFLAGS = $(DFLAGS) -I$(INTEL_INC) -O2 -xHost -heap-arrays 64 -fpp -free
LDFLAGS = $(FCFLAGS)
#LIBS = -mkl
LIBS = -L$(INTEL_LIB) -mkl $(LIBINT_LIB)
OBJECTS_ARCHITECTURE = machine_intel.o
4) Setup the environment of Intel Fortran compiler, then build CP2K source:
] source /opt/intel/composerxe-2011/bin/compilervars.sh intel64
] cd cp2k/makefiles/
] make ARCH=Linux-x86-64-intel VERSION=sopt
Part II. Intel Fortran Compiler Professional Edition (version 11.0 / 11.1)
Please follow the steps listing below:.
1) Download and install Intel Fortran compiler Professional Edition version.
Make sure you select to install both Intel Fortran compiler and Intel Math Kernel Library (MKL). For example, the default installation directory is under /opt/intel/Compiler/11.0/083 or /opt/intel/Compiler/11.1/072.
2) Build FFTW version 3.x wrappers library for Intel MKL Library
Note: Please skip this step if you are using Intel Fortran compiler version 11.1, or Intel MKL libraries version 10.2 and later.
The source code for the wrappers and makefiles with the wrapper list files for Fortran are located in the /interfaces/fftw3xf sub-directories in the Intel MKL directory. Please use Intel C++ compiler (or GCC) to generate the wrappers library (libffw3xf_intel.a, orlibfftw3xf_gnu.a):
] cd /opt/intel/Compiler/11.0/083/mkl/interfaces/fftw3xf
] make libem64t compiler=intel (or make libem64t compiler=gnu)
3) Untar the CP2K.tar.gz, and modify configuration file “Linux-x86-64-intel.sopt” in cp2k/arch directory, which is targeting for Intel 64 platform.
Here is an example of Linux-x86-64-intel.sopt for reference:
INTEL_MKL = /opt/intel/Compiler/11.0/083/mklNotice: The options (-O2 -xHost) are available for both Intel® and non-Intel microprocessors but it may result in more optimizations for Intel microprocessors than for non-Intel microprocessors.
INTEL_INC = $(INTEL_MKL)/include/fftw
INTEL_LIB = $(INTEL_MKL)/lib/em64t
FC = ifort
LD = ifort
AR = xiar -r
DFLAGS = -D__INTEL -D__FFTSG -D__FFTW3 -D__FFTMKL
CPPFLAGS = -C -traditional $(DFLAGS) -I$(INTEL_INC)
FCFLAGS = $(DFLAGS) -I$(INTEL_INC) -O2 -xHost -heap-arrays 64 -fpp -free
LDFLAGS = $(FCFLAGS)
# If you are using ifort verison 11.1 with MKL version 10.2 and later, Intel MKL libraries and FFTW interfaces will be linked automatically with -mkl option
# LIBS = -L$(INTEL_LIB) -mkl
LIBS = -L$(INTEL_LIB) -lfftw3xf_intel -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
OBJECTS_ARCHITECTURE = machine_intel.o
4) Setup the environment of Intel Fortran compiler, then build CP2K source:
] source /opt/intel/Compiler/11.0/083/bin/ifortvars.sh intel64
] cd cp2k/makefiles/
] make ARCH=Linux-x86-64-intel VERSION=sopt
Running the Application :
CP2K provide several test cases, which can be used for stability testing and verify the results to see if the compilation is correct.
] cd cp2k/tests/QS
] ./../../exe/Linux-x86-64-intel/cp2k.sopt H2O-32.inp
] ./../../exe/Linux-x86-64-intel/cp2k.sopt H2O-3x3.inp
Known Issues or Limitations :
1) For CP2K version 2.1 branch
We recommended to use Intel Fortran Compiler version 11.1 update 6 (version 11.1.072) or later version.
If you want to use new Intel Fortran Composer XE 2011 (aka version 12.0), we suggest that one source file "qs_vxc_atom.F" should be compiled with -O1 option only. You could add the following lines into Linux-x86-64-intel.sopt to avoid this problem:
FCFLAGS2 = -I$(INTEL_INC) -O1 -xHost -heap-arrays 64 -fpp -free $(DFLAGS)
qs_vxc_atom.o: qs_vxc_atom.F
$(FC) -c $(FCFLAGS2) $<
2) For CP2K version 2.2 branch
Suggested to use the Intel Fortran compiler 11.1 update 6 and later version.
There are some known issues with new Composer XE 2011 (ifort version 12.x.xxx). Please use the XE 2011 update 8 and future version, also apply the following patches in configuration file "Linux-x86-64-intel.sopt":
FCFLAGS2 = -I$(INTEL_INC) -O1 -xHost -heap-arrays 64 -fpp -free $(DFLAGS)
et_coupling.o: et_coupling.F
$(FC) -c $(FCFLAGS2) $<
qs_vxc_atom.o: qs_vxc_atom.F
$(FC) -c $(FCFLAGS2) $<
<end>
- Build CP2K using Intel Fortran compiler Professional Edition
- How to build CP2K with Intel Compiler 12.1, OpenMPI-1.4.3 and Infiniband Support
- Intel Fortran Compiler
- Intel Fortran Compiler
- Intel Visual Fortran Compiler Pro 9.1.029
- Centos6.5安装intel fortran compiler
- 使用intel编译器的指令窗口 intel fortran compiler
- intel编译器编译cp2k
- f2py的语法(备查)-使用Intel Visual Fortran Compiler编译器
- Intel系列开发工具- C++ Compiler,Fortran Compiler,IPP,MKL,VTune,Thread Checker
- Diskeeper 2007 Professional Premier Edition 11.0 Build 686.1t
- Firefox 4 PGO BUILD with Intel C++ Compiler 12
- [boost] build boost with intel compiler 16.0.XXX
- Using VS2015 64-bit compiler to build up igllib
- 安装intel fortran
- vs+intel fortran
- DataRescue IDA Pro 5.0.0 Build 879 Advanced Edition - professional disassembler
- Armadillo v6.40 Public Build 32-bit Professional Edition incl. keygen+patch by AvAtAr {RES}
- Hibernate Dialect must be explicitly set 错误信息解决方法
- 破除“系统学习”的情结
- Android 读写文件的N种写法
- 树及树的算法(3) —— 平衡二叉树
- 如何用 C# 批量获取域名 IP
- Build CP2K using Intel Fortran compiler Professional Edition
- poj 1004 Java
- 如何成为优秀的技术开发人员?
- 东软第三天课
- android手机定位不准的问题
- 楼教主的ACM心路历程
- Eclipse中web项目部署至Tomcat步骤
- HTTP 错误 500.21 – Internal Server Error
- 关于chm电子书无法显示网页的解决方