WRF编译指南2

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

WRF编译指南2 编译NetCDF4.0, intel fortran 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: /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:
/downloads/netcdf/netcdf-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*
/cd/software/products/asmo-na/eng/compilers/284264.htm
Intel® Compilers for Mac OS*
/cd/software/products/asmo-na/eng/compilers/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 <work directory>
$ 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.。

相关文档
最新文档