Code Monkey home page Code Monkey logo

boost.numpy's Introduction

ndarray: NumPy-friendly multidimensional arrays in C++

Build Status

ndarray is a template library that provides multidimensional array objects in C++, with an interface and features designed to mimic the Python 'numpy' package as much as possible.

More information can be found in the documentation at ndarray.github.io/ndarray.

Installation

ndarray can be built and tested with CMake:

mkdir build
cd build
cmake ..
make
make test

Inclusion and testing of optional dependencies is controlled by NDARRAY_* cmake options. Dependency resolution can be controlled by the PYBIND11_DIR, EIGEN_DIR, and FFTW_DIR environment variables. For example, to build with an alternate Eigen3 install location and disable FFTW testing replace cmake .. with EIGEN_DIR=/opt/local cmake -DNDARRY_FFTW=OFF ...

ndarray's build system does not produce the correct suffixes for pybind11 outputs under pybind11 2.1.x (due to a bug in pybind11 itself). To avoid this problem, please upgrade to pybind11 2.2.x, or try the (now reverted) patch from ndarray commit f46c0f0ff876ceab5aaa3286e5f6e86902e72feb.

Version 1.4.2 of ndarray is the last version to support SWIG.

Version 1.5.3 of ndarray is the last verison to support Boost.Python.

boost.numpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boost.numpy's Issues

to_python_converter

I wanted to convert a c++ object to ndarray to be used in python so I wrote a to_python_converter. In the to_python_converter function I have constructed the ndarray object and verified it contains the data that I want through the str function. At the end of the code I have something like:

return boost::python::incref(the_array);

but when I use it in python, the ndarray I got has the right dimension but garbage data, although inside of the to_python_converter c++ code, the ndarray object has been created properly. Any hint on what the issue was? Thanks.

ndarray data ownership question

Hi,

Lets say I have a

boost::shared_ptrstd::vector vp;

What is the best way to construct a numpy array and return it?

I am currently using:

std::vector &vec(*vp);

np::from_data(vec.data(), np::dtype::get_builtin() , p::make_tuple(vec.size()), p::make_tuple(sizeof(int)), owner);

The question is: what should I put for owner? I'd like to be able to call vp.reset() in my C++ code [and therefore giving up ownership] and have python manage the memory as long as it needs to (and clean up if the python object is ever del'ed).

I am assuming having a p::object() on the stack, but I am guessing that it is probably not a good thing (as it will destruct when my function ends). So, I can create a "dummy" owner and have it linger around in my c++ code, but that'll keep objects around longer than they are needed (essentially leaking memory, w/o technically doing so).

Thanks in advance.

Python 3.4.3 not compatible Boost Numpy

My Python version is 3.4.3, and I am trying to build Boost Numpy support for My Python Version

I revised the CMakeLists.txt as the second graph:
python_requirement

CmakeList result is passed and described as the third graph:
my_cmakelist

However, when I try to make in Boost Numpy, there are the error for bad value, /usr/local/lib/libpython3.4m.a: error adding symbols
boost_numpy_error

Do Someone Know about how to solve this issue?

build on py3

I just checked out fresh copy of master. I had to fix one config test 1st:

diff --git a/python.py b/python.py
index 21a918e..e99445e 100644
--- a/python.py
+++ b/python.py
@@ -97,8 +97,12 @@ def CheckNumPy(context):
 #undef _DEBUG
 #include "Python.h"
 #include "numpy/arrayobject.h"
+#if PY_MAJOR_VERSION == 2
 void doImport() {
-  import_array();
+#else
+void * doImport() {
+#endif
+    import_array();
 }
 int main()
 {

But now build stops, hard to track this down:

/usr/bin/python3 /home/nbecker/scons/bootstrap/src/script/scons.py --config=force --debug=stacktrace --with-boost-include=/home/nbecker/ndarray.new/../include --with-boost-lib=/home/nbecker/ndarray.new/../lib --with-eigen-include=/usr/include/eigen3 --prefix=/home/nbecker/ndarray.new/../.local install CCFLAGS=-g -O3 -march=native --boost-python-lib=boost_python3
scons: Reading SConscript files ...
Check building with Eigen... yes
Check building against fftw... yes

*** No errors detected
Check building against Boost.Test... yes
Check building against Python... yes
Check building against NumPy... yes
Checking for SWIG...no
Check building against Boost.Preprocessor... yes
Check building against Boost.Python... yes
  File "<string>", line 20

    bin = env.Program(target="%s.test" % source, source=source)

                                                              ^

TabError: inconsistent use of tabs and spaces in indentation

Linking with libpython.a

Some Python installation have a static library libpython.a that gets linked into the test executable build and run by TryLink and TryRun. But then, for embedded Python like you use in those snippets, some care is needed for the link flags, as explained in the official Python doc. Hence the following proposed patch:

diff --git a/SConscript b/SConscript
index 7d9eb74..b88d524 100644
--- a/SConscript
+++ b/SConscript
@@ -58,6 +58,10 @@ int main()
     match = re.search("(python.*)\.(a|so|dylib)", libfile)
     if match:
         context.env.AppendUnique(LIBS=[match.group(1)])
+        if match.group(2) == 'a':
+            flag = distutils.sysconfig.get_config_var('LINKFORSHARED')
+            if flag is not None:
+                context.env.AppendUnique(LDFLAGS=flag)
     flags = [f for f in " ".join(distutils.sysconfig.get_config_vars("MODLIBS", "SHLIBS")).split()
              if f != "-L"]
     context.env.MergeFlags(" ".join(flags))

Fail building wrapp.cpp.o

Dear all
I tried to build Boost.NumPy with python3.4, np 1.8.1 and boost 1.55.0 on ubuntu

First build with CMake-init.sh went right but when i tried to "make" in the created build directory I came up againt an error when building the wrap.cpp.o in the example directory?

[ 68%] Building CXX object libs/numpy/example/CMakeFiles/wrap.dir/wrap.cpp.o
../libs/numpy/example/wrap.cpp: In function ‘int main(int, char**)’:
../libs/numpy/example/wrap.cpp:114:40: error: ‘initexample’ was not declared in this scope
     PyImport_AppendInittab("example", &initexample);
                                        ^
make[2]: *** [libs/numpy/example/CMakeFiles/wrap.dir/wrap.cpp.o] Erreur 1
make[1]: *** [libs/numpy/example/CMakeFiles/wrap.dir/all] Erreur 2
make: *** [all] Erreur 2

Boost.NumPy license.

Hi

We would like to use your library but we're unsure what license you released it under. Please could you add a license file or add something to the readme ?

Thanks!

barnaby.

Simple example for exchanging ndarrays between Python and C++ extension

I've been searching for a simple example that shows how to exchange NumPy arrays between Python and an extension module written in C++ w/ Boost Python.

Let's make it a bit more concrete. How would you do the following:

  1. Create a NumPy array in Python
  2. Import extension module written in C++ with Boost Python and pass the array to a function in the module
  3. The function does some simple operation on the array -- say square each element -- and returns the modified array, perhaps with a different size, to Python.

Also, if my C++ mostly needs data as vector< vector< double > >or double **, would using the ndarray interface in the C-code incur a lot of performance overhead?

Compiling error: relocation R_X86_64_32

When building Boost.NumPy using CMake, I get the following compiling error when running the make command:

Linking CXX shared library ../../../lib/libboost_numpy.so
/usr/bin/ld: /hpc/sw/python-2.7.5/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/hpc/sw/python-2.7.5/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/libboost_numpy.so] Error 1
make[1]: *** [libs/numpy/src/CMakeFiles/boost_numpy.dir/all] Error 2
make: *** [all] Error 2

This is after creating a build directory and running cmake.
This means that there are some static libraries which have to be recompiled into dynamic ones. How should I proceed?

Warning with clang, icc

Hi
Thank you for the library.
Here are some warnings by clang or icc
Best regards

CLANG :
/home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp:53:5: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
int const multi_iter::get_nd() const
^~~~~~
/home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp:63:13: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
Py_intptr_t const multi_iter::shape(int n) const

ICC 👍
In file included from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy.hpp(14),
from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/internal.hpp(28),
from /home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(7):
/home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/ndarray.hpp(90): warning #858: type qualifier on return type is meaningless
int const shape(int n) const { return get_shape()[n]; }
^

In file included from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy.hpp(14),
from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/internal.hpp(28),
from /home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(7):
/home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/ndarray.hpp(93): warning #858: type qualifier on return type is meaningless
int const strides(int n) const { return get_strides()[n]; }
^

In file included from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy.hpp(14),
from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/internal.hpp(28),
from /home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(7):
/home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/ndarray.hpp(119): warning #858: type qualifier on return type is meaningless
int const get_nd() const { return get_struct()->nd; }
^

In file included from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy.hpp(14),
from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/internal.hpp(28),
from /home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(7):
/home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/ndarray.hpp(122): warning #858: type qualifier on return type is meaningless
bitflag const get_flags() const;
^

In file included from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy.hpp(17),
from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/internal.hpp(28),
from /home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(7):
/home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/ufunc.hpp(55): warning #858: type qualifier on return type is meaningless
int const get_nd() const;
^

In file included from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy.hpp(17),
from /home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/internal.hpp(28),
from /home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(7):
/home/warin/GIT_REPOS/libstoc/boostpython/boost/numpy/ufunc.hpp(61): warning #858: type qualifier on return type is meaningless
Py_intptr_t const shape(int n) const;
^

/home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(53): warning #858: type qualifier on return type is meaningless
int const multi_iter::get_nd() const
^

/home/warin/GIT_REPOS/libstoc/boostpython/libs/numpy/src/ufunc.cpp(63): warning #858: type qualifier on return type is meaningless
Py_intptr_t const multi_iter::shape(int n) const
^

problem compiling with scons

Hi there,
I pulled the latest version of boost.numpy from github and tried to compile it with scons.
It failed with an error:
TypeError: cannot concatenate 'str' and 'NoneType' objects:
File "/home/benjamin/Documents/Holo3D/external_libs/Boost.NumPy/SConstruct", line 21:
setupTargets(env)
File "/home/benjamin/Documents/Holo3D/external_libs/Boost.NumPy/SConscript", line 236:
lib = SConscript(os.path.join(root, "libs", "numpy", "src", "SConscript"), exports='env')
File "/usr/lib/scons/SCons/Script/SConscript.py", line 609:
return method(_args, *_kw)
File "/usr/lib/scons/SCons/Script/SConscript.py", line 546:
return _SConscript(self.fs, _files, *_subst_kw)
File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
exec file in call_stack[-1].globals
File "/home/benjamin/Documents/Holo3D/external_libs/Boost.NumPy/libs/numpy/src/SConscript", line 30:
LIB_BOOST_NUMPY = ('boost_numpy' + LIB_SUFFIX)

I changed that line to:
LIB_BOOST_NUMPY = ('boost_numpy' + EXT_SUFFIX)

and everything compiled fine.

Sorry, I don't have a diff to submit. The LIB_SUFFIX should probably be deleted. It's not used anymore

Cheers
Ben

Test failure on Mac OS X/MacPorts

I get the following error when compiling Boost.Numpy:

ERROR: testIntegers (main.DtypeTestCase)

Traceback (most recent call last):
File "/Users/jack/src/ndarray/Boost.NumPy/libs/numpy/test/dtype.py", line 23, in testIntegers
self.assertEquivalent(fs(s(1)), numpy.dtype(s))
ArgumentError: Python argument types in
dtype_mod.accept_int64(numpy.int64)
did not match C++ signature:
accept_int64(long long)

with both the Apple clang compiler and MacPorts gcc 4.7. I am running numpy 1.6.2 and boost 1.52.0 both compiled with macports on an x64 system. Let me know if you need any more specific information. boost.numpy seems to work fine nonetheless, but then I don't think I pass any arrays with integers in them.

Jack

Error in Linux installation - file not found

Hi,

I am trying to install this in a Ubuntu system. The build files get generated but when I execute make the following error occurs ( in attached picture). Any help will be much appreciated. Thank you.

Regards,
Priyanka
screenshot from 2016-07-28 16-26-39

Misprint in CMakeLists.txt

Probably, instead of
set(BUILD_TEST ON CACHE BOOL "Build Boost.NumPy Tests")
there must be
set(BUILD_TESTS ON CACHE BOOL "Build Boost.NumPy Tests")

dtype dt = dtype::get_builtin<double>() segfaults

Running in Boost.Python-ized code. Both numpy and boost-numpy are standard Gentoo ebuilds. (I noticed a mention of segfault behavior upon using dtype, in a comment related to a previous issue.) Before I try an end-around to get things built with debugging symbols, I wanted to see if this is a known problem.

Running python (2.7) under gdb crashes at the referenced line with:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5f7e787 in boost::numpy::dtype boost::numpy::detail::get_float_dtype<64>() () from /usr/lib64/libboost_numpy.so

Running python under valgrind gives no access errors before hitting the segfault.

Thanks,
Eric

Kernel dies at boost::numpy::initialize() with Anaconda / non-native python command

Running demo_gaussian.py with gaussian.so using the native python (in my mac the /usr/bin/python2.7 I get the example to work correctly.
However, reinstalling Boost.Numpy with Cmake while modifying
DPYTHON_LIBRARY=/<path_to_anaconda>/libpython2.7.dylib
DPYTHON_EXECUTABLE=/<path_to_anaconda>/python2.7
I get to crash the kernel any time I try to initialise boost::bumpy

However, it is still working fine with /usr/bin/python2.7 command

Possible bug

The following program compiles with clang++, but it fails with g++. Not sure if it is a gcc or a Boost.NumPy issue.

$ g++ --version
g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2

I tried with boost 1.52 and 1.49 .

-- test.cpp --

include <boost/bind/apply.hpp>

include <boost/numpy.hpp>

int main() { return 0; }

-- eof --

g++ -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/boost-numpy/incl -I/usr/include/python2.7 -c test.cpp

In file included from /usr/local/boost-numpy/incl/boost/numpy.hpp:18:0,
from test.cpp:2:
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp: In member function ‘void boost::numpy::detail::dtype_template_invoker::operator()(T_) const’:
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp:47:14: error: invalid use of ‘struct boost::apply’
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp: In member function ‘void boost::numpy::detail::dtype_template_invokerboost::reference_wrapper::operator()(T_) const’:
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp:69:14: error: invalid use of ‘struct boost::apply’
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp: In member function ‘void boost::numpy::detail::nd_template_invoker::operator()(mpl_::integral_c<int, N>) const’:
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp:90:30: error: type/value mismatch at argument 1 in template parameter list for ‘template struct boost::apply’
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp:90:30: error: expected a type, got ‘N’
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp: In member function ‘void boost::numpy::detail::nd_template_invokerboost::reference_wrapper::operator()(mpl
::integral_c<int, N>_) const’:
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp:110:30: error: type/value mismatch at argument 1 in template parameter list for ‘template struct boost::apply’
/usr/local/boost-numpy/incl/boost/numpy/invoke_matching.hpp:110:30: error: expected a type, got ‘N’

create two array in one python function

Hi,

I really like this library. It is convenient to use and have good examples.

I created two numpy arrays in one python function using from_data. The owner is bp::object().

Although the two arrays were stored separately in memory, the first array was always over written by the second array! I think that this may be due to the same owner, but have no idea to fix it!

access violation in dtype::get_builtin<>() with python 3.4.3

Hello,

first of all, thank you very much for building this great library. Unfortuately I have trouble making it work.

When creating new ndarrays, it seems dtype::get_builtin<>() is quite essential, and this is exactly the function which seems to cause problems. When code such as this is called from python, it causes an access violation in python.exe

void array_test::sum(boost::python::numeric::array arr)
{
boost::numpy::dtype::get_builtin< double >();
return(5);
}

The debugger takes me down into dtype.cpp to these lines (57 onwards):

BUILTIN_FLOAT_DTYPE(64);

This happens with Python 3.4.3 (Anaconda), Boost::Python 1.59, Boost::Numpy from two days ago, on two independent Windows 7 Machines. And with various template arguments, too.

Could this be due to the python version? Is it actually okay, to use 3.x?

Segfault when calling `boost::numpy::get_builtin<T>`

Hi,

the problem occures when a shared library compiled with Boost.NumPy is linked to an executable.

To reprodue:

git clone http://github.com/alendit/boost_numpy_segfault.git
cd boost_numpy_segfault
./compile.sh  # will clone boost.numpy and compile it
./run.sh  # executes the binary and crash

See the Makefile for compile flags. The problem isn't limited to double, the same issue occurs when I use other types.

Tested with clang-3.5 and gcc-4.9 on Ubuntu 14.10 with libboost-1.55.0.

Build failure on CentOS using cmake: return-statement with a value, in function returning 'void'

Hello,
I'm trying to install boost.numpy on my CentOS 6.6 platform using cmake and python 3.5.0 and numpy 1.10.0:

cmake -DPYTHON_LIBRARY=/usr/local/lib/libpython3.5m.so -D Boost_NO_BOOST_CMAKE=ON ../

-- Configuring project "BoostNumpy"
:
:
ImportError: No module named 'sphinx'
-- - Sphinx not found, "make html" will do nothing at all.
-- Project "BoostNumpy" configured.
-- + Now, type-in "cd /root/BoostNumpy-master/build && make && make test && make html && make install"!
-- + "BoostNumpy" will be installed in /usr/local.
-- Configuring done
-- Generating done
-- Build files have been written to: /root/BoostNumpy-master/build

make

[ 8%] Building CXX object CMakeFiles/boost_numpy.dir/src/boost/numpy/numpy.cpp.o
/root/BoostNumpy-master/src/boost/numpy/numpy.cpp: In function ‘void boost::numpy::initialize()’:
/root/BoostNumpy-master/src/boost/numpy/numpy.cpp:50: error: return-statement with a value, in function returning 'void'
make[2]: *** [CMakeFiles/boost_numpy.dir/src/boost/numpy/numpy.cpp.o] Error 1
make[1]: *** [CMakeFiles/boost_numpy.dir/all] Error 2
make: *** [all] Error 2

Suggestions and advice appreciated!

Thank you

conversion of int64 to unsigned long fails in Python 3

From @nbecker's email:

This code works on py2, but on py3 I get:

burst.pilot_xsyms = gold_code_generator (-1, -1) (burst.n_pilot_syms) Boost.Python.ArgumentError: Python argument types in
gold_code_generator.call(gold_code_generator, numpy.int64) did not match C++ signature:
call(gold_code_generator {lvalue}, unsigned long)
call(gold_code_generator {lvalue})

it seems unsigned long matches np.int64 on py2 but not py3. Any thoughts?

When I ran make in ./build, there were lots of "undefined reference" errors.

➜ build git:(master) make
Scanning dependencies of target boost_numpy
[ 7%] Building CXX object libs/numpy/src/CMakeFiles/boost_numpy.dir/dtype.cpp.o
In file included from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/boost/numpy/internal.hpp:26,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/libs/numpy/src/dtype.cpp:9:
/home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
[ 15%] Building CXX object libs/numpy/src/CMakeFiles/boost_numpy.dir/scalars.cpp.o
In file included from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/boost/numpy/internal.hpp:26,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/libs/numpy/src/scalars.cpp:7:
/home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
[ 23%] Building CXX object libs/numpy/src/CMakeFiles/boost_numpy.dir/ndarray.cpp.o
In file included from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/boost/numpy/internal.hpp:26,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/libs/numpy/src/ndarray.cpp:7:
/home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
[ 30%] Building CXX object libs/numpy/src/CMakeFiles/boost_numpy.dir/matrix.cpp.o
In file included from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/boost/numpy/internal.hpp:26,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/libs/numpy/src/matrix.cpp:7:
/home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
[ 38%] Building CXX object libs/numpy/src/CMakeFiles/boost_numpy.dir/ufunc.cpp.o
In file included from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/boost/numpy/internal.hpp:26,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/libs/numpy/src/ufunc.cpp:7:
/home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
[ 46%] Building CXX object libs/numpy/src/CMakeFiles/boost_numpy.dir/numpy.cpp.o
In file included from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/boost/numpy/internal.hpp:26,
from /home/metadata/work/traffic_object_detection/Boost.NumPy/libs/numpy/src/numpy.cpp:7:
/home/metadata/.pyenv/versions/anaconda3-2.2.0/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
Linking CXX shared library ../../../lib/libboost_numpy.so
[ 46%] Built target boost_numpy
Scanning dependencies of target dtype

[ 53%] Building CXX object libs/numpy/example/CMakeFiles/dtype.dir/dtype.cpp.o
Linking CXX executable ../../../bin/dtype
CMakeFiles/dtype.dir/dtype.cpp.o: In function main': dtype.cpp:(.text+0x1a): undefined reference toPy_Initialize'
CMakeFiles/dtype.dir/dtype.cpp.o: In function boost::python::converter::arg_to_python<int>::arg_to_python(int const&)': dtype.cpp:(.text._ZN5boost6python9converter13arg_to_pythonIiEC2ERKi[_ZN5boost6python9converter13arg_to_pythonIiEC5ERKi]+0x1c): undefined reference toPyLong_FromLong'
CMakeFiles/dtype.dir/dtype.cpp.o: In function boost::python::api::object::object()': dtype.cpp:(.text._ZN5boost6python3api6objectC2Ev[_ZN5boost6python3api6objectC5Ev]+0xf): undefined reference to_Py_NoneStruct'
CMakeFiles/dtype.dir/dtype.cpp.o: In function boost::python::tuple boost::python::make_tuple<int, int>(int const&, int const&)': dtype.cpp:(.text._ZN5boost6python10make_tupleIiiEENS0_5tupleERKT_RKT0_[_ZN5boost6python10make_tupleIiiEENS0_5tupleERKT_RKT0_]+0x1b): undefined reference to PyTuple_New'
CMakeFiles/dtype.dir/dtype.cpp.o: In functionboost::python::tuple boost::python::make_tuple<char [3], boost::numpy::dtype>(char const (&) [3], boost::numpy::dtype const&)': dtype.cpp:(.text._ZN5boost6python10make_tupleIA3_cNS_5numpy5dtypeEEENS0_5tupleERKT_RKT0_[_ZN5boost6python10make_tupleIA3_cNS_5numpy5dtypeEEENS0_5tupleERKT_RKT0_]+0x1b): undefined reference to PyTuple_New'
CMakeFiles/dtype.dir/dtype.cpp.o: In functionboost::python::converter::extract_pointer<char const*>::extract_pointer(_object_)': dtype.cpp:(.text._ZN5boost6python9converter15extract_pointerIPKcEC2EP7_object[_ZN5boost6python9converter15extract_pointerIPKcEC5EP7_object]+0x1e): undefined reference to _Py_NoneStruct'
CMakeFiles/dtype.dir/dtype.cpp.o: In functionboost::python::converter::extract_pointer<char const_>::operator()() const': dtype.cpp:(.text._ZNK5boost6python9converter15extract_pointerIPKcEclEv[_ZNK5boost6python9converter15extract_pointerIPKcEclEv]+0x23): undefined reference to _Py_NoneStruct'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyList_Insert' ../../../lib/libboost_numpy.so: undefined reference to PyExc_ImportError'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyString_InternFromString' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyProperty_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyString_AsString' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyExc_StopIteration'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyUnicodeUCS4_FromEncodedObject' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyImport_Import'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyBool_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyClass_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_InPlaceRshift' ../../../lib/libboost_numpy.so: undefined reference to PyObject_CallMethod'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyIter_Next' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_Remainder'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPy_InitModule4_64' ../../../lib/libboost_numpy.so: undefined reference to PyExc_ValueError'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyType_Ready' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to _PyEval_SliceIndex'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyFile_AsFile' ../../../lib/libboost_numpy.so: undefined reference to PyLong_FromUnsignedLong'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyMem_Free' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_InPlaceXor'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_InPlaceOr' ../../../lib/libboost_numpy.so: undefined reference to PyBool_FromLong'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyDict_Items' ../../../lib/libboost_numpy.so: undefined reference to PyCapsule_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_InPlaceRemainder' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyErr_NoMemory'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyList_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyComplex_ImagAsDouble'
../../../lib/libboost_numpy.so: undefined reference toPyObject_IsTrue' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to _Py_NotImplementedStruct'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyExc_TypeError' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyDict_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_Lshift' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_InPlaceMultiply'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to_PyObject_New' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyInt_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyComplex_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyExc_ReferenceError'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyObject_GetItem' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyString_FromStringAndSize'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyModule_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_InPlaceLshift'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyString_Size' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyDict_Update'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyComplex_RealAsDouble' ../../../lib/libboost_numpy.so: undefined reference to PyErr_Format'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyBaseObject_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_And'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyUnicodeUCS4_AsWideChar' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_InPlaceAdd'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyObject_GetAttr' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyErr_ExceptionMatches'
../../../lib/libboost_numpy.so: undefined reference toPyErr_Occurred' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyDict_Copy'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyArg_ParseTupleAndKeywords' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_Divide'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyEval_GetGlobals' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyFloat_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyDict_Keys' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyExc_IndexError'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyErr_SetObject' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_Multiply'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyRun_FileExFlags' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyUnicode_Type'
../../../lib/libboost_numpy.so: undefined reference toPyObject_Size' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyString_FromString'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyString_FromFormat' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_InPlaceAnd'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyInt_FromLong' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyTuple_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyDict_Size' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyDict_GetItem'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyObject_SetItem' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyInt_AsLong'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyObject_RichCompare' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyCFunction_NewEx'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyDict_Values' ../../../lib/libboost_numpy.so: undefined reference to PyExc_RuntimeError'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_Rshift' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyStaticMethod_New'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyType_IsSubtype' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyType_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_Add' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyList_Sort'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPySequence_DelSlice' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyErr_WarnEx'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyMethod_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyStaticMethod_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_Xor' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyObject_ClearWeakRefs'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_Subtract' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PySlice_New'
../../../lib/libboost_numpy.so: undefined reference toPyObject_GetAttrString' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyObject_IsInstance'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyLong_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyRun_StringFlags'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyObject_SetAttrString' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyExc_OverflowError'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyWeakref_NewRef' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyErr_NewException'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyList_Append' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyObject_SetAttr'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyDict_GetItemString' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyNumber_InPlaceDivide'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyLong_AsLongLong' ../../../lib/libboost_numpy.so: undefined reference to PyErr_Print'
../../../lib/libboost_numpy.so: undefined reference toPyExc_AttributeError' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyLong_AsUnsignedLongLong'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_Or' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyObject_DelItem'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyNumber_InPlaceSubtract' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyMethod_New'
../../../lib/libboost_numpy.so: undefined reference toPyEval_CallFunction' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PySequence_GetSlice'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyTuple_Size' ../../../lib/libboost_numpy.so: undefined reference to PyImport_ImportModule'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyErr_Clear' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyCFunction_Type'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyTuple_GetItem' ../../../lib/libboost_numpy.so: undefined reference to PyErr_SetString'
../../../lib/libboost_numpy.so: undefined reference toPyObject_CallFunction' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyList_Reverse'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyString_Type' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyFile_FromString'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to_PyType_Lookup' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyList_New'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyType_GenericAlloc' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyMem_Malloc'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyCallable_Check' ../../../lib/libboost_numpy.so: undefined reference to PyCapsule_GetPointer'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyDict_Clear' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PySequence_SetSlice'
/home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference toPyLong_AsUnsignedLong' /home/metadata/work/traffic_object_detection/boost_1_58_0/stage/lib/libboost_python3.so: undefined reference to PyDict_New'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/dtype] Error 1
make[1]: *** [libs/numpy/example/CMakeFiles/dtype.dir/all] Error 2
make: *** [all] Error 2

I solved the boost numpy for opencv

I just studied how is the numpy is made this is just a c++ function to write a file from a numpy image taken from opencv

      void gray_trans(np::ndarray& array) {
       if (array.get_dtype() != np::dtype::get_builtin<uchar>())
      {
           PyErr_SetString(PyExc_TypeError, "Incorrect array data type.");
           throw_error_already_set();

       }

    int rows = array.shape(0), cols = array.shape(1); 
    cout <<"row: "<< rows <<"\n";

    cout << "cols: "<< cols <<"\n"; 

    uchar *row_iter = reinterpret_cast<uchar*>(array.get_data());

    Mat mat(rows, cols, CV_8UC3);
    mat.data = (uchar *) row_iter;

    imwrite("result_Check.jpg",mat);

}

dtype test fails in testIntegers

On my Ubuntu i686 box dtype test fails on int32

/usr/bin/python /home/kolpakov/repos/ndarray-mine/Boost.NumPy/libs/numpy/test/dtype.py
.E
======================================================================
ERROR: testIntegers (__main__.DtypeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kolpakov/repos/ndarray-mine/Boost.NumPy/libs/numpy/test/dtype.py", line 15, in testIntegers
    self.assertEqual(fs(s(1)), numpy.dtype(s))
ArgumentError: Python argument types in
    dtype_mod.accept_int32(numpy.int32)
did not match C++ signature:
    accept_int32(int)

----------------------------------------------------------------------
Ran 2 tests in 0.041s

I guess it might be related to
http://projects.scipy.org/numpy/ticket/1246

I have

kolpakov@dell-epfl:~/repos/ndarray-mine$ find /usr/include/numpy/ | xargs grep -i "typedef.*int32;"
/usr/include/numpy/npy_common.h:        typedef long npy_int32;
/usr/include/numpy/npy_common.h:        typedef npy_longlong npy_int32;
/usr/include/numpy/npy_common.h:        typedef int npy_int32;
/usr/include/numpy/npy_common.h:        typedef short npy_int32;
/usr/include/numpy/npy_common.h:        typedef signed char npy_int32;

and

kolpakov@dell-epfl:~/repos/ndarray-mine$ find /usr/include/boost/ | xargs grep -i "typedef.* int32_t;"
/usr/include/boost/cstdint.hpp:     typedef int             int32_t;
/usr/include/boost/cstdint.hpp:     typedef short             int32_t;
/usr/include/boost/cstdint.hpp:     typedef long            int32_t;
/usr/include/boost/cstdint.hpp:      typedef __int32           int32_t; 

Can't build using SCons

Thanks for providing this, but couldn't get anywhere with building using scons. Executing scons gives the following result :

scons: Reading SConscript files ...
Checking if we can build against Python... TypeError: expected string or buffer:
  File "C:\Users\Andrew\dev\lib\Boost.NumPy\SConstruct", line 17:
    if not (config.CheckPython() and config.CheckNumPy() and config.CheckBoostPython()):
  File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.2.0\SCons\SConf.py", line 640:
    ret = self.test(context, *args, **kw)
  File "C:\Users\Andrew\dev\lib\Boost.NumPy\SConscript", line 58:
    match = re.search("(python.*)\.(a|so|dylib)", libfile)
  File "C:\Python27\lib\re.py", line 142:
    return _compile(pattern, flags).search(string)

Using Scons 2.2 for Python 2.7 x64 with Boost 1.51

Cheers,
Andrew.

vector has become more fragile

After pulling all recent updates, I'm having new problems related to type deduction (code that previously compiled now fails). For example:

int BITS_PER_SYM = llr_mask.getShape()[1];
int n_syms = llr_mask.getShape()[0];
int syms_per_burst = intrlv_soft.getShape()[0]/BITS_PER_SYM;
auto shape = nd::makeVector (syms_per_burst, BITS_PER_SYM);

auto w = nd::Array<flt_t,2,2> (nd::external (intrlv_soft.getData(), shape, nd::ROW_MAJOR, intrlv_soft.getManager()));

/home/nbecker/.local/include/ndarray/initialization.h:239:23: error: no matching function for call to 'computeStrides(const ndarray::Vector<int, 2>&, ndarray::DataOrderEnum&)'
In file included from /home/nbecker/.local/include/ndarray.h:21:0,
from /home/nbecker/.local/include/ndarray/bp/Array.h:15,
from /home/nbecker/.local/include/ndarray/bp/auto/Array.h:16,
from /home/nbecker/.local/include/ndarray/bp/auto.h:14,
from llr.cc:6:
/home/nbecker/.local/include/ndarray/initialization.h:152:18: note: candidate: template ndarray::Vector<long int, M> ndarray::computeStrides(const ndarray::Vector<long unsigned int, M>&, ndarray::DataOrderEnum)
Vector<Offset,N> computeStrides(Vector<Size,N> const & shape, DataOrderEnum order=ROW_MAJOR) {
^~~~~~~~~~~~~~
/home/nbecker/.local/include/ndarray/initialization.h:152:18: note: template argument deduction/substitution failed:
In file included from /home/nbecker/.local/include/ndarray.h:21:0,
from /home/nbecker/.local/include/ndarray/bp/Array.h:15,
from /home/nbecker/.local/include/ndarray/bp/auto/Array.h:16,
from /home/nbecker/.local/include/ndarray/bp/auto.h:14,
from llr.cc:6:
/home/nbecker/.local/include/ndarray/initialization.h:239:23: note: mismatched types 'long unsigned int' and 'int'
computeStrides(shape, order),

Trouble building with scons

Hi,

I'm trying to build this on Windows 32 bit. I have Python 2.7, numpy and boost.python. This is my output:

scons: Reading SConscript files ...
Checking if we can build against Python... TypeError: expected string or buffer:
  File "C:\src\git\Boost.NumPy\SConstruct", line 17:
    if not (config.CheckPython() and config.CheckNumPy() and config.CheckBoostPython()):
  File "C:\Python27\Lib\site-packages\scons-2.2.0\SCons\SConf.py", line 640:
    ret = self.test(context, *args, **kw)
  File "C:\src\git\Boost.NumPy\SConscript", line 58:
    match = re.search("(python.*)\.(a|so|dylib)", libfile)
  File "C:\Python27\lib\re.py", line 142:
    return _compile(pattern, flags).search(string)

Thanks

support cmake build

I would like to build Boost.NumPy using cmake. I use cmake on my development projects and need to have a cmake build of Boost.NumPy. I should have a reasonable solution within a week. If you are interested, I can I submit my changes/additions to you. If so, how should I go about it? Do you have suggestions or recommendations on how you would like this done?

Note that I am discussing this in the context of having a cmake module for Boost.NumPy. I am not discussing it with respect to the greater Boost cmake effort.

cannot find boost_python

when i try to do a cmake i get the cannot find boost_python error, anyone knows how to fix this? Thanks.

Hyciss-MacBook-Pro:build Hycis$ cmake ..
-- Using Python2
CMake Error at /usr/local/Cellar/cmake/3.3.1/share/cmake/Modules/FindBoost.cmake:1245 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.58.0

  Boost include path: /usr/local/include

  Could not find the following Boost libraries:

          boost_python

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:41 (find_package)


-- Boost Paths:
-- Include  : /usr/local/include
-- Libraries: 
-- Configuring incomplete, errors occurred!
See also "/Volumes/Storage/Packages/Boost.NumPy/build/CMakeFiles/CMakeOutput.log".

investigate dtype test failures on non-Linux64 platforms

The dtypes unit test seems quite fragile, and often fails when the library is otherwise working correctly. Problems have been confirmed on Mac OS and Windows, but have not been seen on Linux64.

The problem is probably related to the long-standing issue with multiple C/C++ types being mapped to the same NumPy type (or different NumPy types with the same name, so only one is accessible from Python), but the test itself may be at fault.

Wrong matrix values arrive in python

Hello, I am receiving "interesting" results. The values, I put into a matrix on the C-Side differ from the values I get on the python side.

Here is my code.

C:

#include <boost/python.hpp>
#include <boost/numpy.hpp>
#include <boost/scoped_array.hpp>
#include <iostream>

namespace p = boost::python;
namespace np = boost::numpy;

np::ndarray getNdArray(){
    np::dtype dt = np::dtype::get_builtin<uint8_t>();
    uint8_t mul_data[][4] = {{1,2,3,4},{5,6,7,8},{1,3,5,7}};
    // Create a shape, and strides, needed by the function
    p::tuple shape = p::make_tuple(3,2) ;
    p::tuple stride = p::make_tuple(4,2) ; 
    // The function also needs an owner, to keep track of the data array passed. Passing none is dangerous
    np::ndarray mul_data_ex = np::from_data(mul_data,dt, p::make_tuple(3,4),p::make_tuple(4,1),p::object());

    std::cout << "Original multi dimensional array :: " << std::endl << p::extract < char const * > (p::str(mul_data_ex)) << std::endl ;
    return mul_data_ex;
}

BOOST_PYTHON_MODULE(libhello)
{
    np::initialize();  // have to put this in any module that uses Boost.NumPy
    p::def("getNdArray", getNdArray);
}

Python:

import libhello
import numpy as np
print "calling for array!"
c=libhello.getNdArray()
print "Python got array: "+str(c)

And the results I receive:

calling for array!
Original multi dimensional array :: 
[[1 2 3 4]
 [5 6 7 8]
 [1 3 5 7]]
Python got array: [[  1   2   3   4]
 [  5   6   7   8]
 [104  57 240 191]]

Could you give me a hint where I could look to resolve this?

Ambiguous argument in from_data (in example + documentation)

Hi all,

First of all, thank you very much for your work, I really appreciate it to be able to use ndArrays as output/input in my code, as I use both C++ and python for my project.

I just wanted to point out that something may be a bit ambiguous in your example, and in the documentation, regarding the manipulations of ndArrays in C++ : the stride attribute.

The stride is expressed in terms of bytes, of course, that seems clear in the file "wrap.cpp"

But, when reading the files fromdata.cpp and ndarray.cpp; I see this:

// Create an array in C++
int arr[] = {1,2,3,4} ;
// Create the ndarray in Python
np::ndarray py_array = np::from_data(arr, np::dtype::get_builtin() , p::make_tuple(4), p::make_tuple(4), p::object());

As there are 4 elements in your buffer, and each element is assumed to be 4 bytes in size, it may be a bit less ambiguous to use p::make_tuple(sizeof(int)) instead of p::make_tuple(4) in the stride argument.

Of course, this is nothing important, but it would be easy to modify it, or to modify the documentation of the from_data method in order to understand easily that strides is expressed in byte.

Because here is what say the documentation :

  • the shape of the ndarray as Python object
  • the strides of each dimension of the array as a Python object

Again, this is is only an advice not a real issue at all, because I find myself having some trouble exporting data because of my misunderstanding of the stride argument in the first place.

Thank you again for your work.

Non constant expression failure in ndarray.cpp under msvc 2010

Hi,

The functions:

ndarray zeros(python::tuple const & shape, dtype const & dt)
ndarray empty(python::tuple const & shape, dtype const & dt)

in ndarray.cpp fail to compile with an error about the non constant expression:

int nd = len(shape);
Py_intptr_t dims[nd];

I believe the compiler is correct on that one. To my knowledge this kind of code is not allowed in C++ you should use new since the int returned by len is not known at compile time, I don't understand how this can compile under any platform.

I fix it temporarily using a std::vector (boost::scoped_array could be used as well) instead of C-style array. I could submit the file if you like.

Merge with Boost.Python

I'm considering ways to merge Boost.Numpy into Boost.Python. Is this a project you'd be interested participating in ? (I'm now the Boost.Python maintainer, working on a few improvements there, notably to make it easier to build Boost.Python stand-alone with only minimal dependencies towards (the rest of) Boost.

Please mention in the documentation...

Please mention in the documentatino, that it will be necessary to add the "numpy" library into the project building script.
In my case in cmake it is:

find_package(Boost COMPONENTS python numpy)
IF (NOT Boost_FOUND)
    MESSAGE(ERROR "BOOST NOT FOUND!")
endif(NOT Boost_FOUND)

always use macros to access NumPy structs

NumPy is deprecating direct access to structs for PyArray and PyArrayDescr in favor of using the macros. Need to make sure we follow those procedures in Boost.NumPy.

Support NumPy 1.7 C API

Building Boost.NumPy against current NumPy versions results in deprecation warnings, as it depends on an outdated API.
It would be great to migrate to the new NumPy API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.