[MITgcm-support] help with netcdf
Baylor Fox-Kemper
baylor at MIT.EDU
Tue Apr 26 12:18:05 EDT 2005
Hi Samar,
When you compile netcdf with the fortran wrapper routines, you want
FC=xlf, not FC=g77. If you use FC=g77, it will change the names of the
fortran wrappers to have things like _nf_save instead of nf_save (These
are probably only correct in spirit). When xlf compiles the MITgcm, it
will try to link to a subroutine called nf_save, but if you compiled
with g77, you will only have a precompiled library subroutine called
_nf_save, so it will fail. I found it easiest to compile the netcdf
libraries with gcc/xlf instead of gcc/g77, which eliminates a lot of
hassle.
It is also possible that you didn't compile the fortran wrapper
routines when you compiled netcdf, in which case the linker will
certainly fail...
Cheers,
-Baylor
On Apr 26, 2005, at 12:11 PM, samar khatiwala wrote:
> Baylor, I don't follow. I'm using Mac OS X with gcc/xlf. I have no
> trouble
> compiling the netcdf libraries and can use them with other code. Where
> does intel come into the picture?
>
> Thanks, Samar
>
> On Tue, 26 Apr 2005, Baylor Fox-Kemper wrote:
>
>> Hi Samar,
>> I had to compile netcdf myself with the intel compiler to get it to
>> work with the intel-compiled mitgcm. There is a name-mangling problem
>> otherwise.
>> Cheers,
>> -Baylor
>>
>> On Apr 26, 2005, at 11:54 AM, samar khatiwala wrote:
>>
>>> Hi Ed
>>>
>>> Could you please help me sort out a netcdf problem? I cannot get the
>>> MNC
>>> package to work. This is on a dual G5 with a working netcdf
>>> installation.
>>> I get:
>>>
>>> *********************************************************************
>>> WARNING: the "mnc" package was enabled but tests failed to compile
>>> NetCDF applications. Please check that:
>>>
>>> 1) NetCDF is correctly installed for this compiler and
>>> 2) the LIBS variable (within the "optfile") specifies the correct
>>> NetCDF library to link against.
>>>
>>> Due to this failure, the "mnc" package is now DISABLED.
>>> *********************************************************************
>>>
>>> Any hints what could be wrong? Can I get genmake2 to spit out more
>>> debug
>>> info? Optfile is below.
>>>
>>> Thanks, samar
>>>
>>> FC='mpif77'
>>> CC='mpicc'
>>> INCLUDES='-I/usr/local/lam/include -I/usr/local/netcdf/include'
>>> LIBS='-L/usr/local/netcdf/lib -lnetcdf'
>>> LN='/bin/ln -s'
>>> CPP='/usr/bin/cpp -traditional -P -xassembler-with-cpp'
>>> LINK=$FC
>>> FFLAGS='-qfixed=132 -qextname -qsave=all'
>>> FOPTIM='-O3'
>>> NOOPTFLAGS='-O0'
>>>
>>> S64='$(TOOLSDIR)/set64bitConst.sh'
>>> #MAKEDEPEND='${TOOLSDIR}/xmakedepend'
>>> #MAKEDEPEND=makedepend
>>> DEFINES='-DWORDLENGTH=4'
>>> # -DNML_TERMINATOR=" /"'
>>> MAKEDEPEND='/usr/X11R6/bin/makedepend'
>>>
>>>
>>> _______________________________________________
>>> MITgcm-support mailing list
>>> MITgcm-support at mitgcm.org
>>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org
>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
More information about the MITgcm-support
mailing list