This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

autoconfig and gsl.m4


Hello everybody!

I'd like to setup a configure script with autoconf and tried to use the
actual (Version 0.7) gsl.m4 macro.

These are the lines from configure.in:

dnl Process this file with autoconf to produce a configure script.

AC_INIT(smap_classify.c)
SUBDIRS="dirty.lib"
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(hmmlib,0.1)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(DOCXX,doc++)
AC_PATH_PROG(LATEX,latex)
AC_PATH_PROG(DVIPS,dvips)
AM_PATH_GSL(0.7)
dnl aborts, if not found
dnl AM_PATH_GSL(0.7,,AC_MSG_ERROR("GSL Version 0.7 or higher required."))

dnl Checks for libraries.
AC_CHECK_LIB(m, fabs)
AC_CHECK_LIB(pthread, pthread_join)

dnl and so on....

AC_OUTPUT(Makefile dirty.lib/Makefile)

dnl end

That's the result of configure:

checking for rm... /zpr/gnu/bin/rm
checking for doc++... /homes/achim/install/bin/doc++
checking for latex... /zpr/tex/bin/latex
checking for dvips... /zpr/tex/bin/dvips
checking for gsl-config... /zpr/gnu/bin/gsl-config
checking for GSL - version >= 0.7... yes
checking for fabs in -lm... no
checking for pthread_join in -lpthread... no

and so on...

The last two lines of output are my problem. There is a math library and
there is pthread support. If I remove the gsl macro, they are recognized.

Just take a look in config.log:

configure:1193: checking for latex
configure:1228: checking for dvips
configure:1302: checking for gsl-config
configure:1337: checking for GSL - version >= 0.7
configure:1435: gcc -o conftest -g -O2 -g -O2 -I/zpr/gnu/include
conftest.c  -L/zpr/gnu/lib -lgsl -lm -lgslblas 1>&5
configure:1514: checking for fabs in -lm
configure:1533: gcc -o conftest -g -O2   conftest.c -lm   -lgslblas 1>&5
configure:1526: warning: conflicting types for built-in function `fabs'
Undefined                       first referenced
 symbol                             in file
gsl_error                           /zpr/gnu/lib/libgslblas.so
ld: fatal: Symbol referencing errors. No output written to conftest
configure: failed program was:
#line 1522 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fabs();

int main() {
fabs()
; return 0; }
configure:1580:checking for ANSI C header files... no
configure:1561: checking for pthread_join in -lpthread
configure:1580: gcc -o conftest -g -O2   conftest.c -lpthread   -lgslblas
1>&5
Undefined                       first referenced
 symbol                             in file
gsl_error                           /zpr/gnu/lib/libgslblas.so
ld: fatal: Symbol referencing errors. No output written to conftest
configure: failed program was:
#line 1569 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char pthread_join();

int main() {
pthread_join()
; return 0; }

The reason for failing tests is the last argument of $LIBS in
configure:1533 and configure:1580:
-lgslblas

This option is set in the macro AM_PATH_GSL.

There are some lines in gsl.m4 like:
          LIBS="$ac_save_LIBS -lgslblas"

They should restore the LIBS variable as it was before the test.

I think this is the reason, why all other tests fail.

The crucial question for a good solution is:

When is the blas Library chosen?

Maybe it is good to choose it with an option in the configure macro and it
is helpful to set a default value at buildtime, that can be retrived by
gsl-config.

Another problem is the backward compartibility with gsl-0.6
(gslblasnative)....

I'd like to hear your opinions.

Achim

Achim Gaedke, ZPR
Weyertal 80, 50931 Köln
Tel: +49 221 470 6021


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]