Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NumPy 2 support #323

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,14 @@ ifeq ($(DO_CHECKS), 1)
# NUMPY is available -> next step should not fail
# That's why we are not checking if the NUMPY_INCL_FLAG is defined.
ifeq ($(NUMPY_CHECKED), 0)
export NUMPY_INCL_FLAG := $(shell $(PYTHON) -c "from __future__ import print_function; import numpy; print('-isystem ' + numpy.__path__[0] + '/core/include/numpy/')")
export NUMPY_INCL_FLAG := $(shell $(PYTHON) -c "from __future__ import print_function; import numpy; print('-isystem ' + numpy.get_include())")
# Take the second word -> the path (the first word is "isystem")
NUMPY_INCL_PATH := $(word 2, ${NUMPY_INCL_FLAG})
# Now check that the 'arrayobject.h' file is present in the
# supposed numpy directory. Otherwise, compilation will fail.
# The absence of the file likely indicates a missing numpy-devel
# package (see issue #134 on github)
NUMPY_NEEDED_HEADER_FILE := ${NUMPY_INCL_PATH}arrayobject.h
NUMPY_NEEDED_HEADER_FILE := ${NUMPY_INCL_PATH}/numpy/arrayobject.h
ifeq (,$(wildcard ${NUMPY_NEEDED_HEADER_FILE}))
$(error Required $(ccred)numpy headers$(ccreset) are missing...stopping the compilation. You might be able to fix this by installing $(ccblue)numpy-devel$(ccreset))
endif
Expand Down
2 changes: 1 addition & 1 deletion mocks/python_bindings/_countpairs_mocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <Python.h>

/* Now, include the numpy header*/
#include <arrayobject.h>
#include <numpy/arrayobject.h>

//for correlation functions
#include "countpairs_rp_pi_mocks.h"
Expand Down
2 changes: 1 addition & 1 deletion theory/python_bindings/_countpairs.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <stdint.h>

/* Now, include the numpy header*/
#include <arrayobject.h>
#include <numpy/arrayobject.h>

//for correlation functions
#include "countpairs.h"
Expand Down
Loading