[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #QVX-141521]: Seemed to install but isn't linking well
- Subject: [netCDF #QVX-141521]: Seemed to install but isn't linking well
- Date: Tue, 07 Jun 2016 10:50:31 -0600
Hello Judy,
I think I see what's going on; you are passing the core C library to the linker
via `-lnetcdf`, but you also need to link against the Fortran interface
library, via `-lnetcdff`. Try adding `-lnetcdff` to the end of your gfortran
invocation, and let me know if the issue persists!
Thanks, I hope this helps, have a great day,
-Ward
> Full Name: Judy Gaukel
> Email Address: address@hidden
> Organization: Scripps Institution of Oceanography
> Package Version: Fortran 4.5.0-development
> Operating System: CentOS
> Hardware: x86
> Description of problem: $gfortran -I/usr/local/netcdf-fortran/fortran -o
> test test.f -L/usr/local/lib -lnetcdf
> /tmp/cchTr4fh.o: In function `MAIN__':
> test.f:(.text+0x104): undefined reference to `nccre_'
> test.f:(.text+0x11f): undefined reference to `ncendf_'
> test.f:(.text+0x137): undefined reference to `ncclos_'
> collect2: error: ld returned 1 exit status
> ls /usr/local/netcdf-fortran/fortran -- has netcdf.inc and netcdf.mod (and
> all that other stuff)...
> ls /usr/local/lib has
> libnetcdff.a libnetcdff.la libnetcdff.so libnetcdff.so.6
> libnetcdff.so.6.1.1 libnetcdf.so libnetcdf.so.11 libnetcdf.so.11.2.0
> pkgconfig
>
> So I am baffled - why doesn't it seem to compile?
>
>
>
Ticket Details
===================
Ticket ID: QVX-141521
Department: Support netCDF
Priority: Normal
Status: Closed