diff --git a/.github/workflows/python_wheel_macos_arm64.yml b/.github/workflows/python_wheel_macos_arm64.yml index ba99e3302..54d9653cc 100644 --- a/.github/workflows/python_wheel_macos_arm64.yml +++ b/.github/workflows/python_wheel_macos_arm64.yml @@ -28,7 +28,7 @@ jobs: - name: Compile libfinufft run: | - cp make.inc.gh_macos_arm64_whl make.inc + cp make.inc.macosx_arm64 make.inc make lib - name: Build wheels diff --git a/make.inc.gh_macos_arm64_whl b/make.inc.gh_macos_arm64_whl deleted file mode 100644 index bc0a1e32b..000000000 --- a/make.inc.gh_macos_arm64_whl +++ /dev/null @@ -1,28 +0,0 @@ -# Makefile variable overrides for Mac OSX compilation with CLANG. -CFLAGS = -O3 -arch arm64 - -CXX=clang++ -CC=clang - -OMP_ROOT = $(shell brew --prefix libomp) -# taken from makefile... -CFLAGS += -I include -I/usr/local/include -I/opt/homebrew/include -I$(OMP_ROOT)/include -target arm64-apple-macos11 -FFLAGS = $(CFLAGS) -CXXFLAGS = $(CFLAGS) -LIBS += -L/usr/local/lib -L/opt/homebrew/lib -L$(OMP_ROOT)/lib -target arm64-apple-macos11 -arch arm64 - -# OpenMP with clang needs following... -OMPFLAGS = -Xpreprocessor -fopenmp -OMPLIBS = -L/usr/local/lib -L/opt/homebrew/lib -lomp -# since fftw3_omp doesn't work in OSX, we need... -FFTWOMPSUFFIX=threads - - -# MATLAB interface: this will probably segfault. Instead we suggest you use -# make.inc.macosx_clang_matlab - -# Some of these will depend on your FFTW library location... -MFLAGS += -I/usr/local/include -I/opt/homebrew/include -L/usr/local/lib -L/opt/homebrew/lib -lm -# may need to edit for your MATLAB version location... -MEX = $(shell ls -d /Applications/MATLAB_R20**.app)/bin/mex -# Also see docs/install.rst for possible edits to MATLAB's MEX XML file. diff --git a/make.inc.macosx_arm64 b/make.inc.macosx_arm64 index 8889fb964..8f6fdc059 100644 --- a/make.inc.macosx_arm64 +++ b/make.inc.macosx_arm64 @@ -9,7 +9,7 @@ # (note that /usr/bin/g++,gcc are aliased to clang/LLVM, so CXX,CC unchanged) # compile flags for use with clang: (note absence of -march, etc) -CFLAGS = -O3 -arch arm64 +CFLAGS = -O3 -arch arm64 -target arm64-apple-macos11 # If you're getting warning messages of the form: # ld: warning: object file (lib-static/libfinufft.a(finufft1d.o)) was built for @@ -22,15 +22,20 @@ CFLAGS = -O3 -arch arm64 CXX=clang++ CC=clang +# assuming libomp and fftw are installed through homebrew +OMP_ROOT = $(shell brew --prefix libomp) +FFTW_ROOT = $(shell brew --prefix fftw) + # taken from makefile... -CFLAGS += -I include -I/usr/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/libomp/include +CFLAGS += -I include -I/usr/local/include -I$(OMP_ROOT)/include -I$(FFTW_ROOT)/include FFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS) -LIBS += -L/usr/local/lib -L/opt/homebrew/lib -L/opt/homebrew/opt/libomp/lib +LIBS += -L/usr/local/lib -L$(OMP_ROOT)/lib -L$(FFTW_ROOT)/lib +LDFLAGS += -arch arm64 -target arm64-apple-macos11 # OpenMP with clang needs following... OMPFLAGS = -Xpreprocessor -fopenmp -OMPLIBS = -L/usr/local/lib -L/opt/homebrew/lib -lomp +OMPLIBS = -lomp # since fftw3_omp doesn't work in OSX, we need... FFTWOMPSUFFIX=threads