autoconf test for dgemm_ in libblas fails

Asked by Nicolas Bock

Using the following configure.ac:

AC_INIT([testpackage], [1.0], [email])
AC_SEARCH_LIBS([dgemm_], [], [], [AC_MSG_FAILURE([no])])
AC_OUTPUT

./configure LDFLAGS=-lblas

fails with this error (from config.log):

configure:2579: gcc -o conftest -g -O2 -lblas conftest.c >&5
/tmp/ccXCG4m3.o: In function `main':
/tmp/autoconf/conftest.c:20: undefined reference to `dgemm_'
collect2: ld returned 1 exit status
configure:2579: $? = 1

When I run

gcc -o conftest -g -O2 conftest.c -lblas

directly instead, I do not get a linker error. There appears to be a positional dependence of the source in relation to -lblas.

This test works fine on a gentoo system with identical compiler versions. Please let me know if and what additional information you need.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gcc-defaults Edit question
Assignee:
No assignee Edit question
Solved by:
Nicolas Bock
Solved:
Last query:
Last reply:
Revision history for this message
Nicolas Bock (nicolasbock) said :
#1

The problem is solved if I run configure this way:

./configure LIBS=-lblas