summaryrefslogtreecommitdiff
blob: ee9c12a4df59f84f283c4dbab5113d27c18f2300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff -Nur fftw-3.2.1.orig/configure.ac fftw-3.2.1/configure.ac
--- fftw-3.2.1.orig/configure.ac	2009-02-20 19:28:55.832163268 +0000
+++ fftw-3.2.1/configure.ac	2009-02-26 15:02:37.533259854 +0000
@@ -440,14 +440,15 @@
 AC_ARG_WITH(combined-threads, [AC_HELP_STRING([--with-combined-threads],[combine threads into main libfftw3])], with_combined_threads=$withval, with_combined_threads=no)
 
 if test "$enable_openmp"x != nox; then
-   AX_OPENMP([THREADLIBS=" "
+   AX_OPENMP([THREADLIBS="$OPENMP_LIBS"
      AC_DEFINE(USING_OPENMP_THREADS, 1, [Define if we have and are using OpenMP multithreading directives])
      CFLAGS="$CFLAGS $OPENMP_CFLAGS"],
-     [AC_MSG_ERROR([don't know how to enable OpenMP])])
+     [AC_MSG_WARN([don't know how to enable OpenMP, reverting to POSIX threads])])
+else
+   THREADLIBS=""
 fi
 
 dnl Check for threads library...
-THREADLIBS=""
 if test "$enable_threads" = "yes"; then
 	# POSIX threads, the default choice:
 	if test -z "$THREADLIBS"; then
diff -Nur fftw-3.2.1.orig/m4/ax_openmp.m4 fftw-3.2.1/m4/ax_openmp.m4
--- fftw-3.2.1.orig/m4/ax_openmp.m4	2009-02-20 19:28:55.792160754 +0000
+++ fftw-3.2.1/m4/ax_openmp.m4	2009-02-26 15:02:08.887255943 +0000
@@ -54,13 +54,18 @@
 done
 []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS
 ])
+OPENMP_LIBS=" "
 if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then
   m4_default([$2],:)
 else
   if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then
     OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp
+    if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "x-fopenmp"; then
+        OPENMP_LIBS="-lgomp"
+    fi
   fi
   m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])])
 fi
 AC_SUBST(OPENMP_[]_AC_LANG_PREFIX[]FLAGS)
+AC_SUBST(OPENMP_LIBS)
 ])dnl AX_OPENMP
diff -Nur fftw-3.2.1.orig/Makefile.am fftw-3.2.1/Makefile.am
--- fftw-3.2.1.orig/Makefile.am	2009-02-20 19:28:56.040169973 +0000
+++ fftw-3.2.1/Makefile.am	2009-02-26 15:02:08.887255943 +0000
@@ -36,6 +36,13 @@
 if SMP
 if COMBINED_THREADS
 COMBINED_THREADLIBS=threads/libfftw3@PREC_SUFFIX@_threads.la
+else
+lib_LTLIBRARIES += libfftw3@PREC_SUFFIX@_threads.la
+libfftw3@PREC_SUFFIX@_threads_la_SOURCES = 
+libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
+libfftw3@PREC_SUFFIX@_threads_la_LIBADD = \
+	libfftw3@PREC_SUFFIX@.la \
+	threads/libfftw3@PREC_SUFFIX@_threads.la
 endif
 endif
 
diff -Nur fftw-3.2.1.orig/threads/Makefile.am fftw-3.2.1/threads/Makefile.am
--- fftw-3.2.1.orig/threads/Makefile.am	2009-02-20 19:28:55.832163268 +0000
+++ fftw-3.2.1/threads/Makefile.am	2009-02-26 15:02:08.887255943 +0000
@@ -2,11 +2,7 @@
 -I$(top_srcdir)/rdft -I$(top_srcdir)/api
 
 if SMP
-if COMBINED_THREADS
 noinst_LTLIBRARIES = libfftw3@PREC_SUFFIX@_threads.la
-else
-lib_LTLIBRARIES = libfftw3@PREC_SUFFIX@_threads.la
-endif
 endif
 
 # pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@
@@ -16,4 +12,5 @@
 openmp.c threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c	\
 vrank-geq1-rdft2.c f77api.c f77funcs.h
 
+libfftw3@PREC_SUFFIX@_threads_la_LIBADD = $(THREADLIBS)
 libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@