Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython_plus_experiments
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julien Jerphanion
cython_plus_experiments
Commits
319a7d4b
Commit
319a7d4b
authored
Apr 21, 2021
by
Julien Jerphanion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt Cython setup
parent
81496912
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
kdtree/Makefile
kdtree/Makefile
+3
-2
kdtree/kdtree.pyx
kdtree/kdtree.pyx
+1
-1
kdtree/setup.py
kdtree/setup.py
+3
-2
No files found.
kdtree/Makefile
View file @
319a7d4b
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)
...
...
kdtree/
main
.pyx
→
kdtree/
kdtree
.pyx
View file @
319a7d4b
# distutils: language = c++
# cython: language_level = 3
import
numpy
as
np
cimport
numpy
as
cnp
...
...
kdtree/setup.py
View file @
319a7d4b
...
...
@@ -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"
],
),
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment