This OpenMP library finding code is from ImageMagick's configure.ac http://bugs.gentoo.org/314095 --- a/configure.in +++ b/configure.in @@ -44,6 +44,20 @@ CFLAGS="$CFLAGS $OPENMP_CFLAGS" CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" +dnl Find OpenMP library +GOMP_LIBS='' +if test "$enable_openmp" != 'no'; then + if test "${GCC}" = "yes"; then + AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,) # gcc + else + AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,) # solaris cc + AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,) # AIX xlc + AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,) # SGI IRIX 6.5 MIPSpro C/C++ + fi + LIBS="$GOMP_LIBS $LIBS" +fi +AC_SUBST(GOMP_LIBS) + dnl files to be generated AC_OUTPUT(Makefile inc/Makefile inc/Minuit2/Makefile inc/Math/Makefile src/Makefile doc/Doxyfile doc/Makefile test/Makefile test/MnSim/Makefile --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,6 +9,8 @@ # The convenience library to be built. lib_LTLIBRARIES = libMinuit2.la +libMinuit2_la_LIBADD = $(GOMP_LIBS) + libMinuit2_la_SOURCES = \ AnalyticalGradientCalculator.cxx \ BasicMinimumError.cxx \