[Top][All Lists]

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

Re: question about using AC_SEARCH_LIBS with fortran...

From: Ed Hartnett
Subject: Re: question about using AC_SEARCH_LIBS with fortran...
Date: Wed, 02 Dec 2009 10:41:08 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

Howdy Ralf!

Before I continue asking questions about my fortran AC_SEARCH_LIBS
question, let me first make sure I've got it correct for my C library,
because I just recently realized that I've been doing it wrong for

In my libcf file I have added the following:

AC_SEARCH_LIBS([deflate], [z])
AC_SEARCH_LIBS([ceil], [m])
AC_SEARCH_LIBS([H5open], [hdf5])
AC_SEARCH_LIBS([H5DSattach_scale], [hdf5_hl])
AC_SEARCH_LIBS([Curl_cfree], [curl])
AC_SEARCH_LIBS([nc_open], [netcdf])

This finds all the correct libraries in the correct order, and helpfully
adds them to the LIBS variable, so that I don't have to have things like
this in my makefile:

LDADD += -lhdf5_hl -lhdf5 -lz 

This is wonderful, but how does the user pass in a special directory
that may include his HDF5 library? With the CPPFLAGS and LDFLAGS,

Meanwhile I support in my configure script a way to specify a location
for HDF5:

# Did the user specify a location for the HDF5 library?
AC_MSG_CHECKING([whether a location for the HDF5 library was specified])
                              [Specify location of HDF5 library. Configure will 
expect \
                              to find subdirs include and lib.])],

What I have been doing is handling all this in my files. But
that will go away under the new (to me) system of using AC_SEARCH_LIBS

But how to get the user's --with-hdf5=/somewhere option into the list of
directories searched by AC_SEARCH_LIBS? Do I modify CPPFLAGS and LDFLAGS
before calling AC_SEARCH_LIBS in my Or is there some other
way to tell AC_SEARCH_LIBS to add another directory to search for the


Ed Hartnett  -- address@hidden

reply via email to

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