ifort 编译wrf及netcdf的编译方法
(2013-06-21 18:24:35)ifort 编译wrf及netcdf的编译方法
glamor 发表于: 2009-11-10 09:50 来源:
参考资料;
1.(aioply 编辑整理)
2.intel官方论坛对编译netcdf和wrf的说明
此次编译不涉及mpich
4.2
WRF编译
4.2.1
注意事项
1、编译wrf,需要用到netcdf的库,需要指定环境变量(定义NETCDF库的位置),也可以把netcdf变量写到用户的bashrc文件中,也可以在shell中定义注意NETCDF的大小写
bash下:export NETCDF=/home/aqs/NETCDF
2、编译WRF所用到得编译器要和编译NETCDF库的编译器一致,比如都用到intel的intel64的编译器ifort和icc。
3、此验证的是串行编译和SMP方式编译,MPI方式编译暂未验证。
4、用intel 编译器编译WRF必须更改一个文件。
Problem: If you encounter a compile problem with tc_em.F (e.g. when using ifort), it might be due to duplicate declaration of variables itmp and icnt. Note also this does not affect compiling other executables. Also note that tc.exe needs to be compiled serially. If you use this program, compile it separately from other WRF programs.Solution: Edit main/tc_em.F, and remove one set of declaration of these variables.
5、用其他编译器遇到的问题看参考WRF FIX
http://www.mmm.ucar.edu/wrf/users/wrfv3.1/known-prob-3.1.html
4.2.2
前期配置检查
1、 配置intel编译环境 参考2.2
2、 如果使用intelMPI,则需要 设置环境变量,使用 “source mpivars.sh”If using Intel® MPI, set up the environment with "source mpivars.sh" from the MPI bin directory (bin64 directory for Intel 64).
3、配置netcdf,export
NETCDF=/home/aqs/NETCDF
4.2.3
编译WRF
1、指定netcdf的目录 export NETCDF=/home/yang/wrf/NETCDF
Untar the WRF download and configure and build
WRF according to the README file:
Run ./configure for WRF and select an option
that includes ifort.
2、运行命令./configure 选择合适的编译参数,还需要在修改configure.wrf
Modify the configure.wrf file as necessary. We
recommend
实际上不修改configure.wrf,同样可以编译成功
3、修改configure.wrf 文件 在此根据CPU优化编译参数
Replace " -mp" by " -fp-model precise"
对于FCOPTIM选项
对于安腾处理器 For
Intel Itanium-based processors running Linux, set
FCOPTIM = -O3 –fno-alias -ip
For Intel® 64 or IA-32 processors running Linux
or Mac OS X, set:
FCOPTIM = -O3 –xT –fno-alias -ip for Intel® Core® 2 Duo processors
FCOPTIM = -O3 –xP –fno-alias -ip for any Intel® processor with at least SSE3 support
For the 11.x compiler, -xssse3 is equivalent to -xT and -xsse3 is equivalent to –xP,并支持SSE4.x编译参数
For Intel® 64 or IA-32 processors running Linux,
set:
FCOPTIM = -O3 –xW –fno-alias -ip for any processor with at least SSE2 support. For the 11.0 compiler, -msse2 is equivalent to –xW and is the default setting for Intel® 64 or IA-32 processors running Linux.
If ARCHFLAGS contains the definition
–DIFORT_KLUDGE, remove it.
Ensure that the base options include –convert
big-endian and –align all
Verify NETCDFPATH 更改netcdf路径
Verify path
for MPI if used.
Make any additional changes indicated in the
"known issues" section.
With these, it should be possible to build all source files with full optimization. However, if desired, certain files, such as module_dm, may be built with FCBASEOPTS and OMP but without FCOPTIM, in order to reduce compilation time and memory requirement.
4、建立 WRF程序
./compile em_real >& log
查看run目录下,各可执行文件的生成情况
编译不成功,查找错误,重新编译前需要./clean –a。
注:里面有个程序,clean不能完全清楚,需要手动删除。
intel 编译NetCDF(2009-06-03 00:24:05)标签:intel netcdf 杂谈
分类:气象模式
Performance Tools for Software Developers - Building NetCDF* with the Intel® Compilers
Introduction
This guide is intended to help Intel® Fortran Compiler customers build the NetCDF software libraries on Intel® architecture systems running Linux* or Mac OS*. This guide will also cover use of the Intel® C++ Compiler, although it is not required to build NetCDF.
NetCDF (Network Common Data Form) is a machine-independent, self-describing, binary data format standard for exchanging scientific data. Information about NetCDF can be obtained from the University Corporation for Atmospheric Research (UCAR), website:http://www.unidata.ucar.edu/software/netcdf/ †
Version information
This application note was created to help users of NetCDF 3.6.2 build the libraries with the latest versions of Intel Fortran Compilers, specifically, version 10.0. This application note will also cover use of the Intel C++ Compiler version 10.0.
Obtaining the source code
The source code download is under NetCDF-3.6.2 C/C++/Fortran Source Code and Documentation from this URL:http://www.unidata.ucar.edu/down
... cdf-3_6_2/index.jsp† . For example, select "netcdf.tar.gz -
netCDF-3.6.2 as a gzipped tar file" to download.
Obtaining the latest version of Intel® compilers
Intel® Compilers for Linux*
http://www.intel.com/cd/software ... ompilers/284264.htm
Intel® Compilers for Mac OS*
http://www.intel.com/cd/software ... ompilers/270528.htm
Prerequisites
The Intel Fortran Compiler and the Intel C++ Compiler are required to build the NetCDF libraries.
Hardware: The steps in this guide have been tested on Intel® Core™2 Duo processors Software: This guide applies to version 10.0 of the Intel Compilers.
Configuration and set-up information
The Intel Fortran and C++ Compilers should be in your $PATH environment variable. Also, your $LD_LIBRARY_PATH environment variable should include the directory for the libraries provided with the Intel Compilers. Using the bash shell, this can be done by sourcing the ifortvars.sh and iccvars.sh files in the compiler bin/ directory. For example:
$ source /opt/intel/cce/10.0.xxx/bin/iccvars.sh
$ source /opt/intel/fce/10.0.xxx/bin/ifortvars.sh
After downloading the NetCDF tar file, extract the NetCDF source code in a work directory.
$ cd
$ tar -xvzf netcdf-3.6.2.tar.gz
Below are the steps needed to build NetCDF on Linux. If you wish to build for Mac OS X, skip ahead by clicking on this link to building NetCDF on Mac OS*.
Building NetCDF on Linux*
The NetCDF build process starts with a configuration step. The configuration script uses environment variables to select the compilers and compiler options to use when building NetCDF.
Set environment variables
To build for Linux with the Intel Fortran Compiler and Intel C++ Compiler, export the following environment variables:
$ export CC=icc
$ export CXX=icpc
$ export CFLAGS='-O3 -xT -ip -no-prec-div -static'
$ export CXXFLAGS='-O3 -xT -ip -no-prec-div -static'
$ export F77=ifort
$ export FC=ifort
$ export F90=ifort
$ export FFLAGS='-O3 -xT -ip -no-prec-div -static'
$ export CPP='icc -E'
$ export CXXCPP='icpc -E'
Note that the -xT compiler option will generate code using SSE3 instructions that are not available on processors older than Intel Core™ 2 Duo processors. If you will be using the lib raries on systems with older Intel® processors, you will want to use the –xP, -xN, or –xW options. Consult the online compiler documentation installed with the compiler for details about these options.
Run configuration utility
After the environment variables are exported, perform the configuration step by changing your directory to the NetCDF source directory and running the configuration script
$ cd netcdf-3.6.2
$ ./configure
The configuration script will set up the Makefiles that will be used to build the NetCDF libraries and utilities. It will also set up the installation directory for the default location of /usr/local. If you would like to install the libraries in another location, use this configure command:
$ ./configure --prefix=/your/desired/install/directory
Make the libraries
When the configuration step completes successfully, you can build the libraries using ‘make’.
$ make
如果make以确定成功,则不再需要make check。
Testing NetCDF on Linux*
You can test your NetCDF libraries using ‘make check’.
$ make check
Installing NetCDF on Linux*
Install NetCDF libraries using ‘make install’.
$ make install
This will install the NetCDF libraries, include files, and utilities in the default location of /usr/local or the location specified in the configuration step with the --prefix= option.
1.(aioply 编辑整理)
2.intel官方论坛对编译netcdf和wrf的说明
此次编译不涉及mpich
4.2
4.2.1
1、编译wrf,需要用到netcdf的库,需要指定环境变量(定义NETCDF库的位置),也可以把netcdf变量写到用户的bashrc文件中,也可以在shell中定义注意NETCDF的大小写
bash下:export NETCDF=/home/aqs/NETCDF
2、编译WRF所用到得编译器要和编译NETCDF库的编译器一致,比如都用到intel的intel64的编译器ifort和icc。
3、此验证的是串行编译和SMP方式编译,MPI方式编译暂未验证。
4、用intel 编译器编译WRF必须更改一个文件。
Problem: If you encounter a compile problem with tc_em.F (e.g. when using ifort), it might be due to duplicate declaration of variables itmp and icnt. Note also this does not affect compiling other executables. Also note that tc.exe needs to be compiled serially. If you use this program, compile it separately from other WRF programs.Solution: Edit main/tc_em.F, and remove one set of declaration of these variables.
5、用其他编译器遇到的问题看参考WRF FIX
http://www.mmm.ucar.edu/wrf/users/wrfv3.1/known-prob-3.1.html
4.2.2
1、 配置intel编译环境 参考2.2
2、 如果使用intelMPI,则需要 设置环境变量,使用 “source mpivars.sh”If using Intel® MPI, set up the environment with "source mpivars.sh" from the MPI bin directory (bin64 directory for Intel 64).
4.2.3
1、指定netcdf的目录 export NETCDF=/home/yang/wrf/NETCDF
2、运行命令./configure 选择合适的编译参数,还需要在修改configure.wrf
3、修改configure.wrf 文件 在此根据CPU优化编译参数
FCOPTIM = -O3 –fno-alias -ip
FCOPTIM = -O3 –xT –fno-alias -ip for Intel® Core® 2 Duo processors
FCOPTIM = -O3 –xP –fno-alias -ip for any Intel® processor with at least SSE3 support
For the 11.x compiler, -xssse3 is equivalent to -xT and -xsse3 is equivalent to –xP,并支持SSE4.x编译参数
FCOPTIM = -O3 –xW –fno-alias -ip for any processor with at least SSE2 support. For the 11.0 compiler, -msse2 is equivalent to –xW and is the default setting for Intel® 64 or IA-32 processors running Linux.
With these, it should be possible to build all source files with full optimization. However, if desired, certain files, such as module_dm, may be built with FCBASEOPTS and OMP but without FCOPTIM, in order to reduce compilation time and memory requirement.
4、建立 WRF程序
./compile em_real >& log
查看run目录下,各可执行文件的生成情况
编译不成功,查找错误,重新编译前需要./clean –a。
注:里面有个程序,clean不能完全清楚,需要手动删除。
intel 编译NetCDF(2009-06-03 00:24:05)标签:intel netcdf 杂谈
Performance Tools for Software Developers - Building NetCDF* with the Intel® Compilers
Introduction
This guide is intended to help Intel® Fortran Compiler customers build the NetCDF software libraries on Intel® architecture systems running Linux* or Mac OS*. This guide will also cover use of the Intel® C++ Compiler, although it is not required to build NetCDF.
NetCDF (Network Common Data Form) is a machine-independent, self-describing, binary data format standard for exchanging scientific data. Information about NetCDF can be obtained from the University Corporation for Atmospheric Research (UCAR), website:
Version information
This application note was created to help users of NetCDF 3.6.2 build the libraries with the latest versions of Intel Fortran Compilers, specifically, version 10.0. This application note will also cover use of the Intel C++ Compiler version 10.0.
Obtaining the source code
The source code download is under NetCDF-3.6.2 C/C++/Fortran Source Code and Documentation from this URL:
Obtaining the latest version of Intel® compilers
Intel® Compilers for Linux*
http://www.intel.com/cd/software ... ompilers/284264.htm
Intel® Compilers for Mac OS*
http://www.intel.com/cd/software ... ompilers/270528.htm
Prerequisites
The Intel Fortran Compiler and the Intel C++ Compiler are required to build the NetCDF libraries.
Hardware: The steps in this guide have been tested on Intel® Core™2 Duo processors Software: This guide applies to version 10.0 of the Intel Compilers.
Configuration and set-up information
The Intel Fortran and C++ Compilers should be in your $PATH environment variable. Also, your $LD_LIBRARY_PATH environment variable should include the directory for the libraries provided with the Intel Compilers. Using the bash shell, this can be done by sourcing the ifortvars.sh and iccvars.sh files in the compiler bin/ directory. For example:
$ source /opt/intel/cce/10.0.xxx/bin/iccvars.sh
$ source /opt/intel/fce/10.0.xxx/bin/ifortvars.sh
After downloading the NetCDF tar file, extract the NetCDF source code in a work directory.
$ cd
$ tar -xvzf netcdf-3.6.2.tar.gz
Below are the steps needed to build NetCDF on Linux. If you wish to build for Mac OS X, skip ahead by clicking on this link to building NetCDF on Mac OS*.
Building NetCDF on Linux*
The NetCDF build process starts with a configuration step. The configuration script uses environment variables to select the compilers and compiler options to use when building NetCDF.
Set environment variables
To build for Linux with the Intel Fortran Compiler and Intel C++ Compiler, export the following environment variables:
$ export CC=icc
$ export CXX=icpc
$ export CFLAGS='-O3 -xT -ip -no-prec-div -static'
$ export CXXFLAGS='-O3 -xT -ip -no-prec-div -static'
$ export F77=ifort
$ export FC=ifort
$ export F90=ifort
$ export FFLAGS='-O3 -xT -ip -no-prec-div -static'
$ export CPP='icc -E'
$ export CXXCPP='icpc -E'
Note that the -xT compiler option will generate code using SSE3 instructions that are not available on processors older than Intel Core™ 2 Duo processors. If you will be using the lib raries on systems with older Intel® processors, you will want to use the –xP, -xN, or –xW options. Consult the online compiler documentation installed with the compiler for details about these options.
Run configuration utility
After the environment variables are exported, perform the configuration step by changing your directory to the NetCDF source directory and running the configuration script
$ cd netcdf-3.6.2
$ ./configure
The configuration script will set up the Makefiles that will be used to build the NetCDF libraries and utilities. It will also set up the installation directory for the default location of /usr/local. If you would like to install the libraries in another location, use this configure command:
$ ./configure --prefix=/your/desired/install/directory
Make the libraries
When the configuration step completes successfully, you can build the libraries using ‘make’.
$ make
如果make以确定成功,则不再需要make check。
Testing NetCDF on Linux*
You can test your NetCDF libraries using ‘make check’.
$ make check
Installing NetCDF on Linux*
Install NetCDF libraries using ‘make install’.
$ make install
This will install the NetCDF libraries, include files, and utilities in the default location of /usr/local or the location specified in the configuration step with the --prefix= option.
分享:
喜欢
0
赠金笔
加载中,请稍候......
前一篇:linux 下查看软件安装情况
后一篇:村上春树经典语录

加载中…