autoconf
[Top][All Lists]
Advanced

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

Short question


From: Alan Aspuru-Guzik
Subject: Short question
Date: Thu, 21 Mar 2002 16:13:24 -0800 (PST)

Hi, 

I am really a newbie with autoconf/automake/libtool, etc. and I am
trying to make my scientific package 'kosher', Ie. to use the toolchain
for my program to compile from Linux PC's to supercomputers. 

I have a specific question that I don't know how to handle?

I have a fortran library that I created (not yet autoconfiscated!) that is
called liborbitals, it requires a liborbitals.a installed in the library
directory (which in this case can be $HOME/$SYS_TYPE/lib for example) and
orbitals.h in $HOME/$SYS_TYPE/include.

For linking that library with my autoconfiscated C program, I created a
simple macro that doesn't work as expected that looks like:

AC_CHECK_LIB(orbitals, init_, ORBITALS_LIBS=-lorbitals,
[AC_CHECK_HEADER(orbitals.h, , AC_MSG_ERROR([[ Couldn't find
liborbitals! You have to compile it manually under the src/fortran
directory, copy liborbitals.a to your library directory and copy
orbitals.h to your header directory.]]))])
AC_SUBST(ORBITALS_LIBS)

The problem is that when I run configure, I get the error:
checking for init_ in -lorbitals... no
checking orbitals.h usability... no
checking orbitals.h presence... no

Looking at config.log:

configure:7280: gcc -o conftest -g -O2   conftest.c -lorbitals   >&5
/usr/bin/ld: cannot find -lorbitals

Now, this is the case, because in this particular system (Linux-Alpha), I
need to use the following compilation line:

gcc -L$HOME/$SYS_TYPE/lib -o conftest -g -O2 program.c -lorbitals
 -lcxml

How can I create a macro that does the following? 
a) Accept a parameter for using my personal lib library directories when
checking for installed libraries
b) Knows that when I am in linux alpha, I need to add the -lcxml to the
compilation line, and then appropiately exports
ORBITALS_LIBS to -lorbitals -lcxml when in Linux-alpha, and -lorbitals
otherwise?


For both a) and b) I have tried all sorts of things that have led me
nowhere. 

I am trying to learn from the autobook, and the AC archive,
http://www.gnu.org/software/ac-archive/

But the macros seem too intricate...

Thanks in advance for any help,

Alan Aspuru-Guzik 




reply via email to

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