-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fftw3 - add support for Apple silicon and fix preprocessor
- Loading branch information
1 parent
54cae4a
commit 9d96a15
Showing
2 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
Info2: << | ||
Package: fftw3 | ||
Version: 3.3.10 | ||
Revision: 2 | ||
Revision: 3 | ||
Maintainer: None <[email protected]> | ||
|
||
Type: gcc (11) | ||
|
||
Source: https://www.fftw.org/fftw-%v.tar.gz | ||
Source-Checksum: SHA256(56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467) | ||
PatchFile: %n.patch | ||
PatchFile-MD5: aa44173ecfe7a85cbc78c76ddcff971c | ||
BuildDepends: gcc%type_raw[gcc]-compiler | ||
Depends: %N-shlibs (= %v-%r) | ||
BuildDependsOnly: True | ||
|
@@ -18,23 +20,25 @@ ConfigureParams: << | |
--enable-threads \ | ||
--disable-mpi \ | ||
--enable-fortran \ | ||
--enable-sse2 \ | ||
--enable-avx \ | ||
--enable-avx2 \ | ||
( "%m" != "arm64" ) --enable-sse2 \ | ||
( "%m" != "arm64" ) --enable-avx \ | ||
( "%m" != "arm64" ) --enable-avx2 \ | ||
( "%m" = "arm64" ) --enable-armv8-cntvct-el0 \ | ||
--mandir='${prefix}/share/man' \ | ||
--infodir='${prefix}/share/info' | ||
<< | ||
GCC: 4.0 | ||
InfoTest: TestScript: touch %b/INSTALL_MAKE_CHECK; make check || exit 2 | ||
PatchScript: << | ||
%{default_script} | ||
# Patch configure to not link like Puma on Yosemite | ||
perl -pi.bak -e 's|10\.\[012\]\*|10.[012][,.]*|g' configure | ||
<< | ||
CompileScript: << | ||
#!/bin/sh -ev | ||
gcclib=`%p/bin/gfortran-fsf-%type_raw[gcc] --print-lib` | ||
FLIBDIR=`dirname $gcclib` | ||
CPP=`which cpp` CC=%p/bin/gcc-fsf-%type_raw[gcc] CFLAGS="-I`xcrun --sdk macosx --show-sdk-path`/usr/include" F77=%p/bin/gfortran-fsf-%type_raw[gcc] FLIBS="-L${FLIBDIR}" ./configure %c | ||
CPP="%p/bin/gcc-fsf-%type_raw[gcc] -E" CC=%p/bin/gcc-fsf-%type_raw[gcc] CPPFLAGS="-I`xcrun --sdk macosx --show-sdk-path`/usr/include" F77=%p/bin/gfortran-fsf-%type_raw[gcc] FLIBS="-L${FLIBDIR}" ./configure %c | ||
make | ||
<< | ||
InstallScript: << | ||
|
@@ -46,7 +50,11 @@ InstallScript: << | |
make clean | ||
gcclib=`%p/bin/gfortran-fsf-%type_raw[gcc] --print-lib` | ||
FLIBDIR=`dirname $gcclib` | ||
CPP=`which cpp` CC=%p/bin/gcc-fsf-%type_raw[gcc] CFLAGS="-I`xcrun --sdk macosx --show-sdk-path`/usr/include" F77=%p/bin/gfortran-fsf-%type_raw[gcc] FLIBS="-L${FLIBDIR}" ./configure %c --enable-float --enable-sse | ||
if [ "%m" = "arm64" ]; then | ||
CPP="%p/bin/gcc-fsf-%type_raw[gcc] -E" CC=%p/bin/gcc-fsf-%type_raw[gcc] CPPFLAGS="-I`xcrun --sdk macosx --show-sdk-path`/usr/include" F77=%p/bin/gfortran-fsf-%type_raw[gcc] FLIBS="-L${FLIBDIR}" ./configure %c --enable-float | ||
else | ||
CPP="%p/bin/gcc-fsf-%type_raw[gcc] -E" CC=%p/bin/gcc-fsf-%type_raw[gcc] CPPFLAGS="-I`xcrun --sdk macosx --show-sdk-path`/usr/include" F77=%p/bin/gfortran-fsf-%type_raw[gcc] FLIBS="-L${FLIBDIR}" ./configure %c --enable-float --enable-sse | ||
fi | ||
make | ||
if [ -f %b/INSTALL_MAKE_CHECK ]; then | ||
make check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -Nurd fftw-3.3.10.orig/kernel/cycle.h fftw-3.3.10/kernel/cycle.h | ||
--- fftw-3.3.10.orig/kernel/cycle.h 2023-07-16 16:02:45 | ||
+++ fftw-3.3.10/kernel/cycle.h 2023-07-16 16:04:25 | ||
@@ -539,7 +539,7 @@ | ||
#define HAVE_TICK_COUNTER | ||
#endif | ||
|
||
-#if defined(__aarch64__) && defined(HAVE_ARMV8_CNTVCT_EL0) && !defined(HAVE_ARMV8_PMCCNTR_EL0) | ||
+#if defined(__aarch64__) && (defined(__APPLE__) || defined(HAVE_ARMV8_CNTVCT_EL0)) && !defined(HAVE_ARMV8_PMCCNTR_EL0) | ||
typedef uint64_t ticks; | ||
static inline ticks getticks(void) | ||
{ |