Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
b33d4941
Commit
b33d4941
authored
Apr 10, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update documentation on deprecated NumPy C-API warnings.
parent
e2dcfb58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
docs/src/userguide/source_files_and_compilation.rst
docs/src/userguide/source_files_and_compilation.rst
+22
-3
No files found.
docs/src/userguide/source_files_and_compilation.rst
View file @
b33d4941
...
...
@@ -158,12 +158,31 @@ the necessary include files, e.g. for NumPy::
you have to add the path to NumPy include files. You need to add this path only
if you use ``cimport numpy``.
Despite this, you
will still get warnings like the
following from the compiler, because Cython is using a
deprecated Numpy API::
Despite this, you
may still get warnings like the following from the compiler,
because Cython is not disabling the usage of the old
deprecated Numpy API::
.../include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
For the time being, it is just a warning that you can ignore.
In Cython 3.0, you can get rid of this warning by defining the C macro
``NPY_NO_DEPRECATED_API`` as ``NPY_1_7_API_VERSION``
in your build, e.g.::
# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
or (see below)::
Extension(
...,
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
)
With older Cython releases, setting this macro will fail the C compilation,
because Cython generates code that uses this deprecated C-API. However, the
warning has no negative effects even in recent NumPy versions including 1.18.x.
You can ignore it until you (or your library's users) switch to a newer NumPy
version that removes this long deprecated API, in which case you also need to
use Cython 3.0 or later. Thus, the earlier you switch to Cython 3.0, the
better for your users.
If you need to specify compiler options, libraries to link with or other
linker options you will need to create ``Extension`` instances manually
...
...
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