Commit 097d9165249ae39045d97d5c4db19058a45e58a0

Authored by Jürgen Knödlseder
1 parent 1e20fe60

Add OPENMP_LIB_LDFLAGS for OpenMP support on Mac OS X.

For OpenMP to work properly on Mac OS X, the -lgomp library has to be linked. For this purpose, a new variable OPENMP_LIB_LDFLAGS has been created that is set by configure to -lgomp in the presence of OpenMP support.

The ctobssim Makefile.am has been modified to take this parameter into account during linking.
configure.ac
... ... @@ -734,6 +734,19 @@ else
734 734 AC_MSG_RESULT(no)
735 735 fi
736 736  
  737 +# Set system specific settings
  738 +OPENMP_LIB_LDFLAGS=
  739 +if test "x$enable_openmp" = "xyes"; then
  740 + case $ac_sys_system/$ac_sys_release in
  741 + Darwin/*)
  742 + #
  743 + #
  744 + OPENMP_LIB_LDFLAGS=-lgomp
  745 + ;;
  746 + esac
  747 +fi
  748 +AC_SUBST(OPENMP_LIB_LDFLAGS)
  749 +
737 750 # Signal if ctools cannot be compiled as gammalibe requires OpenMP but ctools
738 751 # cannot be compiled with OpenMP
739 752 if test "x$enable_openmp" = "xno" && test "x$gammalib_with_openmp" = "xyes"; then
... ...
src/ctobssim/Makefile.am
... ... @@ -9,6 +9,7 @@ sources = ctobssim.cpp
9 9 # Libtool library
10 10 noinst_LTLIBRARIES = libctobssim.la
11 11 libctobssim_la_SOURCES = $(sources)
  12 +libctobssim_la_LDFLAGS = @OPENMP_LIB_LDFLAGS@
12 13  
13 14 # Program definition
14 15 ctobssim_SOURCES = main.cpp
... ...