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

[netCDF #SIG-623263]: Segmentation fault when fortran code reads netcdf file



> OS: Suse Sles11
> Compilers (64bit): gcc 4.3.2,  gfortran
> Netcdf version 4.1.1
> Compilation steps
> 
> >  setenv FC gfortran
> >  setenv CC gcc
> >  configure --disable-cxx --disable-netcdf-4
> >  make
> >  make check
> >  sudo make install
> 
> Compilation errors:
> 
> gfortran -g -O2  -I/usr/local/include -c ncGrid.f90
> gfortran -g -O2  -I/usr/local/include -c  mopnc2etauv.f90
> gfortran -g -O2  -I/usr/local/include -c  mopnc2eta.f90
> gfortran -g -O2  -I/usr/local/include -L/usr/local/lib -lnetcdf -o 
> mopnc2etauv ncGrid.o mopnc2etauv.o
> ncGrid.o: In function `handle_nf_err':
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:136: undefined reference 
> to `nf_strerror_'
> ncGrid.o: In function `getgrid':
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:109: undefined reference 
> to `nf_inq_varid_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:110: undefined reference 
> to `nf_get_var_int_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:114: undefined reference 
> to `nf_inq_varid_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:115: undefined reference 
> to `nf_get_var_real_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:119: undefined reference 
> to `nf_close_'
> ncGrid.o: In function `getdims':
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:67: undefined reference to 
> `nf_open_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:72: undefined reference to 
> `nf_inq_dimid_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:74: undefined reference to 
> `nf_inq_dimlen_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:77: undefined reference to 
> `nf_inq_dimid_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:79: undefined reference to 
> `nf_inq_dimlen_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:82: undefined reference to 
> `nf_inq_dimid_'
> /home/turekg/tide_calculator/mopnctrans/ncGrid.f90:84: undefined reference to 
> `nf_inq_dimlen_'
> 
> This is driving me crazy, I have a similar system (but with netcdf compiled 
> to support netcd4 and HDF5) where it works fine
> Gaby
> 
> 
> 
> 

Howdy Gaby!

Try setting CPPFLAGS=-DgFortran and try again.

Ed

Ticket Details
===================
Ticket ID: SIG-623263
Department: Support netCDF
Priority: Critical
Status: Closed