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

[netCDF #AXE-832194]: libnetcdf4 not linked with -lm



> Fedora has become much stricter about linking with needed libraries.  As a
> result, netcdf-4.1.2-beta1 fails to compile with:
> 
> /bin/sh ../libtool --tag=CC   --mode=link cc  -O2 -g -pipe -Wall
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m64 -mtune=generic -lhdf5_hl -lhdf5 -lz -lcurl
> -o tst_h_files tst_h_files.o stub4.lo ../libsrc4/libnetcdf4.la
> ../libsrc/libnetcdf3.la ../libdispatch/libdispatch.la ../oc/liboc.la
> ../libdispatch/libnetcdf2.la   -lhdf5_hl -lhdf5 -lz
> libtool: link: cc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -o tst_h_files
> tst_h_files.o .libs/stub4.o  ../libsrc4/.libs/libnetcdf4.a
> ../libsrc/.libs/libnetcdf3.a ../libdispatch/.libs/libdispatch.a
> ../oc/.libs/liboc.a -lcurl ../libdispatch/.libs/libnetcdf2.a -lhdf5_hl -lhdf5 
> -lz
> /usr/bin/ld: ../libsrc4/.libs/libnetcdf4.a(nc4var.o): undefined reference to
> symbol 'pow@@GLIBC_2.2.5'
> /usr/bin/ld: note: 'pow@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so
> try adding it to the linker command line
> 
> Adding -lm to the libnetcdf4.a link line does indeed fix the issue.
> 
> --
> Orion Poplawski
> Technical Manager                     303-415-9701 x222
> NWRA/CoRA Division                    FAX: 303-415-9702
> 3380 Mitchell Lane                  address@hidden
> Boulder, CO 80301              http://www.cora.nwra.com
> 
> 

Thanks Orion!

I have added that. It should be in the snapshot tonight.

You should probably use the snapshot for any future testing, as it has quite a 
few fixes since beta1. 
ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz

Ed

Ticket Details
===================
Ticket ID: AXE-832194
Department: Support netCDF
Priority: Normal
Status: Closed