At 8:37 PM +0100 27/10/01, Magnus Hagdorn wrote:
On Sat, 27 Oct 2001, Carlie Coats wrote:
>
> hi there,
> i've got problems compiling the netcdf library (version 3.5) using the
> intel f95 compiler on linux. the problem seems to be with the name
> mangling :-( the library compiles fine but linking f90 programs to the
> > library doesn't work.
First off what compiler (name mangling "pattern") have you declared
for cfortran.h? You should use:
setenv CPPFLAGS '-DNDEBUG -DpgiFortran'
Secondly are you using -ml cdecl and ML_EXTERNAL in the netcdf.inc
filed? You should not have if you use the setting above. Take a
look here:
http://www.cwr.uwa.edu.au/~slawinski/work/netcdfinfo.html
at my "NetCDF is your friend" page.
> > any ideas are much appriciated
> cheers
> magnus
I had to modify "src/fortran/cfortran.h" to make it work -- otherwise
the build (relatively silently) doesn't make the Fortran bindings.
My modified version is enclosed below.
hm, seems like your cfortran.h is identical with the mint cfortran.h
supplied with netcdf-3.5. :-(
cheers
magi
Since I am posting here I may as well post an issue as well.
Following my configs for Lahey F95 5.5 was never an issue, but then I
upgraded to 6.0c. Now if I use my configs I get:
gcc -c -O -I../libsrc -DNDEBUG -DpgiFortran fort-attio.c
In file included from fort-attio.c:6:
ncfortran.h:27:42: NF_INT_IS_C_... not defined: No such file or directory
Which is a direct result of:
checking if Fortran "integer*2" is C "short"... no
checking if Fortran "integer*2" is C "int"... no
checking if Fortran "integer*2" is C "long"... no
checking if Fortran "integer" is C "int"... no
checking if Fortran "integer" is C "long"... no
during configure. This was not an issue with LF95 5.5 of course.
Something has changed with LF95 6.0 <shrug>. I have as yet to
contact Lahey on the matter as they tend to be uninterested in these
matters saying it probably is the libraries. Our work around is to
compile the libs with g77 as LF95 6.0 can build directly with them
w/o needing -ml cdecl:
http://www.cwr.uwa.edu.au/~slawinski/work/netcdfinfo.html#linux
I have spent (wasted?) many a fine day viing into binary library
files last year getting NetCDF (f77 hooks) to work with Lahey. Of
course Lahey was less than helpful on the matter. Suffice it to say
that I was rather upset last week myself when I could no longer get
the libs to compile. I have yet to find a work around for the f90
issue as g77 does not support(+/-) f90 and lf95 gives:
checking for Fortran .F compiler...
checking if Fortran-77 compiler handles *.F files... yes
checking "lf95" as Fortran-90 compiler... failed to build executable program
checking for xlf90... no
checking for f90... no
to boot! However:
setenv F90 lf95
gets rid of that, but one still gets the "integer" issue. Any ideas
suggestions or am I going to have to traverse the
configure-make-library path again <cringe>.
-------------
Magnus Hagdorn
Department of Geology and Geophysics
The University of Edinburgh
Grant Institute
West Mains Road
Edinburgh EH9 3JW
Scotland
PHONE: (+44) 131 650 5918
FAX: (+44) 131 668 3184
email: Magnus.Hagdorn@xxxxxxxxxxxx
--
---
TTFN Dirk =:>
/--------------------------------------------------------------\
| Dirk Slawinski | The Centre for Water Research |
| Research Associate | University of Western Australia |
| |
| PHONE: +61 8 9380 2410 ,-_|\ |
| FAX: +61 8 9380 1015 (Perth) / \ ]] |
| EMAIL: slawinski@xxxxxxxxxxxxxx *_,-._/ d") |
| WEB: http://www.cwr.uwa.edu.au/~slawinski/ v _(@)_ |
\--------------------------------------------------------------/