[Top][All Lists]

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

Re: AC_CHECK_LIB fails

From: Ralf Wildenhues
Subject: Re: AC_CHECK_LIB fails
Date: Wed, 2 Apr 2008 21:35:21 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)


* aaragon wrote on Sat, Mar 29, 2008 at 10:22:43PM CET:
> I'm trying to create a test for a library that I use in my code but the
> AC_CHECK_LIB failed in all my attempts. The library is not installed in the
> standard path so I give the configure command the necessary parameters:
> ./configure CXX=g++-mp-4.3 CXXFLAGS="-I$HOME/Lib/SuperLU"
> LDFLAGS="-L$HOME/Lib/SuperLU" LIBS="$HOME/Lib/SuperLU/libblas.a
> -lsuperlu_3.0"
> In the file, I have:
> AC_CHECK_LIB([superlu],[_dCreate_CompCol_Matrix],,[echo "ERROR: SuperLU
> library not found." && exit 1])
> I know that the symbol is correct, since in the directory where the library
> is located (-I$HOME/Lib/SuperLU), I checked:
> address@hidden/Lib/SuperLU$strings libsuperlu_3.0.a | grep -i dcreate
> _dCreate_CompCol_Matrix
> _dCreate_CompRow_Matrix
> _dCreate_Dense_Matrix
> _dCreate_SuperNode_Matrix

FWIW, a better way to check for exported symbols is to use nm instead of
strings, and check for nonstatic symbols.

> Now, the name of the library in that directory is libsuperlu_3.0. So instead
> of superlu (as it is supposed to be from the Autoconf manual), I have tried
> superlu_3, superlu_3.0, libsuperlu, libsuperlu_3 and libsuperlu_3.0.
> All the tests have failed. Can someone point out what am I doing wrong?

What system are you on?  Maybe you need to get rid of the leading
underscore in the name?  Also, please use AS_MSG_ERROR or AS_ERROR,
as 'exit 1' may not actually exit the script with an error status
with some shells:

  AC_CHECK_LIB([superlu], [dCreate_CompCol_Matrix],,
               [AS_MSG_ERROR([SuperLU library not found])])


reply via email to

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