summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorthor <thor@pkgsrc.org>2021-04-29 23:30:12 +0000
committerthor <thor@pkgsrc.org>2021-04-29 23:30:12 +0000
commitb05bd3cb55eb033b2548e905e76d8dde7196c46e (patch)
tree55a3ff50b479bb900021a35dbaa4a52ae8685d26 /math
parent02f87302fcb9ace533d2c7d5b3cbc29b86b30781 (diff)
downloadpkgsrc-b05bd3cb55eb033b2548e905e76d8dde7196c46e.tar.gz
math/fftw and dependents: merge math/fftwf backin and add MPI and OpenMP
This yields one common package to provide libfftw3 (double) and libfftw3f (single) by default and optionally the Fortran bindings as well as OpenMP and MPI variants, and those with long double or quad precision. This changes all packages depending on fftwf in the same commit to minimize the time of inconsistency. Soon, math/fftwf will disappear.
Diffstat (limited to 'math')
-rw-r--r--math/fftw/Makefile63
-rw-r--r--math/fftw/Makefile.common33
-rw-r--r--math/fftw/PLIST35
-rw-r--r--math/fftw/buildlink3.mk9
-rw-r--r--math/fftw/options.mk31
-rw-r--r--math/octave/Makefile5
6 files changed, 131 insertions, 45 deletions
diff --git a/math/fftw/Makefile b/math/fftw/Makefile
index a70d623aa43..983df2beab4 100644
--- a/math/fftw/Makefile
+++ b/math/fftw/Makefile
@@ -1,14 +1,69 @@
-# $NetBSD: Makefile,v 1.61 2020/08/31 18:10:11 wiz Exp $
+# $NetBSD: Makefile,v 1.62 2021/04/29 23:30:15 thor Exp $
-.include "Makefile.common"
-
-PKGREVISION= 3
+PKGREVISION= 4
COMMENT= Collection of fast C routines to compute DFTs
+DISTNAME= fftw-3.3.9
+CATEGORIES= math
+MASTER_SITES= ftp://ftp.fftw.org/pub/fftw/
+MASTER_SITES+= http://www.fftw.org/
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://www.fftw.org/
+LICENSE= gnu-gpl-v2
+
+SUPERSEDES= fftwf
+CONFLICTS+= fftwf-[0-9]*
+
+USE_LANGUAGES= c
+USE_LIBTOOL= yes
+USE_TOOLS+= gmake
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --enable-shared
+TEST_TARGET= check
+
+.include "../../mk/bsd.prefs.mk"
+
PKGCONFIG_OVERRIDE+= fftw.pc.in
INFO_FILES= yes
+# The standard precision is double. We always build at least
+# single in addition. Others enabled by options.
+FFTW_PRECISION= double float
.include "options.mk"
+# Test will only use the default build.
+.if defined(PKGSRC_RUN_TEST) && !empty(PKGSRC_RUN_TEST:M[Yy][Ee][Ss])
+USE_TOOLS+= perl
+.endif
+
+PLIST_VARS+= pthreads
+PTHREAD_OPTS= native
+.include "../../mk/pthread.buildlink3.mk"
+.if ${PTHREAD_TYPE} == "native"
+CONFIGURE_ARGS+= --enable-threads
+PLIST.pthreads= yes
+.endif
+
+CONFIGURE_SCRIPT= ./configure
+.for p in ${FFTW_PRECISION}
+CONFIGURE_DIRS+= build/${p}
+MAKE_DIRS+= build/${p}
+.endfor
+
+pre-configure:
+.for d in ${CONFIGURE_DIRS}
+ mkdir -p ${WRKSRC:Q}/${d}
+.if ${d} == "build/quad-precision"
+ printf '#!/bin/sh\nexec ../../configure "$$@" --enable-${d:S,build/,,} --disable-mpi\n' \
+ > ${WRKSRC:Q}/${d}/configure
+.else
+ printf '#!/bin/sh\nexec ../../configure "$$@" --enable-${d:S,build/,,}\n' \
+ > ${WRKSRC:Q}/${d}/configure
+.endif
+ chmod +x ${WRKSRC:Q}/${d}/configure
+.endfor
+
.include "../../mk/bsd.pkg.mk"
+
diff --git a/math/fftw/Makefile.common b/math/fftw/Makefile.common
deleted file mode 100644
index 903a42dd26c..00000000000
--- a/math/fftw/Makefile.common
+++ /dev/null
@@ -1,33 +0,0 @@
-# $NetBSD: Makefile.common,v 1.2 2021/01/04 10:27:37 wiz Exp $
-# used by math/fftw/Makefile
-# used by math/fftwf/Makefile
-
-DISTNAME= fftw-3.3.9
-CATEGORIES= math
-MASTER_SITES= ftp://ftp.fftw.org/pub/fftw/
-MASTER_SITES+= http://www.fftw.org/
-
-MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://www.fftw.org/
-LICENSE= gnu-gpl-v2
-
-USE_LANGUAGES= c
-USE_LIBTOOL= yes
-USE_TOOLS+= gmake
-GNU_CONFIGURE= yes
-CONFIGURE_ARGS+= --enable-shared
-TEST_TARGET= check
-
-.include "../../mk/bsd.prefs.mk"
-
-.if defined(PKGSRC_RUN_TEST) && !empty(PKGSRC_RUN_TEST:M[Yy][Ee][Ss])
-USE_TOOLS+= perl
-.endif
-
-PLIST_VARS+= pthreads
-PTHREAD_OPTS= native
-.include "../../mk/pthread.buildlink3.mk"
-.if ${PTHREAD_TYPE} == "native"
-CONFIGURE_ARGS+= --enable-threads
-PLIST.pthreads= yes
-.endif
diff --git a/math/fftw/PLIST b/math/fftw/PLIST
index 22b560b776f..c108910f159 100644
--- a/math/fftw/PLIST
+++ b/math/fftw/PLIST
@@ -1,16 +1,47 @@
-@comment $NetBSD: PLIST,v 1.13 2017/11/23 20:24:13 wiz Exp $
-bin/fftw-wisdom
+@comment $NetBSD: PLIST,v 1.14 2021/04/29 23:30:15 thor Exp $
bin/fftw-wisdom-to-conf
+bin/fftw-wisdom
+bin/fftwf-wisdom
+${PLIST.long}bin/fftwl-wisdom
+${PLIST.quad}bin/fftwq-wisdom
include/fftw3.f
include/fftw3.f03
include/fftw3.h
+${PLIST.mpi}include/fftw3-mpi.h
include/fftw3l.f03
include/fftw3q.f03
info/fftw3.info
lib/cmake/fftw3/FFTW3Config.cmake
lib/cmake/fftw3/FFTW3ConfigVersion.cmake
+lib/cmake/fftw3/FFTW3fConfig.cmake
+lib/cmake/fftw3/FFTW3fConfigVersion.cmake
+${PLIST.long}lib/cmake/fftw3/FFTW3lConfig.cmake
+${PLIST.long}lib/cmake/fftw3/FFTW3lConfigVersion.cmake
+${PLIST.quad}lib/cmake/fftw3/FFTW3qConfig.cmake
+${PLIST.quad}lib/cmake/fftw3/FFTW3qConfigVersion.cmake
lib/libfftw3.la
+lib/libfftw3f.la
+${PLIST.long}lib/libfftw3l.la
+${PLIST.quad}lib/libfftw3q.la
${PLIST.pthreads}lib/libfftw3_threads.la
+${PLIST.pthreads}lib/libfftw3f_threads.la
+${PLIST.pthreads}${PLIST.long}lib/libfftw3l_threads.la
+${PLIST.pthreads}${PLIST.quad}lib/libfftw3q_threads.la
+${PLIST.omp}lib/libfftw3_omp.la
+${PLIST.omp}lib/libfftw3f_omp.la
+${PLIST.omp}${PLIST.long}lib/libfftw3l_omp.la
+${PLIST.omp}${PLIST.quad}lib/libfftw3q_omp.la
+${PLIST.mpi}lib/libfftw3_mpi.la
+${PLIST.mpi}lib/libfftw3f_mpi.la
+${PLIST.mpi}${PLIST.long}lib/libfftw3l_mpi.la
+${PLIST.mpi}include/fftw3l-mpi.f03
+${PLIST.mpi}include/fftw3-mpi.f03
lib/pkgconfig/fftw3.pc
+lib/pkgconfig/fftw3f.pc
+${PLIST.long}lib/pkgconfig/fftw3l.pc
+${PLIST.quad}lib/pkgconfig/fftw3q.pc
man/man1/fftw-wisdom-to-conf.1
man/man1/fftw-wisdom.1
+man/man1/fftwf-wisdom.1
+${PLIST.long}man/man1/fftwl-wisdom.1
+${PLIST.quad}man/man1/fftwq-wisdom.1
diff --git a/math/fftw/buildlink3.mk b/math/fftw/buildlink3.mk
index da4835a80bc..aaef405b17e 100644
--- a/math/fftw/buildlink3.mk
+++ b/math/fftw/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.8 2009/03/20 19:24:56 joerg Exp $
+# $NetBSD: buildlink3.mk,v 1.9 2021/04/29 23:30:15 thor Exp $
BUILDLINK_TREE+= fftw
@@ -8,6 +8,13 @@ FFTW_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.fftw+= fftw>=3.0
BUILDLINK_ABI_DEPENDS.fftw+= fftw>=3.1nb1
BUILDLINK_PKGSRCDIR.fftw?= ../../math/fftw
+
+pkgbase := fftw
+.include "../../mk/pkg-build-options.mk"
+.if ${PKG_BUILD_OPTIONS.fftw:Mmpi}
+.include "../../mk/mpi.buildlink3.mk"
+.endif
+
.endif # FFTW_BUILDLINK3_MK
BUILDLINK_TREE+= -fftw
diff --git a/math/fftw/options.mk b/math/fftw/options.mk
index 757a6cc2c0b..7607bbbf24c 100644
--- a/math/fftw/options.mk
+++ b/math/fftw/options.mk
@@ -1,7 +1,9 @@
-# $NetBSD: options.mk,v 1.3 2018/05/30 06:45:58 adam Exp $
+# $NetBSD: options.mk,v 1.4 2021/04/29 23:30:15 thor Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.fftw
-PKG_SUPPORTED_OPTIONS= fftw-fortran
+# fftw (double) and fftwf (single) are always built, you can add
+# fftwl (long) and fftwq (quad).
+PKG_SUPPORTED_OPTIONS= fftw-fortran openmp mpi fftw-long fftw-quad
# Enable fortran support by default on platforms supported by lang/g95.
.if (!empty(MACHINE_ARCH:Mi386) || !empty(MACHINE_ARCH:Mx86_64) || \
!empty(MACHINE_ARCH:Mia64) || !empty(MACHINE_ARCH:Mpowerpc*) || \
@@ -18,3 +20,28 @@ USE_LANGUAGES+= fortran77
.else
CONFIGURE_ARGS+= --disable-fortran
.endif
+
+PLIST_VARS+= omp
+.if !empty(PKG_OPTIONS:Mopenmp)
+PLIST.omp= yes
+CONFIGURE_ARGS+= --enable-openmp
+.endif
+
+PLIST_VARS+= mpi
+.if !empty(PKG_OPTIONS:Mmpi)
+PLIST.mpi= yes
+CONFIGURE_ARGS+= --enable-mpi
+.include "../../mk/mpi.buildlink3.mk"
+.endif
+
+PLIST_VARS+= long quad
+
+.if !empty(PKG_OPTIONS:Mfftw-long)
+FFTW_PRECISION+= long-double
+PLIST.long= yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mfftw-quad)
+FFTW_PRECISION+= quad-precision
+PLIST.quad= yes
+.endif
diff --git a/math/octave/Makefile b/math/octave/Makefile
index 0af4b8e1128..f0ae735934d 100644
--- a/math/octave/Makefile
+++ b/math/octave/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.217 2021/04/21 13:25:00 adam Exp $
+# $NetBSD: Makefile,v 1.218 2021/04/29 23:30:16 thor Exp $
DISTNAME= octave-5.2.0
-PKGREVISION= 14
+PKGREVISION= 15
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_GNU:=octave/}
EXTRACT_SUFX= .tar.xz
@@ -108,7 +108,6 @@ post-install:
.include "../../math/arpack-ng/buildlink3.mk"
.include "../../mk/blas.buildlink3.mk"
.include "../../math/fftw/buildlink3.mk"
-.include "../../math/fftwf/buildlink3.mk"
.include "../../sysutils/desktop-file-utils/desktopdb.mk"
.include "../../www/curl/buildlink3.mk"
.include "../../x11/fltk13/buildlink3.mk"