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

20030606: compiling netcdf without second underscore



Brian,

> To: "'address@hidden'" <address@hidden>
> From: "HOETH, BRIAN R. (JSC-ZS) (LM)" <address@hidden>
> Subject: compiling netcdf without second underscore?
> Organization: UCAR/Unidata

The above message contained the following:

> We're trying to compile software from a mesoscale model called ARPS on our
> system and we ran into an interesting problem.  One of the utilities that
> the ARPS package offers is a arps2ncdf converter which converts the output
> of the ARPS model to netcdf.  When we tried to compile the arps2ncdf utility
> we got undefined references to things like "nf_create_" (see email trail
> below).  When we emailed the ARPS support, they recommended that we compile
> netcdf to NOT do the second underscore.  
> 
> (1)  Are you aware of how we could accomplish compiling netcdf with NO
> second underscore?
>
> (2) Would compiling with NO second underscore cause any unwanted
> repercussions with any of the other Unidata utilities, specifically with the
> Unidata decoders package?

I believe that the decoders package uses only the netCDF C interface and
not the netCDF Fortran interface, so it should be unaffected.

> It's noted in the email trail below, but we are running on Redhat 8.0 with
> the Portland Group Compiler.  The output of uname -a is:
> Linux etamodel 2.4.18-14smp #1 SMP Wed Sep 4 12:34:47 EDT 2002 i686 i686
> i386 GNU/Linux

A second underscore is added to Fortran routine names by the f2c(1)
utility on BSD and Linux systems.  Apparently, your netCDF library was
built using this compiler.  If you rebuild the netCDF package using the
same Portland Group Fortran compiler that you're using for the other
package, then you should be OK (in general, it's not a good idea to
mix compilers).  When you rebuild the netCDF library, ensure that the
environment variable CPPFLAGS contains the string "-DpgiFortran" -- this
should prevent the appearance of the second underscore.

> Thanks!
> 
> ---------------
> Brian Hoeth
> Spaceflight Meteorology Group
> Johnson Space Center   
> Ph: 281-483-3246
> Ops:  281-483-1051

Regards,
Steve Emmerson