Re: [netcdfgroup] Building Fortran NetCDF only ?

Olivier Marti <olivier.marti@xxxxxxxxxxxx> writes:

> Hi,
>
> Is it possible to build the NetCDF fortran *only* ?
>
> -> Plateform info : Mac OS X 10.6.4, gfortran compiler  4.1.2. NetCDF 4.1.1
>
> On my computer, I have a working NetCDF 4.1.1 with C and C++ interface only. 
> I've installed it using MacPorts (which put it in /opt/local).
>
> I want to use NetCDF in Fortran 90, so I need to build NetCDF from the 
> source. But I want to avoid to have two libnetcf.a on my computer. I try to 
> build ONLY the fortran interface, building only libnetcdff (note the 2 f ..). 
> My hope is to be able to compile a fortran program using libnetcdf from 
> MacPorts and libnetcdff from my own install.
>
> I've tried : ./configure --enable-netcdf-4 --disable-c --disable-cxx 
> --disable-v2 --with-netcdf-c=/opt/local --with-netcdf-c-lib=/opt/local 
> --enable-separate-fortran --enable-dap --enable-ncgen4 --with-libcf 
> --with-hdf5=/opt/local --with-zlib=/opt/local --with-szlib=/opt/local 
> --prefix=/usr/softs --enable-docs-install
>
> But when compiling, the makefile want to access to ../libsrc4/libnetcdf.la 
> and ../../libsrc4/libnetcdf.la where I want to use /opt/local/lib/libnetcdf.la
>
> I've made some progress using : make 
> libnetcdff_la_LIBADD=/opt/local/lib/libnetcdf.la
> But this library is referenced in some files that it doesn't seem to be a 
> good solution
>
> It creates a libnetcff.a library with fortran interface routine (NF_*) but no 
> F90 interface.
>
> Any hint ?
>
> Olivier

No, you should no do that!

The easiest thing to do is rebuild 4.1.1, with fortran enabled, and then
reinstall in the same location. 

Thanks,

Ed
-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: