[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #STU-162362]: Netcdf with intel compilers

Hi Vanesa,

> HI: IÂm trying to install netcdf 3.6.2 using intel compilers.
> I follow the instructions in Building
> NetCDF* with the Intel Compilers
> 1)
> address@hidden:/opt/intel/Compiler/11.1/072/bin/ia32$ source
> /opt/intel/Compiler/11.1/072/bin/ia32/iccvars_ia32.sh
> address@hidden:/opt/intel/Compiler/11.1/072/bin/ia32$ source
> /opt/intel/Compiler/11.1/072/bin/ia32/ifortvars_ia32.sh
> 2)
> $ cd <work directory>
> $ tar -xvzf netcdf-3.6.2.tar.gz
> 3)
> $ 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'
> 4)sudo ./configure --prefix=/usr/local/netcdf
> 5) sudo make
> And I get this error:
> ncvalues.cpp: In member function 'virtual char* 
> NcValues_ncbyte::as_string(long int) const':
> ncvalues.cpp:238: error: 'strncpy' was not declared in this scope
> ncvalues.cpp: In member function 'virtual char* NcValues_char::as_string(long 
> int) const':
> ncvalues.cpp:246: error: 'strncpy' was not declared in this scope
> make[2]: *** [ncvalues.lo] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> I'm missing something?

Version 3.6.2 of netCDF, from 2007, had a bug in the C++ interface,
the file cxx/ncvalues.cpp was missing the statement

  #include <cstring>


  #include <string>

near the beginning of the file.  So one workaround would be to edit
that file by inserting that statement, and then continue running the
"make all check" to see if it completes successfully.

An alternative would be to just use a newer version of netCDF with
this bug (and others) fixed.  I recommend just getting the latest
netCDF source distribution (4.1.1) and building/installing from that.
If you specify --disable-netcdf-4 as an option to configure, it will
just build the netCDF-3 libraries and executables, so you won't have
to install HDF5.  You can also specify --disable-dap if you don't
need remote access via OPeNDAP to data on remote servers.  If you use 
version 4.1.1, you can continue to use the same flag settings you are 
using for 3.6.2.

Another alternative would be to just not build the C++ interface,
which is not used by the other netCDF utilities such as ncdump and
ncgen.  This is accomplished by running the configure script again 
after specifying

  $ export CXX=''

along with the other settings you are using.


Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: STU-162362
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.