aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbf <bf@FreeBSD.org>2011-10-22 16:03:34 +0800
committerbf <bf@FreeBSD.org>2011-10-22 16:03:34 +0800
commitdca1a818da84b2cb99fdd819cff259dc2b0522cb (patch)
treecc9809ddf74ab1598eaf9d4659dffb1d46d27438
parent6e93c7bd183e1c0d4871c76dad7be07572edd1b5 (diff)
downloadfreebsd-ports-gnome-dca1a818da84b2cb99fdd819cff259dc2b0522cb.tar.gz
freebsd-ports-gnome-dca1a818da84b2cb99fdd819cff259dc2b0522cb.tar.zst
freebsd-ports-gnome-dca1a818da84b2cb99fdd819cff259dc2b0522cb.zip
add an option for the fftw3 OpenMP libraries, and turn it
off by default, because some compilers (e.g. clang) don't support OpenMP; make linking to the fftw3*_threads shared libraries easier by adding tags for the system thread library; simplify math library changes for the long flavor on 7.*; defer patch cleanup, to make debugging easier; tweak format of post-patch target
-rw-r--r--math/fftw3/Makefile38
-rw-r--r--math/fftw3/pkg-plist8
2 files changed, 30 insertions, 16 deletions
diff --git a/math/fftw3/Makefile b/math/fftw3/Makefile
index e911ace117d5..44885a7ac6b9 100644
--- a/math/fftw3/Makefile
+++ b/math/fftw3/Makefile
@@ -7,6 +7,7 @@
PORTNAME= fftw3
PORTVERSION= 3.3
+PORTREVISION?= 1
CATEGORIES= math
MASTER_SITES= ftp://ftp.fftw.org/pub/fftw/ \
ftp://ftp.fftw.org/pub/fftw/old/
@@ -25,8 +26,7 @@ USE_GNOME= gnomehack pkgconfig
USE_PERL5_BUILD=yes
USE_LDCONFIG= yes
-CONFIGURE_ARGS = --enable-openmp --enable-shared --enable-threads \
- --disable-fortran
+CONFIGURE_ARGS = --enable-shared --enable-threads --disable-fortran
CONFIGURE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}"
@@ -41,10 +41,19 @@ INSTALL_TARGET= install-pkgconfigDATA install-libLTLIBRARIES install-exec
.endif
OPTIONS= G77_WRAPPERS "Alter Fortran wrappers for use with g77" off \
+ OPENMP "Build OpenMP variant of multithreaded libraries" off \
OPTIMIZED_CFLAGS "Enable optimized CFLAGS" on
.include <bsd.port.pre.mk>
+.if defined(WITH_OPENMP)
+CONFIGURE_ARGS+= --enable-openmp
+PLIST_SUB+= OPENMP=""
+.else
+CONFIGURE_ARGS+= --disable-openmp
+PLIST_SUB+= OPENMP="@comment "
+.endif
+
.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+= -O3 -ffast-math -fstrict-aliasing
. if !defined(WITH_DEBUG)
@@ -96,25 +105,30 @@ PLIST_SUB+= DEF="@comment "
PLIST_SUB+= FFTW3_SUFX="${FFTW3_SUFX}"
post-patch:
- @${REINPLACE_CMD} -e \
- 's|/etc/fftw|${PREFIX}/etc/fftw|' \
+ @${REINPLACE_CMD} -e 's|/etc/fftw|${PREFIX}/etc/fftw|' \
${WRKSRC}/Makefile.in \
${WRKSRC}/api/import-system-wisdom.c \
${WRKSRC}/doc/fftw3* \
${WRKSRC}/tools/*
- @${FIND} ${WRKSRC} -name \*.bak -type f -exec ${RM} -f {} \;
+ @${REINPLACE_CMD} \
+ -e '/libfftw3@PREC_SUFFIX@_threads\.la:/{N; \
+ s/$$(LIBS)/$$(PTHREAD_LIBS) &/;}' \
+ ${WRKSRC}/threads/Makefile.in
.if ${FFTW3_FLAVOR} != "default"
- @${REINPLACE_CMD} -E -e \
- '/(DIST_COMMON|bin_SCRIPTS|BUILT_SOURCES|EXTRA_DIST) =/,\
- /[^\]$$/s/[^[:blank:]]*fftw-wisdom-to-conf[^[:blank:]]*//' \
- ${WRKSRC}/tools/Makefile.in
+ @${REINPLACE_CMD} -E \
+ -e '/(DIST_COMMON|bin_SCRIPTS|BUILT_SOURCES|EXTRA_DIST) =/,\
+ /[^\]$$/s/[^[:blank:]]*fftw-wisdom-to-conf[^[:blank:]]*//' \
+ ${WRKSRC}/tools/Makefile.in
. if ${FFTW3_FLAVOR} == "long" && ${OSVERSION} < 800000
- @${REINPLACE_CMD} -e 's|cosl sinl tanl||' ${WRKSRC}/configure
- @${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} ${REINPLACE_CMD} -e \
- 's|@LIBS@|-L${LOCALBASE}/lib -lml &|'
+ @${REINPLACE_CMD} -e 's|-lm |-L${LOCALBASE}/lib -lml &|' \
+ ${WRKSRC}/configure
. endif
.endif
+post-patch-script:
+ @${FIND} ${WRKSRC} -type f \( -name \*.bak -or -name \*.orig \) \
+ -exec ${RM} -f {} \;
+
post-configure:
#After issuing --disable-fortran in order to avoid using a Fortran compiler
#during configuration, edit config.h to provide Fortran wrappers appropriate for
diff --git a/math/fftw3/pkg-plist b/math/fftw3/pkg-plist
index 06ac6afadfa1..aa24cce38313 100644
--- a/math/fftw3/pkg-plist
+++ b/math/fftw3/pkg-plist
@@ -7,10 +7,10 @@ lib/libfftw3%%FFTW3_SUFX%%.a
lib/libfftw3%%FFTW3_SUFX%%.la
lib/libfftw3%%FFTW3_SUFX%%.so
lib/libfftw3%%FFTW3_SUFX%%.so.6
-lib/libfftw3%%FFTW3_SUFX%%_omp.a
-lib/libfftw3%%FFTW3_SUFX%%_omp.la
-lib/libfftw3%%FFTW3_SUFX%%_omp.so
-lib/libfftw3%%FFTW3_SUFX%%_omp.so.6
+%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.a
+%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.la
+%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so
+%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.6
lib/libfftw3%%FFTW3_SUFX%%_threads.a
lib/libfftw3%%FFTW3_SUFX%%_threads.la
lib/libfftw3%%FFTW3_SUFX%%_threads.so