automake
[Top][All Lists]
Advanced

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

how to link other libraries to *my* library...


From: Ed Hartnett
Subject: how to link other libraries to *my* library...
Date: Fri, 13 Nov 2009 09:14:24 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Howdy all!

I am a programmer for netcdf, a set of free software libraries in C,
C++, F77, and F90 for array-oriented access to scientific data. NetCDF
is widely used in the Earth sciences and climate research.

The netCDF C library uses other libraries, for example the hdf5,
hdf5_hl, and zlib libraries. I was building the library without
explicitly linking to these other libraries, assuming that libtool would
magically handle this.

But apparently not. One of my users complained, and now I have the
following code in my Makefile.am:

if USE_HDF4
LDADD += -lmfhdf -ldf -ljpeg
libnetcdf_la_LIBADD += -lmfhdf -ldf -ljpeg 
endif # USE_HDF4

if USE_SZIP
libnetcdf_la_LIBADD +=  -lsz
endif # USE_SZIP

LDADD += -lhdf5_hl -lhdf5 -lz 

if USE_PNETCDF
LDADD += -lpnetcdf
libnetcdf_la_LIBADD += -lpnetcdf
endif

Is there a better way to do this?

Thanks,

Ed
-- 
Ed Hartnett  -- address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]