| Last Modified On : | September 19, 2008 1:00 AM PDT |
Rate |
|
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/ † 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. 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/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* Intel® Compilers for Mac OS* 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 After downloading the NetCDF tar file, extract the NetCDF source code in a work directory. $ cd <work directory> 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*. 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.
$ export CC=icc 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. 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 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 When the configuration step completes successfully, you can build the libraries using ‘make’. $ make You can test your NetCDF libraries using ‘make check’. $ make check 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. Building NetCDF on Mac OS* (or skip back to 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.
$ export CC=icc
$ export CC=icc 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 Th e 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 When the configuration step completes successfully, you can build the libraries using ‘make’. $ make You can test your NetCDF libraries using ‘make check’. $ make check 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. On systems that support 32-bit and 64-bit compilation, ensure that the Fortran and C++ compilers are properly matched so that you are not mixing 32-bit and 64-bit object files. If you cannot complete the configuration step, verify that you have selected compatible pairs of 32-bit Fortran and C++ compilers or 64-bit Fortran and C++ compilers. † This link will take you off of the Intel Web site. Intel does not control the content of the destination Web Site. |
| April 22, 2009 5:42 PM PDT
naishi
|
Hello, I just want to know what you meant in the above material: ---------------------------------------------------------- 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 ---------------------------------------------------------- where is the compiler bin/ directory, could you be kind to show me how to get this subdirectory. right now i am in /home/naishi/netCDF; namely the working directory. Thank you for your help! Phillip |
| April 24, 2009 8:31 AM PDT
Mike Pacey |
Just had a failed configure with Intel 10.1 on NetCDF 4.0.1 - the root cause seems to be the -ipo flag In order to work out the specific fortran function name mangling, configure generates object code from a simple fortran program: call sub() end and then runs nm on the object code and attempts to grep out the correct symbol style (SUB, SUB_, sub or sub_). Basic symbol table without -ipo is: 0000000000000000 r LITPACK_0.0.0 0000000000000000 T MAIN__ U __intel_new_proc_init U for_set_reentrancy U sub_ Adding the -ipo flag gives the following nm output: w __ildata_included configure can't find a match and bails |
| April 27, 2009 10:36 PM PDT
yajivbs
|
I have installed the ifort 11.0 and icc 11.0 in my work station. Now I am installing the netcdf-3.6.3. While installing I got the following error. > > configure:3596: icc --version >&5 > icc: error #10149: option '-cxxlib-gcc' not supported with the current installed GCC > configure:3600: $? = 1 > configure:3607: icc -v >&5 > Version 11.0 > configure:3611: $? = 0 > configure:3618: icc -V >&5 > Intel(R) C Intel(R) 64 Compiler Professional for applications running on > Intel(R) 64, Version 11.0 Build 20081105 Package ID: l_cproc_p_11.0.074 > Copyright (C) 1985-2008 Intel Corporation. All rights reserved. > FOR NON-COMMERCIAL USE ONLY > > configure:3622: $? = 0 > configure:3645: checking for C compiler default output file name > configure:3667: icc conftest.c >&5 > icc: error #10149: option '-cxxlib-gcc' not supported with the current installed GCC > configure:3671: $? = 1 > configure:3709: result: > configure: failed program was: > | /* confdefs.h. */ > > Kindly help me to solve this problem > Regards > Vijay |
| April 30, 2009 9:13 AM PDT
Nick Witcraft |
FYI...I could not get to compile with F90 until I set the following: setenv FC ifort setenv F90 ifort |
| May 15, 2009 9:25 AM PDT
Ronald W. Green (Intel)
|
Mike: -ipo, yes this can cause some adverse name mangling. And it is not clear that -ipo buys any more over -ip. I'll update this knowledge base article. Yajivbs: your g++ is either not installed or not at the same version as your gcc. Get g++ at the same version as gcc and make sure both work. Then try icc icpc with simple hello world programs before you dive into something as complex as netCDF. Nick, I'll add your FC and F90 notes. And it is probably time for a netCDF 4.0 KB. |

Roy Dennington
Note, the f90 bindings DEPEND on the the FORTRAN bindings.
Thanks, Roy