autoconf
[Top][All Lists]
Advanced

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

AC_SEARCH_LIBS and fortran


From: JoeOutflow
Subject: AC_SEARCH_LIBS and fortran
Date: Fri, 14 Mar 2008 19:57:06 -0700 (PDT)

hi there,

I have a little fortran test function that I'm trying to apply autotools to
as a means of figuring out how
to construct a configure.ac file that will be able to find the hdf5 library
(used by the test program.)
In my configure.ac file I have
"AC_SEARCH_LIBS(h5open_f,hdf5_fortran,[],[],-lhdf5_hl -lhdf5 -lz).
I simply want the configure script to be able to successfully search for the
function and carry out its default action of appending a flag to LIBS. But
I'm identifying some problems....

I have studied the config.log file to see what test program configure tries
to compile and how it tries to compile it, and here are the problems as I
see them:

first, although the compiler command correctly  includes the required -l
flags along with their library names and in the right order, there is no -L
flag instructing the compiler where to look for the libraries. As I
understand it the -L flags should be contained in the LDFLAGS variable, but
this is blank in the Makefiles. According to the manual LDFLAGS is a preset
output variable and a search for "LDFLAGS" through the entire manual fails
to turn up any explanation of how to append a library directory to LDFLAGS.
Assigning it directly in configure.ac makes autoconf complain. 


Secondly the test program that configure attempts to compile is bound to
fail even if all the "-L's" and "-l's" are exactly correct in the
compile/link commands. This is because a number of necessary lines are
missing from it. configure tries to compile:

program test
call h5open_f
end program test

but at minimum it must contain:

program test
use hdf5
integer :: i
call h5open_f(i)
end program test


Can this be arranged? If there was a subroutine in the library that didn't
require an argument I'd have used it instead, but there isn't and even so
there is still the need for the "use hdf5" statement. Is there any help out
there for me? I'll attach the relevant files here.
http://www.nabble.com/file/p16064029/test.tar.gz test.tar.gz  Thanks very
much in advance.

Tim



-- 
View this message in context: 
http://www.nabble.com/AC_SEARCH_LIBS-and-fortran-tp16064029p16064029.html
Sent from the Gnu - Autoconf - General mailing list archive at Nabble.com.





reply via email to

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