On Apr 23, 7:53 pm, Dag Sverre Seljebotn <
da...@student.matnat.uio.no>
wrote:
> (or flags you pass to install(), or something). But I totally agree that
> some information in numpy.pxd understandable to pyximport is the way to
> go. (I just don't have the time to champion it on the mailing list and
> implement it..)
So do I, I'm going to try and champion python+Cython as a viable,
intuitive and (hopefully) bulletproof approach at work, that won't
leave me much time to delve deeply into pyximport's implementation.
I don't see anything pertaining to a pyximport configuration
mechanism, apart from the arguments that can be passed to
pyximport.install().
So, for anyone stumbling upon this thread looking for a quick
solution, open site-packages/pyximport/pyximport.py and add
## RJVB
try:
from numpy import get_include as numpy_get_include
numpy_include_dir = [numpy_get_include()]
except:
numpy_include_dir = []
for instance above the definition for get_distutils_extension, and
modify that function so it reads
def get_distutils_extension(modname, pyxfilename):
## RJVB removed stale code
extension_mod,setup_args = handle_special_build(modname,
pyxfilename)
if not extension_mod:
from distutils.extension import Extension
## RJVB: added the include_dirs argument
extension_mod = Extension(name = modname,
sources=[pyxfilename], include_dirs=numpy_include_dir)
return extension_mod,setup_args
and cross your fingers you'll never trigger a special build ;)
R.