[Top][All Lists]

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

autoconf, Fortran, LAPACK, and AC_SEARCH_LIBS

From: David A. Ventimiglia
Subject: autoconf, Fortran, LAPACK, and AC_SEARCH_LIBS
Date: Tue, 24 Mar 2009 15:54:56 -0700


I have a Fortran program that uses LAPACK.  Since LAPACK can come from 
different vendors depending on the platform, 
and be in different locations (e.g., /usr/lib/liblapack.a with the reference 
implementation, or in mkl_lapack.a in 
the Intel compiler tree when using the Intel compiler), I want to use autoconf 
to make by build process agnostic about this. 
How do I accomplish this?

I thought I'd put this in my file:

                AC_SEARCH_LIBS([sgetrf], [lapack mkl_lapack])

'sgetrf' is a subroutine in LAPACK.

After I run aclocal ; autoconf ; automake ; ./configure, among the output is 

                checking for library containing sgetrf... no 

And in the config.log file (attached), there's this:

                configure:3968: checking for library containing sgetrf          
                configure:4009: gcc -o conftest -g -O2   conftest.c >&5         
                /tmp/cckOOIRY.o: In function `main':                            
                /home/dventimi/work/cosmosurfo/conftest.c:21: undefined 
reference to `sgetrf'                                                           
                collect2: ld returned 1 exit status                             
                configure:4015: $? = 1                                          

Evidently, to find a library file that supports the test subprogram 'sgetrf', 
it tries to compile and link a test
program that calls 'sgetrf', but it comes back with 'undefined reference'.

Perhaps this is a consequence of using autoconf to search for Fortran libraries 
(like LAPACK).  But either way, how is one
supposed to do this?  Thanks!


Attachment: config.log
Description: Text Data

reply via email to

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