Commit 5cf03ab8c6e93fa5b0815734e75c30247fdc8b13

Authored by Jürgen Knödlseder
1 parent 423453b6

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 3 additions and 3 deletions
configure.ac
... ... @@ -763,8 +763,8 @@ if test "x$openmp_ok" = "xyes"; then
763 763 # dynamically
764 764 if test "$OPENMP_CXXFLAGS" = "-fopenmp" -a "$ac_sys_system" = "Linux"; then
765 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 768 AC_TRY_RUN(AC_LANG_PROGRAM([#include <dlfcn.h>],
769 769 [if (dlopen("libgomp.so.1", RTLD_NOW) == 0) return 1;]),
770 770 [AC_MSG_RESULT(yes)],
... ... @@ -772,7 +772,7 @@ if test &quot;x$openmp_ok&quot; = &quot;xyes&quot;; then
772 772 AC_MSG_RESULT(no)
773 773 AC_MSG_WARN([OpenMP detected but shared libgomp.so.1 library cannot be dlopen()ed.])
774 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 776 fi
777 777  
778 778 # Special Darwin test to see whether OpenMP compiles without adding the
... ...