[MITgcm-support] Can we create NetCDF-enabled binaries... no

Dimitris Menemenlis menemenlis at jpl.nasa.gov
Thu Mar 19 17:28:01 EDT 2009


Not sure if relevant ... but in past I have had some such problem with  
a netcdf library because it had not been compiled with same compiler  
that I was using for compiling the MITgcm.  D.

On Mar 19, 2009, at 12:52 PM, Martín Silva wrote:

> Martin Losch escribió:
>> The segmentation problem is most likely caused by to little available
>> stack memory. Try "unlimited" before you start the model; "size
>> mitgcmuv" gives you an idea of how much memory you will need.
>>
>> netcdf: if your netcdf is in /usr/lib//usr/include, then this opt- 
>> file
>> should work, right? After runing genmake2 (or make CLEAN && make
>> makefile), you'll get a genmake_warning which will give you the error
>> messages of the compiler and linker, have a look at them and if you
>> don't see what's wrong, you could send them to the list.
>>
>> M.
>
> What genmake_warning says is that cannot link.
>
> collect2: ld returned 1 exit status
> try again with added '-lnetcdf'
>  cpp  -traditional -P -D_BYTESWAPIO -DWORDLENGTH=4 -DNML_TERMINATOR
> -DHAVE_SYSTEM -DHAVE_FDATE -DHAVE_CLOC -DHAVE_SETRLSTK -DHAVE_SIGREG
> -DHAVE_STAT -I.  genmake_tnc.F > genmake_tnc.f \
>  &&  gfortran -Wunused -O3 -malign-double -funroll-loops -c  
> genmake_tnc.f \
>  &&  gfortran -o genmake_tnc genmake_tnc.o  -lnetcdf
> genmake_tnc.o: In function `MAIN__':
> genmake_tnc.f:(.text+0x3f): undefined reference to `nf_create_'
> genmake_tnc.f:(.text+0x71): undefined reference to `nf_def_dim_'
> genmake_tnc.f:(.text+0x84): undefined reference to `nf_close_'
> genmake_tnc.f:(.text+0xdb): undefined reference to `nf_strerror_'
> genmake_tnc.f:(.text+0x154): undefined reference to `nf_strerror_'
> genmake_tnc.f:(.text+0x1cc): undefined reference to `nf_strerror_'
> collect2: ld returned 1 exit status
>
>
> I tryed manually with -lnetcdf but it doesn't work :
>  cpp  -traditional -P -D_BYTESWAPIO -DWORDLENGTH=4 -DNML_TERMINATOR
> -DHAVE_SYSTEM -DHAVE_FDATE -DHAVE_CLOC -DHAVE_SETRLSTK -DHAVE_SIGREG
> -DHAVE_STAT -I.  genmake_tnc.F > genmake_tnc.f
>
> gfortran -Wunused -O3 -malign-double -funroll-loops -c genmake_tnc.f
> gfortran -o genmake_tnc genmake_tnc.o  -lnetcdf
>
>
> and get the above errors (undefined reference ...)
>
> I think I have the correct libraries:
>
> /usr/lib/libnetcdf.so
> /usr/lib/libnetcdf.so.4
> /usr/lib/libnetcdf.so.4.0.0
> /usr/lib/libnetcdff.so
> /usr/lib/libnetcdff.so.4
> /usr/lib/libnetcdff.so.4.0.0
> /usr/lib/libnetcdf_c++.so
> /usr/lib/libnetcdf_c++.so.4
> /usr/lib/libnetcdf_c++.so.4.0.0
>
> M.
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support

Dimitris Menemenlis <menemenlis at jpl.nasa.gov>
Jet Propulsion Lab, California Institute of Technology
MS 300-323, 4800 Oak Grove Dr, Pasadena CA 91109-8099, USA
tel: 818-354-1656;  cell: 818-625-6498;  fax: 818-393-6720





More information about the MITgcm-support mailing list