[Top][All Lists]

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

Re: autoconf, Fortran, LAPACK, and AC_SEARCH_LIBS

From: John W. Eaton
Subject: Re: autoconf, Fortran, LAPACK, and AC_SEARCH_LIBS
Date: Tue, 24 Mar 2009 21:06:24 -0400

On 24-Mar-2009, David A. Ventimiglia wrote:

| I think I solved one of my problems.  Evidently, there's an Autoconf
| macro AC_LANG.  By adding AC_LANG(Fortran) to my file, it
| ensures that test programs are written in Fortran rather than in C, and
| that seems sufficient to find sgetrf in liblapack.
| Now, onto the next issue!  Which is this:
| The reference implementation of LAPACK is relatively simple. I just have
| to link my application using -llapack, and it works.
| The Intel MKL implementation is in pieces, with dependencies.  On a
| 64-bit platform, I have to link using -lmkl_lapack -lmkl_em64t -lguide
| -lpthread.  
| First, how do I get the AC_SEARCH_LIBS([sgetrf],[lapack mkl_lapack])
| test to work?  After all, in order to work, the test program that
| AC_SEARCH_LIBS writes would have also to link to mkl_em64t, guide, and
| pthread, otherwise it gets 'undefined reference' to functions in those
| files, the link step fails, and it concludes that it has not found
| sgetrf (which is in mkl_lapack).
| Second, how do I pass all this information onto the generated Makefile?
| After all, when using the reference lapack, I want only -llapack in the
| link line.  When using Intel MKL, I want -lmkl_lapack -lmkl_em64t
| -lguide -lpthread.

I recommend using the acx_blas and acx_lapack macros from the Autoconf
macro archive:

Direct links to the macros you'll need:

But although the macros from the archive try to find blas functions in
-lmkl, they don't seem to know about the other libraries you mention.
If those are actually needed, then maybe it would be good if you could
contribute fixes for the existing macros.


reply via email to

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