summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2008-07-10 14:36:39 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2008-07-10 14:36:39 +0000
commit766a1c9d1ec3b03c83aea035cada1175a62d54e0 (patch)
tree99f0461749ff7a0c3dcbbfce83a70026b67a12e7 /sci-libs/fftw
parentdev-cpp/cairomm: don't build examples and tests (see ebuild for reasons why) (diff)
downloadgentoo-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')
-rw-r--r--sci-libs/fftw/ChangeLog8
-rw-r--r--sci-libs/fftw/fftw-2.1.5-r5.ebuild69
-rw-r--r--sci-libs/fftw/fftw-3.1.2-r1.ebuild31
-rw-r--r--sci-libs/fftw/files/fftw-2.1.5-configure.in.patch70
-rw-r--r--sci-libs/fftw/files/fftw-3.1.2-configure.ac.patch12
-rw-r--r--sci-libs/fftw/files/fftw-3.1.2-openmp.patch7
6 files changed, 143 insertions, 54 deletions
diff --git a/sci-libs/fftw/ChangeLog b/sci-libs/fftw/ChangeLog
index 3ff884b64cc7..4bb4ef19c08f 100644
--- a/sci-libs/fftw/ChangeLog
+++ b/sci-libs/fftw/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sci-libs/fftw
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/ChangeLog,v 1.68 2008/07/04 09:43:37 bicatali Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/ChangeLog,v 1.69 2008/07/10 14:36:38 bicatali Exp $
+
+ 10 Jul 2008; Sébastien Fabbro <bicatali@gentoo.org>
+ files/fftw-2.1.5-configure.in.patch, files/fftw-3.1.2-configure.ac.patch,
+ files/fftw-3.1.2-openmp.patch, fftw-2.1.5-r5.ebuild, fftw-3.1.2-r1.ebuild:
+ Added openmp checks and revert to posix threads if openmp not supported by
+ compiler. Close bug #230982.
04 Jul 2008; Sébastien Fabbro <bicatali@gentoo.org>
files/fftw-2.1.5-no-test.patch:
diff --git a/sci-libs/fftw/fftw-2.1.5-r5.ebuild b/sci-libs/fftw/fftw-2.1.5-r5.ebuild
index a5ec2b4e6b7d..5028311b7230 100644
--- a/sci-libs/fftw/fftw-2.1.5-r5.ebuild
+++ b/sci-libs/fftw/fftw-2.1.5-r5.ebuild
@@ -1,8 +1,8 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/fftw-2.1.5-r5.ebuild,v 1.1 2008/07/02 09:20:22 bicatali Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/fftw-2.1.5-r5.ebuild,v 1.2 2008/07/10 14:36:38 bicatali Exp $
-inherit eutils flag-o-matic multilib autotools fortran
+inherit eutils flag-o-matic multilib autotools fortran toolchain-funcs
DESCRIPTION="Fast C library for the Discrete Fourier Transform"
SRC_URI="http://www.fftw.org/${P}.tar.gz"
@@ -23,9 +23,21 @@ pkg_setup() {
# here I need (surprise) to increase optimization:
# --enable-i386-hacks requires -fomit-frame-pointer to work properly
- if [ "${ARCH}" == "x86" ]; then
+ if use x86; then
is-flag "-fomit-frame-pointer" || append-flags "-fomit-frame-pointer"
fi
+ if use openmp &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] ||
+ ! built_with_use sys-devel/gcc openmp
+then
+ ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
+ ewarn "If you want to build fftw with OpenMP, abort now,"
+ ewarn "and switch CC to an OpenMP capable compiler"
+ ewarn "Otherwise the configure script will select POSIX threads."
+ epause 5
+ fi
+
FORTRAN="gfortran ifc g77"
use fortran && fortran_pkg_setup
}
@@ -60,32 +72,32 @@ src_unpack() {
}
src_compile() {
+ local myconf="
+ --enable-shared
+ --enable-type-prefix
+ --enable-vec-recurse
+ $(use_enable fortran)
+ $(use_enable mpi)
+ $(use_enable x86 i386-hacks)"
+ if use openmp; then
+ myconf="${myconf}
+ --enable-threads
+ --with-openmp"
+ elif use threads; then
+ myconf="${myconf}
+ --enable-threads
+ --without-openmp"
+ else
+ myconf="${myconf}
+ --disable-threads
+ --without-openmp"
+ fi
cd "${S}-single"
- econf \
- --enable-float \
- --enable-shared \
- --enable-type-prefix \
- --enable-vec-recurse \
- $(use_enable threads) \
- $(use_with openmp) \
- $(use_enable fortran) \
- $(use_enable mpi) \
- $(use_enable x86 i386-hacks) \
- || die "econf for float failed"
+ econf ${myconf} --enable-float || die "econf for float failed"
emake || die "emake for float failed"
- # the only difference here is no --enable-float
cd "${S}-double"
- econf \
- --enable-shared \
- --enable-type-prefix \
- --enable-vec-recurse \
- $(use_enable threads) \
- $(use_with openmp) \
- $(use_enable fortran) \
- $(use_enable mpi) \
- $(use_enable x86 i386-hacks) \
- || die "econf for double failed"
+ econf ${myconf} || die "econf for double failed"
emake || die "emake for double failed"
}
@@ -103,14 +115,15 @@ src_install () {
cd "${S}-single"
emake DESTDIR="${D}" install || die "emake install float failed"
+
+ cd "${S}-double"
+ emake DESTDIR="${D}" install || die "emake install double failed"
+
insinto /usr/include
doins fortran/fftw_f77.i || die "doins failed"
dodoc AUTHORS ChangeLog NEWS TODO README README.hacks || die "dodoc failed"
use doc && dohtml doc/*
- cd "${S}-double"
- emake DESTDIR="${D}" install || die "emake install double failed"
-
if use float; then
for f in "${D}"/usr/{include,$(get_libdir)}/*sfft*; do
ln -s $(basename ${f}) ${f/sfft/fft}
diff --git a/sci-libs/fftw/fftw-3.1.2-r1.ebuild b/sci-libs/fftw/fftw-3.1.2-r1.ebuild
index afefa878a6f6..fe31b9b175fa 100644
--- a/sci-libs/fftw/fftw-3.1.2-r1.ebuild
+++ b/sci-libs/fftw/fftw-3.1.2-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/fftw-3.1.2-r1.ebuild,v 1.2 2008/07/02 13:20:12 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/fftw/fftw-3.1.2-r1.ebuild,v 1.3 2008/07/10 14:36:38 bicatali Exp $
inherit flag-o-matic eutils toolchain-funcs autotools fortran
@@ -14,6 +14,17 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="altivec doc fortran openmp sse sse2 threads"
pkg_setup() {
+ if use openmp &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] ||
+ ! built_with_use sys-devel/gcc openmp
+ then
+ ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
+ ewarn "If you want to build fftw with OpenMP, abort now,"
+ ewarn "and switch CC to an OpenMP capable compiler"
+ ewarn "Otherwise the configure script will select POSIX threads."
+ epause 5
+ fi
FORTRAN="gfortran ifc g77"
use fortran && fortran_pkg_setup
}
@@ -39,10 +50,24 @@ src_compile() {
# filter -Os according to docs
replace-flags -Os -O2
- local myconfcommon="--enable-shared
- $(use_with openmp)
+ local myconfcommon="
+ --enable-shared
$(use_enable threads)
$(use_enable fortran)"
+
+ if use openmp; then
+ myconfcommon="${myconfcommon}
+ --enable-threads
+ --with-openmp"
+ elif use threads; then
+ myconfcommon="${myconfcommon}
+ --enable-threads
+ --without-openmp"
+ else
+ myconfcommon="${myconfcommon}
+ --disable-threads
+ --without-openmp"
+ fi
local myconfsingle=""
local myconfdouble=""
local myconflongdouble=""
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