diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2008-07-10 14:36:39 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2008-07-10 14:36:39 +0000 |
commit | 766a1c9d1ec3b03c83aea035cada1175a62d54e0 (patch) | |
tree | 99f0461749ff7a0c3dcbbfce83a70026b67a12e7 /sci-libs/fftw/files | |
parent | dev-cpp/cairomm: don't build examples and tests (see ebuild for reasons why) (diff) | |
download | gentoo-2-766a1c9d1ec3b03c83aea035cada1175a62d54e0.tar.gz gentoo-2-766a1c9d1ec3b03c83aea035cada1175a62d54e0.tar.bz2 gentoo-2-766a1c9d1ec3b03c83aea035cada1175a62d54e0.zip |
Added openmp checks and revert to posix threads if openmp not supported by compiler. Close bug #230982.
(Portage version: 2.1.4.4)
Diffstat (limited to 'sci-libs/fftw/files')
-rw-r--r-- | sci-libs/fftw/files/fftw-2.1.5-configure.in.patch | 70 | ||||
-rw-r--r-- | sci-libs/fftw/files/fftw-3.1.2-configure.ac.patch | 12 | ||||
-rw-r--r-- | sci-libs/fftw/files/fftw-3.1.2-openmp.patch | 7 |
3 files changed, 67 insertions, 22 deletions
diff --git a/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch b/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch index 62b388590e12..718e74686f62 100644 --- a/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch +++ b/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch @@ -1,6 +1,7 @@ ---- configure.in.orig 2008-06-22 17:01:59.013047109 +0100 -+++ configure.in 2008-06-22 17:17:39.421924454 +0100 -@@ -1,6 +1,7 @@ +--- configure.in.orig 2008-07-09 17:52:16.762461233 +0100 ++++ configure.in 2008-07-09 18:34:13.106471656 +0100 +@@ -1,6 +1,8 @@ ++ dnl Process this file with autoconf to produce a configure script. AC_INIT(fftw/planner.c) AM_INIT_AUTOMAKE(fftw, 2.1.5) @@ -8,7 +9,7 @@ dnl This is the version info according to the libtool versioning system. dnl It does *not* correspond to the release number. -@@ -27,7 +28,7 @@ +@@ -27,7 +29,7 @@ AC_ARG_ENABLE(float, [ --enable-float compile fftw for single precision], enable_float=$enableval, enable_float=no) if test "$enable_float" = "yes"; then @@ -17,7 +18,7 @@ fi FFTW_PREFIX="" -@@ -56,27 +57,27 @@ +@@ -56,27 +58,27 @@ AC_ARG_ENABLE(i386-hacks, [ --enable-i386-hacks enable gcc/x86 specific performance hacks], ok=$enableval, ok=no) if test "$ok" = "yes"; then @@ -50,6 +51,14 @@ fi dnl ----------------------------------------------------------------------- +@@ -90,7 +92,6 @@ + ACX_PROG_CC_EGCS + AC_PROG_INSTALL + AC_PROG_MAKE_SET +-AC_PROG_RANLIB + AC_PROG_LN_S + AM_PROG_LIBTOOL + AC_CHECK_PROG(PERL, perl, perl, echo perl) @@ -115,7 +116,7 @@ dnl ----------------------------------------------------------------------- @@ -95,7 +104,17 @@ fi -@@ -230,6 +231,16 @@ +@@ -221,15 +222,25 @@ + FFTW_THREADS_INCLUDELIST="" + FFTW_THREADS_PROGLIST="" + THREADLIBS="" ++omp_enabler=unknown + if test "$enable_threads" = "yes"; then + if test "$with_openmp"x != nox; then + AC_MSG_CHECKING(how to enable OpenMP) +- omp_enabler=unknown + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -omp" AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS=" " omp_enabler="$CC -omp") if test -z "$THREADLIBS"; then @@ -104,24 +123,43 @@ + omp_enabler="$CC -fopenmp") + fi + if test -z "$THREADLIBS"; then -+ CFLAGS="$save_CFLAGS -fopenmp" -+ AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS="" ++ CFLAGS="$save_CFLAGS -openmp" ++ AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS=" " + omp_enabler="$CC -openmp") + fi + if test -z "$THREADLIBS"; then CFLAGS="$save_CFLAGS -mp" AC_TRY_LINK_FUNC(omp_set_num_threads,THREADLIBS=" " omp_enabler="$CC -mp") -@@ -243,7 +249,7 @@ - if test -z "$THREADLIBS"; then - AC_MSG_ERROR([don't know how to enable OpenMP]) +@@ -240,68 +251,70 @@ + omp_enabler="automatic") + fi + AC_MSG_RESULT($omp_enabler) +- if test -z "$THREADLIBS"; then +- AC_MSG_ERROR([don't know how to enable OpenMP]) ++ if test x"$omp_enabler" != x"unknown"; then ++ AC_DEFINE(FFTW_USING_OPENMP_THREADS,1,[Using OpenMP threads]) ++ else ++ AC_MSG_WARN([don't know how to enable OpenMP, reverting to POSIX threads]) fi - AC_DEFINE(FFTW_USING_OPENMP_THREADS) -+ AC_DEFINE(FFTW_USING_OPENMP_THREADS,1,[Using OpenMP threads]) ++ fi if test "$with_sgimp"x != nox; then AC_MSG_CHECKING(how to enable SGI MP) -@@ -261,7 +267,7 @@ + mp_enabler=unknown + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -mp" +- AC_TRY_LINK_FUNC(mp_set_numthreads,THREADLIBS=" " ++ AC_TRY_LINK_FUNC(mp_set_numthreads,THREADLIBS="" + mp_enabler="$CC -mp") + if test -z "$THREADLIBS"; then + CFLAGS="$save_CFLAGS" +- AC_TRY_LINK_FUNC(mp_numthreads,THREADLIBS=" " ++ AC_TRY_LINK_FUNC(mp_numthreads,THREADLIBS="" + mp_enabler="automatic") + fi + AC_MSG_RESULT($mp_enabler) if test -z "$THREADLIBS"; then AC_MSG_ERROR([don't know how to enable SGI MP]) fi @@ -130,7 +168,9 @@ fi # POSIX threads, the default choice: -@@ -270,38 +276,38 @@ +- if test -z "$THREADLIBS"; then ++ if test x"$omp_enabler" = x"unknown" ; then + sinclude(acx_pthread.m4) ACX_PTHREAD([THREADLIBS="$PTHREAD_LIBS " CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" @@ -175,7 +215,7 @@ fi if test -z "$THREADLIBS"; then AC_MSG_ERROR(couldn't find threads library for --enable-threads) -@@ -334,7 +340,7 @@ +@@ -334,7 +347,7 @@ CC="$MPICC" ok=yes AC_TRY_LINK([#include <mpi.h> diff --git a/sci-libs/fftw/files/fftw-3.1.2-configure.ac.patch b/sci-libs/fftw/files/fftw-3.1.2-configure.ac.patch index de54a25dab05..713c2a7d7ed7 100644 --- a/sci-libs/fftw/files/fftw-3.1.2-configure.ac.patch +++ b/sci-libs/fftw/files/fftw-3.1.2-configure.ac.patch @@ -1,5 +1,5 @@ ---- configure.ac.orig 2008-06-30 23:10:27.431674828 +0100 -+++ configure.ac 2008-06-30 23:50:59.266804845 +0100 +--- configure.ac.orig 2008-07-10 11:29:58.506230457 +0100 ++++ configure.ac 2008-07-10 11:49:45.171417438 +0100 @@ -135,7 +135,7 @@ AC_PROG_CC AX_COMPILER_VENDOR @@ -18,7 +18,7 @@ dnl Checks for header files. AC_HEADER_STDC -@@ -362,7 +364,7 @@ +@@ -362,10 +364,10 @@ THREADLIBS="" if test "$enable_threads" = "yes"; then if test "$with_openmp"x != nox; then @@ -26,4 +26,8 @@ + 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_ERROR([don't know how to enable OpenMP])]) ++ [AC_MSG_WARN([don't know how to enable OpenMP, reverting to POSIX threads])]) + fi + + # POSIX threads, the default choice: diff --git a/sci-libs/fftw/files/fftw-3.1.2-openmp.patch b/sci-libs/fftw/files/fftw-3.1.2-openmp.patch index 5ccfea691a8f..b1948b3ca463 100644 --- a/sci-libs/fftw/files/fftw-3.1.2-openmp.patch +++ b/sci-libs/fftw/files/fftw-3.1.2-openmp.patch @@ -1,9 +1,10 @@ ---- m4/ax_openmp.m4.orig 2008-07-01 00:14:48.814076874 +0100 -+++ m4/ax_openmp.m4 2008-06-30 23:42:30.534809664 +0100 -@@ -59,6 +59,9 @@ +--- m4/ax_openmp.m4.orig 2008-07-10 11:33:17.361562576 +0100 ++++ m4/ax_openmp.m4 2008-07-10 12:05:14.280159723 +0100 +@@ -59,6 +59,10 @@ else if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp ++ OPENMP_LIBS=" " + if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "x-fopenmp"; then + OPENMP_LIBS="-lgomp" + fi |