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

[netCDF #AOC-699065]: some troubles with netcdf



Hi Xiaohuhu,

> I'm fairly new to netcdf and I have some troubles with netcdf. I can
> install it with the script I write, and it shows me "Congratulations! You
> have successfully installed netCDF!" but when i type make check, it only
> finish 9 test and tell me "error".when i compile the example code  to make
> netcdf file, it sees something wrong. I'm confuse, is there anyone can help
> me?  I put the messages and my macbook's information below.
> 
> 
> 
> 
> my system is Mac os 10.5.8 and fortran compile is intel fortran 9.1, the cpu
> is Intel Core 2 Duo T8300,and i try netcdf 4.0 and 3.6.3,it show the same
> error.
> 
> =======================================================================
> 
> $  ifort simple_xy_wr.f90

You need to give ifort the flags it needs to know where netCDF was installed.  
For
example, if you installed netCDF in /usr/local, then you would need to use
something like

 $ ifort -I /usr/local/include simple_xy_wr.f90 -L /usr/local/lib -lnetcdf 
-lnetcdff -o simple_xy_wr

but I'm not sure what the correct ifort flags are.  For that you'll need to 
consult the ifort
documentation.

> simple_xy_wr.f90(46) : (col. 6) remark: LOOP WAS VECTORIZED.
> 
> Undefined symbols:
> 
> "_netcdf_mp_nf90_strerror_", referenced from:
> 
> _simple_xy_wr_.check_ in ifortPZc5zk.o
> 
> "_netcdf_mp_nf90_close_", referenced from:
> 
> _MAIN__ in ifortPZc5zk.o
> 
> "_netcdf_mp_nf90_def_var_manydims_", referenced from:
> 
> _MAIN__ in ifortPZc5zk.o
> 
> "_netcdf_mp_nf90_create_", referenced from:
> 
> _MAIN__ in ifortPZc5zk.o
> 
> "_netcdf_mp_nf90_put_var_2d_fourbyteint_", referenced from:
> 
> _MAIN__ in ifortPZc5zk.o
> 
> "_netcdf_mp_nf90_enddef_", referenced from:
> 
> _MAIN__ in ifortPZc5zk.o
> 
> "_netcdf_mp_nf90_def_dim_", referenced from:
> 
> _MAIN__ in ifortPZc5zk.o
> 
> _MAIN__ in ifortPZc5zk.o
> 
> ld: symbol(s) not found

Right, these symbols were'nt find because you needed to tell ifort where to find
the libraries to link with, using the -L and -l flags, for example.

> =======================================================================
> 
> this is the error message when i type make check :
> 
> ==================
> 
> All 9 tests passed
> 
> ==================
> 
> Making check in nf_test
> 
> make  nf_test tst_f77_v2        ftest tst_f90
> 
> ifort -DHAVE_CONFIG_H -I. -I.. -I../fortran  -I/include  -I../fortran
> -I../libsrc -I../fortran  -I../f90 -g -c -o test_get.o test_get.F
> 
> ifort: error: Fatal error in /opt/intel/fc/9.1.038/bin/fpp, terminated by
> segmentation violation

That error comes from that version of ifort not knowing to invoke the
Fortran preprocessor, fpp, to process ".F" files.  That version of ifort
only knew how to compile ".f" files.  This link explains that you need a 
later version of ifort that knows what to do with ".F" files:

  
http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/59342/

I hope this helps.  We don't have ifort installed on our MacOS X test platform, 
so
we can't duplicate the problem or test that the current release works with that
platform combination.

--Russ

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



Ticket Details
===================
Ticket ID: AOC-699065
Department: Support netCDF
Priority: Normal
Status: Closed