Skip to content

Commit

Permalink
Merge pull request #586 from flatironinstitute/pyducc
Browse files Browse the repository at this point in the history
makefile: pass DUCC option to Python sk-build via CMAKE_ARGS in pip
  • Loading branch information
ahbarnett authored Nov 1, 2024
2 parents b684337 + 53515f7 commit f627567
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -115,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

Expand Down Expand Up @@ -422,7 +425,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
Expand Down
2 changes: 1 addition & 1 deletion python/finufft/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit f627567

Please sign in to comment.