From 5d08e50588bd6dad913f48064c508bf76354f6b2 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel <guilhem.saurel@laas.fr> Date: Mon, 29 Jan 2024 21:16:45 +0100 Subject: [PATCH] do not use namespace eigenpy and define bp to fix on 18.04: ``` [ 94%] Building CXX object unittest/CMakeFiles/std_pair.dir/std_pair.cpp.o cd /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest && /usr/bin/g++ -Dstd_pair_EXPORTS -I/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0 -isystem /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include -isystem /usr/lib/python3/dist-packages/numpy/core/include -isystem /usr/include/python3.6 -isystem /usr/include/eigen3 -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion -pipe -O3 -DNDEBUG -fPIC -std=gnu++14 -o CMakeFiles/std_pair.dir/std_pair.cpp.o -c /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp: In function 'void init_module_std_pair()': /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:28:3: error: reference to 'bp' is ambiguous bp::def("std_pair_to_tuple", std_pair_to_tuple); ^~ /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:8:29: note: candidates are: namespace bp = boost::boost::python; namespace bp = boost::python; ^ In file included from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/eigenpy.hpp:9:0, from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:4: /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/fwd.hpp:81:29: note: namespace eigenpy::bp = boost::boost::python; namespace bp = boost::python; ^ /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:29:3: error: reference to 'bp' is ambiguous bp::def("copy", copy); ^~ /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:8:29: note: candidates are: namespace bp = boost::boost::python; namespace bp = boost::python; ^ In file included from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/eigenpy.hpp:9:0, from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:4: /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/fwd.hpp:81:29: note: namespace eigenpy::bp = boost::boost::python; namespace bp = boost::python; ^ ``` --- unittest/std_pair.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/unittest/std_pair.cpp b/unittest/std_pair.cpp index 5e02217f..70771c29 100644 --- a/unittest/std_pair.cpp +++ b/unittest/std_pair.cpp @@ -18,12 +18,10 @@ std::pair<T1, T2> copy(const std::pair<T1, T2>& pair) { } BOOST_PYTHON_MODULE(std_pair) { - using namespace eigenpy; - - enableEigenPy(); + eigenpy::enableEigenPy(); typedef std::pair<int, double> PairType; - StdPairConverter<PairType>::registration(); + eigenpy::StdPairConverter<PairType>::registration(); bp::def("std_pair_to_tuple", std_pair_to_tuple<int, double>); bp::def("copy", copy<int, double>); -- GitLab