Commit 319a7d4b authored by Julien Jerphanion's avatar Julien Jerphanion

Adapt Cython setup

parent 81496912
INCLUDE_DIRS = -I/usr/include/python3.8
EXE = main
EXE = kdtree
CXX = g++
CPPFLAGS = -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS)
LDFLAGS += -Wl,--unresolved-symbols=ignore-all
MACROS = -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
LDLIBS = -lcrypto -lfmt
EXT_SUFFIX := $(shell python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
EXT = $(EXE)$(EXT_SUFFIX)
......@@ -28,7 +29,7 @@ nopython: $(EXE)
%: %.cpp
@echo "[C++ Compiling $^ -> $@]"
$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@
$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) $(MACROS) -o $@
# Run without Python runtime
runnopython: $(EXE)
......
# distutils: language = c++
# cython: language_level = 3
import numpy as np
cimport numpy as cnp
......
......@@ -4,9 +4,10 @@ from Cython.Build import cythonize
extensions = [
Extension(
"main",
"kdtree",
language="c++",
sources=["main.pyx"],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
sources=["kdtree.pyx"],
libraries=["crypto", "fmt"],
),
]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment