[MITgcm-support] Can we create NetCDF-enabled binaries... no
Martín Silva
msilva at prmarg.org
Thu Mar 19 15:52:34 EDT 2009
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.
More information about the MITgcm-support
mailing list