-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_fftw_macos_arm.sh
More file actions
35 lines (29 loc) · 1.05 KB
/
build_fftw_macos_arm.sh
File metadata and controls
35 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# 1) Prereqs
xcode-select --install
# 2) Fetch FFTW
curl -LO https://fftw.org/fftw-3.3.10.tar.gz
tar xzf fftw-3.3.10.tar.gz
cd fftw-3.3.10
# 3) Choose an install prefix
PREFIX=$HOME/.local
# 4) Common flags (optimize for your M-series CPU)
export CC=clang
export CFLAGS="-O3 -ffp-contract=fast -fstrict-aliasing -fno-math-errno -pipe" #-mcpu=native
# (Optional) Thin LTO can help: add -flto=thin to CFLAGS and LDFLAGS
# 5) Build & install double precision (default)
./configure --prefix="$PREFIX" --enable-shared \
--enable-threads --host=aarch64-apple-darwin --build=aarch64-apple-darwin --enable-neon
make -j"$(sysctl -n hw.ncpu)"
make check
make install
# 6) Build & install single precision (float)
# make distclean
# ./configure --prefix="$PREFIX" --enable-shared \
# --enable-threads --enable-float --host=aarch64-apple-darwin --build=aarch64-apple-darwin --enable-neon
# make -j"$(sysctl -n hw.ncpu)"
# make check
# make install
# Remove source dir and tarball
cd ..
rm -rf fftw-3.3.10 fftw-3.3.10.tar.gz
echo "[*] FFTW installed to $PREFIX"