提交 98f066da authored 作者: Frederic's avatar Frederic

don't disable the old API as we still use it at a few places.

上级 66c970d8
...@@ -1453,10 +1453,14 @@ class GCC_compiler(object): ...@@ -1453,10 +1453,14 @@ class GCC_compiler(object):
@staticmethod @staticmethod
def compile_args(): def compile_args():
cxxflags = [flag for flag in config.gcc.cxxflags.split(' ') if flag] cxxflags = [flag for flag in config.gcc.cxxflags.split(' ') if flag]
cxxflags.append("-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION") #NumPy 1.7 Deprecate the old API. I updated most of the places
#to use the new API, but not everywhere. When finished, enable
#the following macro to assert that we don't bring new code
#that use the old API.
#cxxflags.append("-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION")
numpy_ver = [int(n) for n in numpy.__version__.split('.')[:2]] numpy_ver = [int(n) for n in numpy.__version__.split('.')[:2]]
# numpy 1.7b1 replaced NPY_ENSURECOPY to NPY_ARRAY_ENSURECOPY # numpy 1.7b1 replaced NPY_ENSURECOPY to NPY_ARRAY_ENSURECOPY
# that didn't existed # that didn't existed before.
if bool(numpy_ver < [1, 7]): if bool(numpy_ver < [1, 7]):
cxxflags.append("-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY") cxxflags.append("-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY")
return cxxflags return cxxflags
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论