[Top][All Lists]

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

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

From: Philip Herron
Subject: Re: how to link other libraries to *my* library...
Date: Fri, 13 Nov 2009 16:29:10 +0000


Autoconf is what should handle your libraries etc:

    [With GNU MP and MPFR multi-precision support, default no.])],
if test "x$bignum" == "xyes"; then
  AC_CHECK_LIB([gmp], [__gmpz_init], ,
    [AC_MSG_ERROR([GNU MP not found, see])])
  AC_CHECK_LIB([mpfr],[mpfr_init] , ,
    [AC_MSG_ERROR([MPFR not found, see])])
  AC_DEFINE([CONFIG_BIGNUM], 1, [Bignum multi-percision support])
  AC_CHECK_SIZEOF(mp_limb_t, , [#include <gmp.h>])

I use MPFR and GMP in one of my projects well its optional, but what
you should have in your is the tests for the libraries
and the features your need on the system so what your interested is:

AC_CHECK_LIB([gmp], [__gmpz_init], ,
    [AC_MSG_ERROR([GNU MP not found, see])])

'gmp' from the -lgmp flag to the compiler the '__gmpz_init' symbol,
something i cant remember what to do on success i think and what to do
on failure. When your testing for all these features and libraries
autoconf handles all this so you should have anything in your but your bin_PROGRAMS=... etc.. Hope this helps.


2009/11/13 Ed Hartnett <address@hidden>:
> 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
> if USE_HDF4
> LDADD += -lmfhdf -ldf -ljpeg
> libnetcdf_la_LIBADD += -lmfhdf -ldf -ljpeg
> endif # USE_HDF4
> libnetcdf_la_LIBADD +=  -lsz
> endif # USE_SZIP
> LDADD += -lhdf5_hl -lhdf5 -lz
> 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]