From dcab61e45444ed9df2c07e6c82182cf6f7e27211 Mon Sep 17 00:00:00 2001 From: ahbarnett Date: Fri, 25 Oct 2024 16:57:21 -0400 Subject: [PATCH 1/2] makefile: pass DUCC option to Python sk-build via CMAKE_ARGS in pip --- makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index c9754a376..7ba042bc7 100644 --- a/makefile +++ b/makefile @@ -98,6 +98,8 @@ ifeq ($(FFT),DUCC) DUCC_SRCS := $(DUCC_OBJS:.o=.cc) # FINUFFT's switchable FFT done via this compile directive... CXXFLAGS += -DFINUFFT_USE_DUCC0 +# tell Python skbuild also to use DUCC (note wrapping in quotes)... + PY_CMAKE_ARGS := "-DFINUFFT_USE_DUCC0=ON" else # link against FFTW3 single-threaded (leaves DUCC_OBJS and DUCC_SETUP undef) LIBSFFT += -l$(FFTWNAME) -l$(FFTWNAME)f @@ -422,7 +424,8 @@ endif # python --------------------------------------------------------------------- python: $(STATICLIB) $(DYNLIB) - FINUFFT_DIR=$(FINUFFT) $(PYTHON) -m pip -v install python/finufft +# note use of CMAKE_ARGS which needs quotes; see scikit-build docs... + FINUFFT_DIR=$(FINUFFT) CMAKE_ARGS=$(PY_CMAKE_ARGS) $(PYTHON) -m pip -v install python/finufft # note to devs: if trouble w/ NumPy, use: pip install ./python --no-deps $(PYTHON) python/finufft/test/run_accuracy_tests.py $(PYTHON) python/finufft/examples/simple1d1.py From 53515f7fa5448d8500c8dba6f42c82e88bc35357 Mon Sep 17 00:00:00 2001 From: ahbarnett Date: Fri, 1 Nov 2024 11:55:37 -0400 Subject: [PATCH 2/2] apply patch of Libin comments in PR 586 discussion --- makefile | 3 ++- python/finufft/pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 7ba042bc7..822f70065 100644 --- a/makefile +++ b/makefile @@ -117,9 +117,10 @@ ifneq ($(OMP),OFF) MFLAGS += $(MOMPFLAGS) OFLAGS += $(OOMPFLAGS) LIBS += $(OMPLIBS) + LIBSFFT += $(OMPLIBS) # fftw3 multithreaded libs... ifneq ($(FFT),DUCC) - LIBSFFT += -l$(FFTWNAME)_$(FFTWOMPSUFFIX) -l$(FFTWNAME)f_$(FFTWOMPSUFFIX) $(OMPLIBS) + LIBSFFT += -l$(FFTWNAME)_$(FFTWOMPSUFFIX) -l$(FFTWNAME)f_$(FFTWOMPSUFFIX) endif endif diff --git a/python/finufft/pyproject.toml b/python/finufft/pyproject.toml index 68f08b8f3..3ce0d2e2f 100644 --- a/python/finufft/pyproject.toml +++ b/python/finufft/pyproject.toml @@ -11,7 +11,7 @@ build-backend = "scikit_build_core.build" name = "finufft" readme = "README.md" requires-python = ">=3.8" -dependencies = ["numpy >= 1.12.0"] +dependencies = ["numpy >= 1.12.0", "packaging"] authors = [ {name = "Jeremy Magland"}, {name = "Daniel Foreman-Mackey"},