I have installed Boost.Numpy on Boost 1.54 (libboost-all-dev) on Ubuntu 14.04.
This version of Numpy installs the library in a structure that you can invoke it like this in C++:
#include <boost/numpy.hpp>
Newer version of Boost (i.e., Boost 1.64+) which comes with Numpy preinstalled, uses a different structure that has the format of:
#include <boost/python/numpy.hpp>
It seems that having Boost.Numpy on Boost 1.58 is not compatible with code that assumes Numpy is installed through a newer version of Boost (i.e., boost/python/numpy.hpp).
I have some code, let's say package A, (that for some reason does not work with Boost 1.64) that uses Boost 1.54 and some other software, let's say package B, that I build from source that requires Boost with Numpy (and their code assume boost/python/numpy.hpp).
I would like to make this two compatible so I can only think of two solutions:
- Modify every code in the package B and change the definition
#include <boost/python/numpy.hpp>to become<#include <boost/numpy.hpp>(although I am not sure if this will fix 100% the problem) - Move all the Numpy files from my system from where they are to
boost/pythonso they are compatible with package B (since package A does not need Numpy).
I am not sure if the two solutions will be appropriate or if there is a better way to do this? I am currently on a clean install and I don't want to break anything.
Unfortunately, I also tried to build package B with Boost 1.64 and package A with Boost 1.54 but the two are talking to each other and I found out that having the two with different Boost versions causes segmentation fault, so I definitely need to avoid this solution.
-Ldirective to make sure it links against the libraries in /usr/local/lib). – steeldriver Jul 22 '18 at 13:25src/that have includes<#include <boost/python/numpy.hpp>. – Phrixus Jul 22 '18 at 13:35lddon the executable after building it (in particular, is it the one in/usr/localor one in/usr/lib/x86_64-linux-gnufor example?) – steeldriver Jul 22 '18 at 14:57cmakeandmake. I thought this is compiling? – Phrixus Jul 22 '18 at 16:52