Magnus Hagdorn <Magnus.Hagdorn@xxxxxxxx> writes:
> On Wed, 2009-09-23 at 17:36 +0200, Francesco Paolo Lovergine wrote:
>> I'm currently trying to move forward Debian support of netcdf from
>> 3.6.3
>> to 4.0.1 (and possibly 4.1beta ASAP). Of course, I'm using gfortran
>> 4.3.3
>> (and possibly 4.4 for next release). Things go ok, but for Fortran
>> check,
>> which fails miserably due to linking problems. Note that I added
>> -DgFortran
>> explicitly at configure time. I'm not a Fortran guy, but I noted that
>> all named functions are tagged as undefined in the named solibs: it
>> seems
>> they are linked as external instead of being wrapped to C functions.
>> Any hints?
>
> Hi Francesco,
> it works for me on sid. I configured netCDF with
>
> ./configure FC=gfortran F77=gfortran --enable-separate-fortran
> --enable-shared
Howdy all!
In general, it's best to try building netcdf without setting any such
flags as -DgFortran. The netcdf configure script will choose the
appropriate flag for your fortran compiler (if it can).
If it can't, then the easiest way to proceed is try -Df2cFortran,
-DpgiFortran, and (if you are using gfortran) -DgFortran. (Make sure
that you do a make distclean between each attempt.) This is lazy but
effective, as most fortran compilers work with netcdf with -Df2cFortran
or -DpgiFortran.
I will also point out that --enable-separate-fortran is a redundant
option when shared libraries are built - shared builds will always built
with separate fortran libraries. Only static builds will go with the
netCDF oddity of putting the C and F77 libraries in the same library
file.
Thanks,
Ed
--
Ed Hartnett -- ed@xxxxxxxxxxxxxxxx