[pytango] 304/483: new way to define numpy compilation version
Sandor Bodo-Merle
sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:53 UTC 2017
This is an automated email from the git hooks/post-receive script.
sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.
commit 142acc84bc184d8f74c62c0fe57fbefc9bc8291a
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date: Sun Nov 17 10:32:19 2013 +0000
new way to define numpy compilation version
git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@24233 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
Makefile | 4 +---
setup.py | 4 +---
src/boost/cpp/constants.cpp | 6 ++----
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 13a92fd..d171dde 100644
--- a/Makefile
+++ b/Makefile
@@ -49,8 +49,6 @@ else
NUMPY_INC = -I$(NUMPY_ROOT)/include
endif
-PYTANGO_NUMPY_VERSION = $(shell $(PY_EXC) -c "import sys, numpy; sys.stdout.write(numpy.__version__)")
-
ifndef prefix
ifdef user
_PY_DIR=$(shell $(PY_EXC) -c "import sys, os; sys.stdout.write(os.path.split(os.path.join(os.path.dirname(os.__file__)))[1])")
@@ -131,7 +129,7 @@ INCLUDE_DIRS += \
$(PY_INC) \
$(NUMPY_INC)
-MACROS := -DNDEBUG -DPYTANGO_NUMPY_VERSION=$(PYTANGO_NUMPY_VERSION) -DPYTANGO_HAS_UNIQUE_PTR
+MACROS := -DNDEBUG -DPYTANGO_HAS_UNIQUE_PTR
CFLAGS := -pthread -fno-strict-aliasing -fwrapv -Wall -fPIC $(OPTIMIZE_CC) $(MACROS) $(TANGO_CFLAGS) $(INCLUDE_DIRS)
LNFLAGS := $(LN_DIRS) $(LN_LIBS)
diff --git a/setup.py b/setup.py
index ee351be..293dde4 100644
--- a/setup.py
+++ b/setup.py
@@ -367,9 +367,7 @@ def main():
if numpy_c_include is not None:
directories['include_dirs'].append(numpy_c_include)
- if has_numpy():
- macros.append(('PYTANGO_NUMPY_VERSION', numpy.__version__))
- else:
+ if not has_numpy():
macros.append(('DISABLE_PYTANGO_NUMPY', None))
if 'posix' in os.name:
diff --git a/src/boost/cpp/constants.cpp b/src/boost/cpp/constants.cpp
index ef4b510..f5c64de 100644
--- a/src/boost/cpp/constants.cpp
+++ b/src/boost/cpp/constants.cpp
@@ -11,9 +11,7 @@
#include "precompiled_header.hpp"
#include <tango.h>
-
-#define _TOSTRING(s) #s
-#define TOSTRING(s) _TOSTRING(s)
+#include "tango_numpy.h"
using namespace boost::python;
@@ -35,7 +33,7 @@ void export_constants()
#endif
#ifdef PYTANGO_NUMPY_VERSION
- consts_scope.attr("NUMPY_VERSION") = TOSTRING(PYTANGO_NUMPY_VERSION);
+ consts_scope.attr("NUMPY_VERSION") = NPY_VERSION;
#else
consts_scope.attr("NUMPY_VERSION") = "0.0.0";
#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git
More information about the debian-science-commits
mailing list