From 47c5e711c02a2a56e5f4953c337cdc530e081cee Mon Sep 17 00:00:00 2001 From: Sergey Yakubov <sergey.yakubov@desy.de> Date: Wed, 13 Mar 2019 14:53:32 +0100 Subject: [PATCH] add numpy include dirs --- worker/api/python/CMakeLists.txt | 1 + worker/api/python/dist/setup.py.in | 3 ++- worker/api/python/setup.py.in | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/worker/api/python/CMakeLists.txt b/worker/api/python/CMakeLists.txt index 7cd955501..50df63185 100644 --- a/worker/api/python/CMakeLists.txt +++ b/worker/api/python/CMakeLists.txt @@ -1,5 +1,6 @@ get_property(ASAPO_WORKER_LIB TARGET asapo-worker PROPERTY LOCATION) + set (ASAPO_WORKER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/include) if ((CMAKE_BUILD_TYPE STREQUAL "Debug") AND (CMAKE_C_COMPILER_ID STREQUAL "GNU")) diff --git a/worker/api/python/dist/setup.py.in b/worker/api/python/dist/setup.py.in index af7bef476..2400bdddd 100644 --- a/worker/api/python/dist/setup.py.in +++ b/worker/api/python/dist/setup.py.in @@ -1,11 +1,12 @@ from distutils.core import setup from distutils.core import Extension +import numpy ext_modules = [ Extension("asapo_worker", ["asapo_worker.cpp"], extra_objects=['lib/libasapo-worker.a', 'lib/libcurl.a'], - include_dirs=["include/common","include"], + include_dirs=["include/common","include",numpy.get_include()], extra_compile_args=@EXTRA_COMPILE_ARGS@, extra_link_args=@EXTRA_LINK_ARGS@, language="c++") diff --git a/worker/api/python/setup.py.in b/worker/api/python/setup.py.in index f76c70d93..6d61825cf 100644 --- a/worker/api/python/setup.py.in +++ b/worker/api/python/setup.py.in @@ -3,13 +3,15 @@ from distutils.core import Extension from Cython.Build import cythonize +import numpy + module = Extension("asapo_worker", ["asapo_worker.pyx"], extra_objects=['@ASAPO_WORKER_LIB@', '@CURL_LIBRARIES@'], - include_dirs=["@ASAPO_CXX_COMMON_INCLUDE_DIR@","@ASAPO_WORKER_INCLUDE_DIR@"], + include_dirs=["@ASAPO_CXX_COMMON_INCLUDE_DIR@","@ASAPO_WORKER_INCLUDE_DIR@",numpy.get_include()], extra_compile_args=@EXTRA_COMPILE_ARGS@, extra_link_args=@EXTRA_LINK_ARGS@, - language="c++" + language="c++", ) ext_modules = cythonize([module]) -- GitLab