XiZi's Blog

Build NetCDF For C,C++,Fortran interface with intel comilers

由于版本的变化,导致了NetCDF的一些变化。因此,此过程仅适用于NetCDF的版本为4.1.3(估计适用于3.6.3-4.1.3),但不适用于后来的4.2版本。

1、解压源程序包,修改configure文件

--- netcdf-4.1.3/configure      2011-07-01 07:22:45.000000000 +0800
+++ netcdf-4.1.3n/configure     2013-04-19 05:39:43.029982048 +0800
@@ -24472,7 +24472,7 @@
               call sub()
               end
 EOF
-           doit='$FC -c ${FFLAGS} conftest.f'
+           doit='$FC -c conftest.f'
            if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$doit\""; } >&5
   (eval $doit) 2>&5
   ac_status=$?

2、configure and install

./configure --disable-netcdf-4 --disable-dap --prefix=/opt/netcdf \
CPP='icc -E' CXXCPP='icpc -E' CC=icc CXX=icpc FC=ifort F90=ifort F77=ifort \
CFLAGS="-fast -w" CXXFLAGS="-fast -w" FFLAGS="-fast -w" LD=ifort \
LFLAGS="-fast -w" AR=xiar CPPFLAGS='-DNDEBUG -DINTEL_COMPILER' 
make install

PS: 如果在Centos下configure失败,请安装依赖库。

yum install glibc-devel glibc-headers glibc-static




Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee