Currently writing a C extension for Python, I successfully compiled and use the numpy C-API within the main/loader file of the module extension.
I am now trying to move the logic into a different C file. Following the documented procedure, I set up the following declarations.
Inside the module loader file:
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#define PY_ARRAY_UNIQUE_SYMBOL CCMAP_ARRAY_API
#include "numpy/arrayobject.h"
Inside the file carrying the interactions with the numpy API
#define NO_IMPORT_ARRAY
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#define PY_ARRAY_UNIQUE_SYMBOL CCMAP_ARRAY_API
#include <Python.h>
#include "numpy/arrayobject.h"
The compilation breaks on the file carrying the interactions w/ the numpy API
In file included from ccmap/src/molecular_object.c:1:
In file included from ccmap/include/molecular_object.h:25:
In file included from /Users/MYNAME/Library/Caches/pypoetry/virtualenvs/pcmap-zIv2c8Xw-py3.9/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5:
In file included from /Users/MYNAME/Library/Caches/pypoetry/virtualenvs/pcmap-zIv2c8Xw-py3.9/lib/python3.9/site-packages/numpy/core/include/numpy/npy_interrupt.h:23:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/signal.h:69:42: error: use of undeclared identifier 'NSIG'
extern __const char *__const sys_signame[NSIG];
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/signal.h:70:42: error: use of undeclared identifier 'NSIG'
extern __const char *__const sys_siglist[NSIG];
^
2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
Under MacOS 11.6, I am missing a point here. Should I change/adapt my toolchain for such a seemingly minor change in file organization ?