From 19dee34c227a774f4373f2ae1f7e15b1744e3766 Mon Sep 17 00:00:00 2001 From: nemu Date: Wed, 23 Dec 2009 13:28:49 +0000 Subject: [PATCH] Workaround for a problem with FFTW3 threads in some external plugins... needs to be really fixed at some point. --- configure.ac | 34 +++++++++++++++++-- src/external/TFitPofB-lib/classes/Makefile.am | 2 +- src/external/libLFRelaxation/Makefile.am | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index b326e346..c73f374e 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ MUD_MINOR_VERSION=0 MUD_MICRO_VERSION=0 #release versioning -PLUGIN_MAJOR_VERSION=0 +PLUGIN_MAJOR_VERSION=1 PLUGIN_MINOR_VERSION=0 PLUGIN_MICRO_VERSION=0 @@ -180,7 +180,6 @@ fi AC_SUBST(FFTW3_LIBS) AC_SUBST(FFTW3_CFLAGS) - dnl ----------------------------------------------- dnl Ask user for path to gsl dnl ----------------------------------------------- @@ -332,6 +331,37 @@ AC_ARG_ENABLE([BMWlibs], [AC_HELP_STRING([--enable-BMWlibs],[build optional BMW fi AC_SUBST(CUBA_LIBS) AC_SUBST(CUBA_CFLAGS) + + # Since it is not clear to me, how to use the AC_SEARCH_LIBS macro correctly, I introduce a primitive file check here... + FFTW3_THREADS_LIBS=$(echo ${FFTW3_LIBS} | grep "lfftw3_threads") + if test "$FFTW3_THREADS_LIBS" == ""; then + if [test -r ${FFTW3_PREFIX}/lib/libfftw3_threads.a || test -r ${FFTW3_PREFIX}/lib/libfftw3_threads.so || \ + test -r ${FFTW3_PREFIX}/lib/libfftw3_threads.dll.a || test -r ${FFTW3_PREFIX}/lib/libfftw3_threads.dll || \ + test -r ${FFTW3_PREFIX}/lib/libfftw3_threads.dylib]; then + AC_MSG_RESULT([FFTW3 threads library found... OK]) + elif [test -r /usr/local/lib/libfftw3_threads.a || test -r /usr/local/lib/libfftw3_threads.so || \ + test -r /usr/local/lib/libfftw3_threads.dll.a || test -r /usr/local/lib/libfftw3_threads.dll || \ + test -r /usr/local/lib/libfftw3_threads.dylib]; then + AC_MSG_RESULT([FFTW3 threads library found... OK]) + elif [test -r /usr/lib/libfftw3_threads.a || test -r /usr/lib/libfftw3_threads.so || \ + test -r /usr/lib/libfftw3_threads.dll.a || test -r /usr/lib/libfftw3_threads.dll || \ + test -r /usr/lib/libfftw3_threads.dylib]; then + AC_MSG_RESULT([FFTW3 threads library found... OK]) + elif [test -r /sw/lib/libfftw3_threads.a || test -r /sw/lib/libfftw3_threads.so || \ + test -r /sw/lib/libfftw3_threads.dll.a || test -r /sw/lib/libfftw3_threads.dll || \ + test -r /sw/lib/libfftw3_threads.dylib]; then + AC_MSG_RESULT([FFTW3 threads library found... OK]) + elif [test -r /opt/local/lib/libfftw3_threads.a || test -r /opt/local/lib/libfftw3_threads.so || \ + test -r /opt/local/lib/libfftw3_threads.dll.a || test -r /opt/local/lib/libfftw3_threads.dll || \ + test -r /opt/local/lib/libfftw3_threads.dylib]; then + AC_MSG_RESULT([FFTW3 threads library found... OK]) + else + AC_MSG_WARN([FFTW3 threads library not found. Please check! The BMWlibs will not run without it at the moment!]) + fi + FFTW3_THREADS_LIBS="${FFTW3_LIBS} -lfftw3_threads -lpthread" + fi + AC_SUBST(FFTW3_THREADS_LIBS) + BUILD_BMW_LIBS=1 ], [BUILD_BMW_LIBS=0] diff --git a/src/external/TFitPofB-lib/classes/Makefile.am b/src/external/TFitPofB-lib/classes/Makefile.am index 66d902bb..c98cade4 100644 --- a/src/external/TFitPofB-lib/classes/Makefile.am +++ b/src/external/TFitPofB-lib/classes/Makefile.am @@ -56,7 +56,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ core lib_LTLIBRARIES = libTFitPofB.la libTFitPofB_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) -libTFitPofB_la_LIBADD = $(LEM_LIBS) $(PMUSR_LIBS) $(FFTW3_LIBS) $(ROOT_LIBS) +libTFitPofB_la_LIBADD = $(LEM_LIBS) $(PMUSR_LIBS) $(FFTW3_THREADS_LIBS) $(ROOT_LIBS) libTFitPofB_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) ## For the moment do not build pkgconfig files for musrfit plug-ins... diff --git a/src/external/libLFRelaxation/Makefile.am b/src/external/libLFRelaxation/Makefile.am index 4c199220..b47d4505 100644 --- a/src/external/libLFRelaxation/Makefile.am +++ b/src/external/libLFRelaxation/Makefile.am @@ -33,7 +33,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ core lib_LTLIBRARIES = libLFRelaxation.la libLFRelaxation_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) -libLFRelaxation_la_LIBADD = $(PMUSR_LIBS) $(FFTW3_LIBS) $(GSL_LIBS) $(ROOT_LIBS) $(CUBA_LIBS) +libLFRelaxation_la_LIBADD = $(PMUSR_LIBS) $(FFTW3_THREADS_LIBS) $(GSL_LIBS) $(ROOT_LIBS) $(CUBA_LIBS) libLFRelaxation_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) ## For the moment do not build pkgconfig files for musrfit plug-ins...