Commit 203a013d13a90f29b46252aa234f3af31828257d

Authored by Jürgen Knödlseder
1 parent 99d95816

Correct test if library can be dlopen()ed.

The test for dlopen()ing libgomp.so.1 failed because for some reason the test code did not find the GammaLib shared library. I'm not sure why this happened.

To make the test work, the LIBS variable is now set explicitely to the library we need for the test (-ldl), excluding the GammaLib shared library. This allows the test to suceed.
Showing 1 changed file with 4 additions and 4 deletions
configure.ac
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 ############################################################################# 29 #############################################################################
30 # Initialisation # 30 # Initialisation #
31 ############################################################################# 31 #############################################################################
32 -AC_INIT([ctools], [0.5.1], [jurgen.knodlseder@irap.omp.eu], [ctools]) 32 +AC_INIT([ctools], [0.5.2], [jurgen.knodlseder@irap.omp.eu], [ctools])
33 AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp]) 33 AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp])
34 AC_CONFIG_MACRO_DIR([m4]) 34 AC_CONFIG_MACRO_DIR([m4])
35 AM_INIT_AUTOMAKE([gnu no-dependencies]) 35 AM_INIT_AUTOMAKE([gnu no-dependencies])
@@ -763,8 +763,8 @@ if test "x$openmp_ok" = "xyes"; then @@ -763,8 +763,8 @@ if test "x$openmp_ok" = "xyes"; then
763 # dynamically 763 # dynamically
764 if test "$OPENMP_CXXFLAGS" = "-fopenmp" -a "$ac_sys_system" = "Linux"; then 764 if test "$OPENMP_CXXFLAGS" = "-fopenmp" -a "$ac_sys_system" = "Linux"; then
765 AC_MSG_CHECKING(whether we can dynamically load libgomp) 765 AC_MSG_CHECKING(whether we can dynamically load libgomp)
766 - SAVED_LDFLAGS=$LDFLAGS  
767 - LDFLAGS="$LDFLAGS -ldl" 766 + SAVED_LIBS=$LIBS
  767 + LIBS="-ldl"
768 AC_TRY_RUN(AC_LANG_PROGRAM([#include <dlfcn.h>], 768 AC_TRY_RUN(AC_LANG_PROGRAM([#include <dlfcn.h>],
769 [if (dlopen("libgomp.so.1", RTLD_NOW) == 0) return 1;]), 769 [if (dlopen("libgomp.so.1", RTLD_NOW) == 0) return 1;]),
770 [AC_MSG_RESULT(yes)], 770 [AC_MSG_RESULT(yes)],
@@ -772,7 +772,7 @@ if test &quot;x$openmp_ok&quot; = &quot;xyes&quot;; then @@ -772,7 +772,7 @@ if test &quot;x$openmp_ok&quot; = &quot;xyes&quot;; then
772 AC_MSG_RESULT(no) 772 AC_MSG_RESULT(no)
773 AC_MSG_WARN([OpenMP detected but shared libgomp.so.1 library cannot be dlopen()ed.]) 773 AC_MSG_WARN([OpenMP detected but shared libgomp.so.1 library cannot be dlopen()ed.])
774 AC_MSG_WARN([If you use a gcc 4.2.x compiler, this is a known feature. Try to use gcc >= 4.3.])]) 774 AC_MSG_WARN([If you use a gcc 4.2.x compiler, this is a known feature. Try to use gcc >= 4.3.])])
775 - LDFLAGS=$SAVED_LDFLAGS 775 + LIBS=$SAVED_LIBS
776 fi 776 fi
777 777
778 # Special Darwin test to see whether OpenMP compiles without adding the 778 # Special Darwin test to see whether OpenMP compiles without adding the