From a1263ab76bc87bbb9e10b20d687e91a0e4671d9a Mon Sep 17 00:00:00 2001 From: Stefan Bienert <stefan.bienert@unibas.ch> Date: Fri, 7 Feb 2020 08:49:15 +0100 Subject: [PATCH] SCHWED-4612: Dealing with the NumPy deprecation compiler warning. --- modules/mol/base/pymod/export_entity.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/mol/base/pymod/export_entity.cc b/modules/mol/base/pymod/export_entity.cc index 35b918b16..62d26b5b5 100644 --- a/modules/mol/base/pymod/export_entity.cc +++ b/modules/mol/base/pymod/export_entity.cc @@ -35,7 +35,15 @@ using namespace ost::mol; #include <ost/export_helper/generic_property_def.hh> +/* Including NumPy headers produces compiler warnings. The ones about "Using + deprecated NumPy API..." we can not get rid of. The highest NumPy version we + support is 1.6 while the non-deprecated API starts with version 1.7. + Also see the comment in modules/gfx/pymod/export_primlist.cc for further + information. +*/ #if OST_NUMPY_SUPPORT_ENABLED +#include <numpy/numpyconfig.h> +#define NPY_NO_DEPRECATED_API NPY_1_6_API_VERSION #include <numpy/arrayobject.h> #endif @@ -131,6 +139,7 @@ void export_Entity() { #if OST_NUMPY_SUPPORT_ENABLED // The following define enforces no return value when calling import_array + #undef NUMPY_IMPORT_ARRAY_RETVAL #define NUMPY_IMPORT_ARRAY_RETVAL import_array(); #endif -- GitLab