aboutsummaryrefslogtreecommitdiff
path: root/math/fftw3
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2016-10-26 00:16:09 +0000
committerJason E. Hale <jhale@FreeBSD.org>2016-10-26 00:16:09 +0000
commitd0cd21ef75575d4dc24a04dc986dbdae6901ca61 (patch)
tree52ba366fc9e523a7dfe09e7a080b5e0d10485bee /math/fftw3
parent8617af3b10454efb5d621448a62098b668f80b35 (diff)
downloadports-d0cd21ef75575d4dc24a04dc986dbdae6901ca61.tar.gz
ports-d0cd21ef75575d4dc24a04dc986dbdae6901ca61.zip
- Update to 3.3.5
- Add SIMD option to easily toggle cpu optimizations (ON by default) - Add OPENMPI option to build the MPI libraries (OFF by default) [1] - Strip slave port binaries - Take maintainership PR: 203847 [1] Submitted by: <dieterich@ogolem.org> [1]
Notes
Notes: svn path=/head/; revision=424661
Diffstat (limited to 'math/fftw3')
-rw-r--r--math/fftw3/Makefile85
-rw-r--r--math/fftw3/distinfo5
-rw-r--r--math/fftw3/files/extrapatch-tests_fftw-bench.c11
-rw-r--r--math/fftw3/files/patch-configure11
-rw-r--r--math/fftw3/pkg-plist13
5 files changed, 86 insertions, 39 deletions
diff --git a/math/fftw3/Makefile b/math/fftw3/Makefile
index bbc0cc031a47..5c5eb1648a55 100644
--- a/math/fftw3/Makefile
+++ b/math/fftw3/Makefile
@@ -3,18 +3,19 @@
# $MCom: ports-experimental/math/fftw3/Makefile,v 1.1 2006/03/28 00:08:57 ahze Exp $
PORTNAME= fftw3
-PORTVERSION= 3.3.3
-PORTREVISION?= 2
+PORTVERSION= 3.3.5
+PORTREVISION?= 0
CATEGORIES= math
MASTER_SITES= http://www.fftw.org/ \
ftp://ftp.fftw.org/pub/fftw/
PKGNAMESUFFIX= ${FFTW3_PKGNAMESUFFIX}
DISTNAME= fftw-${PORTVERSION}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= jhale@FreeBSD.org
COMMENT?= Fast C routines to compute the Discrete Fourier Transform
LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/COPYING
#current flavors: default, float, long, and quad
FFTW3_FLAVOR?= default
@@ -26,7 +27,8 @@ USES= libtool pathfix perl5 pkgconfig
USE_PERL5= build
USE_LDCONFIG= yes
-CONFIGURE_ARGS= --enable-shared --enable-threads --disable-fortran
+CONFIGURE_ARGS= --enable-shared --enable-threads --disable-fortran
+MPIDIR?= ${LOCALBASE}/mpi/openmpi
.if ${FFTW3_FLAVOR} == "default"
INFO= fftw3
@@ -36,43 +38,60 @@ INFO= fftw3
INSTALL_TARGET= install-pkgconfigDATA install-libLTLIBRARIES install-exec
.endif
-OPTIONS_DEFINE= G77_WRAPPERS OPENMP OPTIMIZED_CFLAGS
+OPTIONS_DEFINE= G77_WRAPPERS OPENMP OPENMPI OPTIMIZED_CFLAGS SIMD
+OPTIONS_DEFAULT= OPTIMIZED_CFLAGS SIMD
+.if ${FFTW3_FLAVOR} == "quad"
+OPTIONS_EXCLUDE+= OPENMPI
+.endif
+OPTIONS_SUB= yes
-G77_WRAPPERS_DESC= Alter Fortran wrappers for use with g77
-OPENMP_DESC= Build OpenMP multithreaded libraries
+G77_WRAPPERS_DESC= Alter Fortran wrappers for use with g77
-OPTIONS_DEFAULT= OPTIMIZED_CFLAGS
+OPENMP_DESC= Build OpenMP multithreaded libraries
+OPENMP_USES= compiler:openmp
+OPENMP_USES_OFF= compiler:env
+OPENMP_CONFIGURE_ENABLE= openmp
+OPENMP_EXTRA_PATCHES= ${FILESDIR}/extrapatch-tests_fftw-bench.c
-.include <bsd.port.options.mk>
+OPENMPI_DESC= Build OpenMPI parallel libraries
+OPENMPI_LIB_DEPENDS= libmpi.so:net/openmpi
+OPENMPI_CONFIGURE_ENABLE= mpi
+OPENMPI_CONFIGURE_ENV= MPICC=${MPIDIR}/bin/mpicc \
+ MPIRUN=${MPIDIR}/bin/mpirun
-.if ${PORT_OPTIONS:MOPENMP}
-CONFIGURE_ARGS+= --enable-openmp
-PLIST_SUB+= OPENMP=""
-USES+= compiler:openmp
-.else
-CONFIGURE_ARGS+= --disable-openmp
-PLIST_SUB+= OPENMP="@comment "
-USES+= compiler:env
-.endif
+.include <bsd.port.options.mk>
#Users must add altivec to MACHINE_CPU when desired:
#this is not currently done in bsd.cpu.mk
.if ${FFTW3_FLAVOR} == "default"
-. if !empty(MACHINE_CPU:Mavx)
+. if ${PORT_OPTIONS:MSIMD}
+. if !empty(MACHINE_CPU:Mavx)
CONFIGURE_ARGS+=--enable-avx
-. elif !empty(MACHINE_CPU:Msse2)
+. endif
+. if !empty(MACHINE_CPU:Mavx2)
+CONFIGURE_ARGS+=--enable-avx2 --enable-fma
+. endif
+. if !empty(MACHINE_CPU:Msse2)
CONFIGURE_ARGS+=--enable-sse2
+. endif
. endif
.elif ${FFTW3_FLAVOR} == "float"
FFTW3_SUFX= f
FFTW3_PKGNAMESUFFIX= -float
CONFIGURE_ARGS+=--enable-float
-. if !empty(MACHINE_CPU:Mavx)
+. if ${PORT_OPTIONS:MSIMD}
+. if !empty(MACHINE_CPU:Mavx)
CONFIGURE_ARGS+=--enable-avx
-. elif !empty(MACHINE_CPU:Msse)
-CONFIGURE_ARGS+=--enable-sse
-. elif !empty(ARCH:Mpowerpc*) && !empty(MACHINE_CPU:Maltivec)
+. endif
+. if !empty(MACHINE_CPU:Mavx2)
+CONFIGURE_ARGS+=--enable-avx2 --enable-fma
+. endif
+. if !empty(MACHINE_CPU:Msse)
+CONFIGURE_ARGS+=--enable-sse2
+. endif
+. if !empty(ARCH:Mpowerpc*) && !empty(MACHINE_CPU:Maltivec)
CONFIGURE_ARGS+=--enable-altivec
+. endif
. endif
.elif ${FFTW3_FLAVOR} == "long"
FFTW3_SUFX= l
@@ -101,7 +120,7 @@ CFLAGS+= -O3 -ffast-math -fstrict-aliasing
. if !defined(WITH_DEBUG)
CFLAGS+= -fomit-frame-pointer
. endif
-. if ${ARCH} == "i386" && (${COMPILER_TYPE} == "gcc" || !empty(USE_GCC))
+. if ${ARCH} == "i386" && (${COMPILER_TYPE} == "gcc" || !empty(USE_GCC)) && !${PORT_OPTIONS:MOPENMPI}
CFLAGS+= -malign-double
. endif
WITHOUT_NO_STRICT_ALIASING= yes
@@ -119,7 +138,6 @@ post-patch:
/[^\]$$/s/[^[:blank:]]*fftw-wisdom-to-conf[^[:blank:]]*//' \
${WRKSRC}/tools/Makefile.in
.endif
- @${FIND} ${WRKSRC} -type f \( -name \*.bak -or -name \*.orig \) -delete
post-configure:
#After issuing --disable-fortran in order to avoid using a Fortran compiler
@@ -129,21 +147,20 @@ post-configure:
@${ECHO_CMD} "#define F77_FUNC(name,NAME) name ## _" >> ${WRKSRC}/config.h
@${ECHO_CMD} "#define F77_FUNC_(name,NAME) name ## _" >> ${WRKSRC}/config.h
@${ECHO_CMD} "#define F77_FUNC_EQUIV 1" >> ${WRKSRC}/config.h
-.if ${PORT_OPTIONS:MG77_WRAPPERS}
+
+post-configure-G77_WRAPPERS-on:
@${ECHO_CMD} "#define WITH_G77_WRAPPERS 1" >> ${WRKSRC}/config.h
-.endif
.if ${FFTW3_FLAVOR} != "default"
post-install:
- @${INSTALL_MAN} ${WRKSRC}/tools/fftw${FFTW3_SUFX}-wisdom.1 ${STAGEDIR}${PREFIX}/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/tools/fftw${FFTW3_SUFX}-wisdom.1 ${STAGEDIR}${PREFIX}/man/man1
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib*.so
.endif
regression-test test: smallcheck
-.for t in bigcheck check exhaustive-check paranoid-check smallcheck
-${t}: build
- @(cd ${WRKSRC}/tests && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
- ${MAKE_ARGS} ${t})
-.endfor
+bigcheck check exhaustive-check paranoid-check smallcheck: build
+ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC}/tests \
+ ${MAKE_ARGS} $@
.include <bsd.port.post.mk>
diff --git a/math/fftw3/distinfo b/math/fftw3/distinfo
index 99a681bd639b..1aae047da966 100644
--- a/math/fftw3/distinfo
+++ b/math/fftw3/distinfo
@@ -1,2 +1,3 @@
-SHA256 (fftw-3.3.3.tar.gz) = 85cdfc0a0ba10d8fa4f0f8e733aac1a5936c859832a9e3d5c0731fb5c54a97f3
-SIZE (fftw-3.3.3.tar.gz) = 3920661
+TIMESTAMP = 1477312473
+SHA256 (fftw-3.3.5.tar.gz) = 8ecfe1b04732ec3f5b7d279fdb8efcad536d555f9d1e8fabd027037d45ea8bcf
+SIZE (fftw-3.3.5.tar.gz) = 4148447
diff --git a/math/fftw3/files/extrapatch-tests_fftw-bench.c b/math/fftw3/files/extrapatch-tests_fftw-bench.c
new file mode 100644
index 000000000000..4fc77df82dfe
--- /dev/null
+++ b/math/fftw3/files/extrapatch-tests_fftw-bench.c
@@ -0,0 +1,11 @@
+Fix regression tests when OPENMP option is enabled.
+--- tests/fftw-bench.c.orig 2016-10-25 22:27:48 UTC
++++ tests/fftw-bench.c
+@@ -110,7 +110,6 @@ void rdwisdom(void)
+ if (threads_ok) {
+ BENCH_ASSERT(FFTW(init_threads)());
+ FFTW(plan_with_nthreads)(nthreads);
+- FFTW(make_planner_thread_safe)();
+ #ifdef _OPENMP
+ omp_set_num_threads(nthreads);
+ #endif
diff --git a/math/fftw3/files/patch-configure b/math/fftw3/files/patch-configure
new file mode 100644
index 000000000000..1bc428a294fc
--- /dev/null
+++ b/math/fftw3/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig 2016-07-30 20:34:50 UTC
++++ configure
+@@ -14397,7 +14397,7 @@ fi
+ esac
+
+ case "${ax_cv_c_compiler_vendor}" in
+- gnu|intel)
++ gnu|intel|clang)
+ # SSE/SSE2
+ if test "$have_sse2" = "yes" -a "x$SSE2_CFLAGS" = x; then
+ if test "$PRECISION" = d; then flag=msse2; else flag=msse; fi
diff --git a/math/fftw3/pkg-plist b/math/fftw3/pkg-plist
index c902337f7aef..81fff21ccf83 100644
--- a/math/fftw3/pkg-plist
+++ b/math/fftw3/pkg-plist
@@ -1,22 +1,29 @@
bin/fftw%%FFTW3_SUFX%%-wisdom
%%DEF%%bin/fftw-wisdom-to-conf
+%%DEF%%%%OPENMPI%%include/fftw3-mpi.f03
+%%DEF%%%%OPENMPI%%include/fftw3-mpi.h
%%DEF%%include/fftw3.f
%%DEF%%include/fftw3.f03
%%DEF%%include/fftw3.h
+%%DEF%%%%OPENMPI%%include/fftw3l-mpi.f03
%%DEF%%include/fftw3l.f03
%%DEF%%include/fftw3q.f03
lib/libfftw3%%FFTW3_SUFX%%.a
lib/libfftw3%%FFTW3_SUFX%%.so
lib/libfftw3%%FFTW3_SUFX%%.so.3
-lib/libfftw3%%FFTW3_SUFX%%.so.3.3.2
+lib/libfftw3%%FFTW3_SUFX%%.so.3.5.5
+%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.a
+%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so
+%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so.3
+%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so.3.5.5
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.a
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.3
-%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.3.3.2
+%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.3.5.5
lib/libfftw3%%FFTW3_SUFX%%_threads.a
lib/libfftw3%%FFTW3_SUFX%%_threads.so
lib/libfftw3%%FFTW3_SUFX%%_threads.so.3
-lib/libfftw3%%FFTW3_SUFX%%_threads.so.3.3.2
+lib/libfftw3%%FFTW3_SUFX%%_threads.so.3.5.5
libdata/pkgconfig/fftw3%%FFTW3_SUFX%%.pc
%%DEF%%man/man1/fftw-wisdom.1.gz
%%DEF%%man/man1/fftw-wisdom-to-conf.1.gz