New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with old version of Boost and eigenpy >= 2.9.0 #1851
Conversation
645592b
to
b0e0bdd
Compare
Related to #1851 |
I don't know what you mean by "old", but for the record, it was still crashing (although not systematically) when compiling from source on Ubuntu 18 using Boost 1.78. |
1.71 shoudl work. At least, it works well on my side with Gcc from Ubuntu 18.04 and Boost 1.71 and more. Could you try on your side @duburcqa? |
You mean before of after the patch ? I can double check, but for me it was not working before your patch on Ubuntu 18.0, Python 3.6, Boost 1.78. I did the check in a docker container to avoid side-effects. |
My patch only makes a difference for Boost < 1.71. How do you install Boost on the docker image ? |
I'm trying to write a self contained reproduction script. |
I can confirm that I have a setup where calling |
A docker image will be perfect on my side. |
I'm just running a bunch of commands on a bare metal official
Maybe it is. I'm just building everything from source. |
Here it is ! docker run -it ubuntu:18.04 apt update
apt install -y git cmake python3-pip
python3 -m pip install --upgrade pip numpy sphinx setuptools
###################################################
git clone https://github.com/boostorg/boost.git "/boost"
cd "/boost"
git checkout --force "boost-1.76.0"
git submodule --quiet update --init --recursive --jobs 8
git clone https://gitlab.com/libeigen/eigen.git "/eigen3"
cd "/eigen3"
git checkout --force "3.4.0"
git clone https://github.com/stack-of-tasks/eigenpy.git "/eigenpy"
cd "/eigenpy"
git checkout --force "v2.9.0"
git submodule update --init
git clone https://github.com/robotology-dependencies/tinyxml.git "/tinyxml"
cd "/tinyxml"
git checkout --force "master"
git clone https://github.com/ros/console_bridge.git "/console_bridge"
cd "/console_bridge"
git checkout --force "0.3.2"
git clone https://github.com/ros/urdfdom_headers.git "/urdfdom_headers"
cd "/urdfdom_headers"
git checkout --force "1.0.4"
git clone https://github.com/ros/urdfdom.git "/urdfdom"
cd "/urdfdom"
git checkout --force "1.0.3"
git clone https://github.com/stack-of-tasks/pinocchio.git "/pinocchio"
cd "/pinocchio"
git checkout --force "v2.6.15"
git submodule update --init
###################################################
CMAKE_CXX_FLAGS="-fPIC -O3 -DNDEBUG"
PYTHON_EXECUTABLE="/usr/bin/python3"
mkdir -p "/install"
unset Boost_ROOT
cd "/boost"
./bootstrap.sh --prefix="//install" --with-python="${PYTHON_EXECUTABLE}"
CMAKE_CXX_FLAGS_B2="-std=c++11"
mkdir -p "/boost/build"
./b2 --prefix="//install" --build-dir="//boost/build" \
--with-chrono --with-timer --with-date_time --with-system --with-test \
--with-filesystem --with-atomic --with-serialization --with-thread \
--with-python \
--build-type=minimal --layout=system --lto=off \
architecture= address-model=64 \
threading=single link=shared runtime-link=shared debug-symbols=off \
cxxflags="${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_B2}" \
linkflags="${CMAKE_CXX_FLAGS_B2}" \
variant="release" install -q -d0 -j12
mkdir -p "/eigen3/build"
cd "/eigen3/build"
cmake "//eigen3" -Wno-dev -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX="//install" \
-DBUILD_TESTING=OFF -DEIGEN_BUILD_PKGCONFIG=ON \
-DCMAKE_BUILD_TYPE="Release"
make install -j12
mkdir -p "/eigenpy/build"
cd "/eigenpy/build"
cmake "//eigenpy" -Wno-dev -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX="//install" \
-DCMAKE_PREFIX_PATH="//install" -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-DPYTHON_STANDARD_LAYOUT=ON -DBoost_NO_SYSTEM_PATHS=TRUE -DBoost_NO_BOOST_CMAKE=TRUE \
-DBOOST_ROOT="//install" -DBoost_INCLUDE_DIR="//install/include" \
-DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" -DCMAKE_BUILD_TYPE="Release"
make install -j12
mkdir -p "/tinyxml/build"
cd "/tinyxml/build"
cmake "//tinyxml" -Wno-dev -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX="//install" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -DTIXML_USE_STL" -DCMAKE_BUILD_TYPE="Release"
make install -j12
mkdir -p "/console_bridge/build"
cd "/console_bridge/build"
cmake "//console_bridge" -Wno-dev -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX="//install" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" -DCMAKE_BUILD_TYPE="Release"
make install -j12
mkdir -p "/urdfdom_headers/build"
cd "/urdfdom_headers/build"
cmake "//urdfdom_headers" -Wno-dev -DCMAKE_INSTALL_PREFIX="//install" -DCMAKE_BUILD_TYPE="Release"
make install -j12
mkdir -p "/urdfdom/build"
cd "/urdfdom/build"
cmake "//urdfdom" -Wno-dev -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX="//install" \
-DCMAKE_PREFIX_PATH="//install" -DBUILD_TESTING=OFF \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" -DCMAKE_BUILD_TYPE="Release"
make install -j12
mkdir -p "/pinocchio/build"
cd "/pinocchio/build"
cmake "//pinocchio" -Wno-dev -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX="//install" \
-DCMAKE_PREFIX_PATH="//install" -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-DPYTHON_STANDARD_LAYOUT=ON -DBoost_NO_SYSTEM_PATHS=TRUE -DBoost_NO_BOOST_CMAKE=TRUE \
-DBOOST_ROOT="//install" -DBoost_INCLUDE_DIR="//install/include" \
-DBUILD_WITH_URDF_SUPPORT=ON -DBUILD_WITH_COLLISION_SUPPORT=OFF -DBUILD_PYTHON_INTERFACE=ON \
-DBUILD_WITH_AUTODIFF_SUPPORT=OFF -DBUILD_WITH_CASADI_SUPPORT=OFF -DBUILD_WITH_CODEGEN_SUPPORT=OFF \
-DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -DBOOST_BIND_GLOBAL_PLACEHOLDERS $(
) -Wno-unused-local-typedefs -Wno-uninitialized" -DCMAKE_BUILD_TYPE="Release"
make install -j10
###################################################
PYTHON_VERSION="$(${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('py_version_short'))")"
PYTHON_USER_SITELIB="$("${PYTHON_EXECUTABLE}" -m site --user-site)"
mkdir -p "${PYTHON_USER_SITELIB}"
echo "//install/lib/python${PYTHON_VERSION}/site-packages" \
> "${PYTHON_USER_SITELIB}/user_site.pth"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/install/lib/" import pinocchio as pin
pin.Force.Zero() |
I see you use c++ 17. Which compiler do you use? |
Why don't you use pinocchio |
On it.
I thought you said it should be the same for Boost > 1.71. Will do. |
I've tested yesterday, and Pinocchio v2.6.15 was working well on Boost 1.71. I won't have the resources to generate the image as it is. Could you remove urdfdom and its dependencies? |
Could you also generate a proper docker image, otherwise, we will need time to compile? |
Once I'm done checking the other modifications you suggested. It takes some time since I'm wiping out the container after each trial to avoid side-effects.
I will try. I'm not used to it. |
Please use the docker hub to share it, etc. I think using Dockerfile mechanism will help you yo save times ;) |
I cleaned up the reproduction script following your recommendations. It is still crashing. However, compilation fails if I remove urdfdom and set |
I add to apply this patch to make it compile without error: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 076f1281..0ad2f223 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -214,9 +214,6 @@ FILE(GLOB_RECURSE HEADERS
IF(NOT BUILD_WITH_URDF_SUPPORT)
LIST(REMOVE_ITEM HEADERS
- ${PROJECT_SOURCE_DIR}/src/parsers/urdf.hpp
- ${PROJECT_SOURCE_DIR}/src/parsers/urdf/model.hxx
- ${PROJECT_SOURCE_DIR}/src/parsers/urdf/geometry.hxx
${PROJECT_SOURCE_DIR}/src/parsers/urdf/utils.hpp
${PROJECT_SOURCE_DIR}/src/parsers/urdf/types.hpp
)
diff --git a/bindings/python/pinocchio/deprecated.py b/bindings/python/pinocchio/deprecated.py
index df225b3c..1c4e5b41 100644
--- a/bindings/python/pinocchio/deprecated.py
+++ b/bindings/python/pinocchio/deprecated.py
@@ -125,9 +125,12 @@ def buildGeomFromUrdf(model, filename, *args, **kwargs):
else:
return pin.buildGeomFromUrdf(model, filename, *args, **kwargs)
-buildGeomFromUrdf.__doc__ = (
- pin.buildGeomFromUrdf.__doc__
-)
+try:
+ buildGeomFromUrdf.__doc__ = (
+ pin.buildGeomFromUrdf.__doc__
+ )
+except AttributeError:
+ del buildGeomFromUrdf
@deprecated("This function is now deprecated and will be removed in future releases of Pinocchio. "
"Please change for the new function computePotentialEnergy.") |
Here is the final version of the script: apt update
apt install -y git cmake python3-pip
python3 -m pip install --upgrade pip numpy setuptools
###################################################
git clone https://github.com/boostorg/boost.git "/boost"
cd "/boost"
git checkout --force "boost-1.76.0"
git submodule --quiet update --init --recursive --jobs 8
git clone https://gitlab.com/libeigen/eigen.git "/eigen3"
cd "/eigen3"
git checkout --force "3.4.0"
git clone https://github.com/stack-of-tasks/eigenpy.git "/eigenpy"
cd "/eigenpy"
git checkout --force "v2.9.0"
git submodule update --init
git clone https://github.com/stack-of-tasks/pinocchio.git "/pinocchio"
cd "/pinocchio"
git checkout --force "v2.6.15"
git submodule update --init
###################################################
PYTHON_EXECUTABLE="/usr/bin/python3"
mkdir -p "/install"
cd "/boost"
./bootstrap.sh --prefix="/install" --with-python="${PYTHON_EXECUTABLE}"
mkdir -p "/boost/build"
./b2 --prefix="/install" --build-dir="/boost/build" \
--with-chrono --with-timer --with-date_time --with-system --with-test \
--with-filesystem --with-atomic --with-serialization --with-thread \
--with-python --build-type=minimal --layout=system --lto=off \
architecture= address-model=64 \
threading=single link=shared runtime-link=shared debug-symbols=off \
variant="release" install -q -d0 -j16
mkdir -p "/eigen3/build"
cd "/eigen3/build"
cmake "/eigen3" -DCMAKE_INSTALL_PREFIX="/install" -DBUILD_TESTING=OFF
make install -j16
mkdir -p "/eigenpy/build"
cd "/eigenpy/build"
cmake "//eigenpy" -DCMAKE_INSTALL_PREFIX="/install" \
-DCMAKE_PREFIX_PATH="/install" -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF -DCMAKE_BUILD_TYPE="Release"
make install -j16
mkdir -p "/pinocchio/build"
cd "/pinocchio/build"
cmake "//pinocchio" -DCMAKE_INSTALL_PREFIX="/install" \
-DCMAKE_PREFIX_PATH="/install" -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-DBUILD_WITH_URDF_SUPPORT=OFF -DBUILD_WITH_COLLISION_SUPPORT=OFF -DBUILD_PYTHON_INTERFACE=ON \
-DBUILD_WITH_AUTODIFF_SUPPORT=OFF -DBUILD_WITH_CASADI_SUPPORT=OFF \
-DBUILD_WITH_CODEGEN_SUPPORT=OFF -DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF \
-DCMAKE_BUILD_TYPE="Release"
make install -j16
###################################################
PYTHON_USER_SITELIB="$("${PYTHON_EXECUTABLE}" -m site --user-site)"
mkdir -p "${PYTHON_USER_SITELIB}"
echo "/install/lib/python3/dist-packages" > "${PYTHON_USER_SITELIB}/user_site.pth"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/install/lib/" I will try to share a docker image. |
Here is the dockerfile: FROM ubuntu:18.04
COPY patch.diff /
RUN \
apt update; \
apt install -y git cmake python3-pip
RUN \
/usr/bin/python3 -m pip install --upgrade pip numpy setuptools
RUN \
git clone https://github.com/boostorg/boost.git "/boost"; \
cd "/boost"; \
git checkout --force "boost-1.76.0"; \
git submodule --quiet update --init --recursive --jobs 8; \
\
git clone https://gitlab.com/libeigen/eigen.git "/eigen3"; \
cd "/eigen3"; \
git checkout --force "3.4.0"; \
\
git clone https://github.com/stack-of-tasks/eigenpy.git "/eigenpy"; \
cd "/eigenpy"; \
git checkout --force "v2.9.0"; \
git submodule update --init; \
\
git clone https://github.com/stack-of-tasks/pinocchio.git "/pinocchio"; \
cd "/pinocchio"; \
git checkout --force "v2.6.15"; \
git submodule update --init; \
git apply /patch.diff
RUN \
mkdir -p "/install"; \
cd "/boost"; \
./bootstrap.sh --prefix="/install" --with-python="/usr/bin/python3"; \
mkdir -p "/boost/build"; \
./b2 --prefix="/install" --build-dir="/boost/build" \
--with-chrono --with-timer --with-date_time --with-system --with-test \
--with-filesystem --with-atomic --with-serialization --with-thread \
--with-python --build-type=minimal --layout=system --lto=off \
architecture= address-model=64 \
threading=single link=shared runtime-link=shared debug-symbols=off \
variant="release" install -q -d0 -j16; \
\
mkdir -p "/eigen3/build"; \
cd "/eigen3/build"; \
cmake "/eigen3" -DCMAKE_INSTALL_PREFIX="/install" -DBUILD_TESTING=OFF; \
make install -j16; \
\
mkdir -p "/eigenpy/build"; \
cd "/eigenpy/build"; \
cmake "//eigenpy" -DCMAKE_INSTALL_PREFIX="/install" \
-DCMAKE_PREFIX_PATH="/install" -DPYTHON_EXECUTABLE="/usr/bin/python3" \
-DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF -DCMAKE_BUILD_TYPE="Release"; \
make install -j16; \
\
mkdir -p "/pinocchio/build"; \
cd "/pinocchio/build"; \
cmake "//pinocchio" -DCMAKE_INSTALL_PREFIX="/install" \
-DCMAKE_PREFIX_PATH="/install" -DPYTHON_EXECUTABLE="/usr/bin/python3" \
-DBUILD_WITH_URDF_SUPPORT=OFF -DBUILD_WITH_COLLISION_SUPPORT=OFF -DBUILD_PYTHON_INTERFACE=ON \
-DBUILD_WITH_AUTODIFF_SUPPORT=OFF -DBUILD_WITH_CASADI_SUPPORT=OFF \
-DBUILD_WITH_CODEGEN_SUPPORT=OFF -DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF \
-DCMAKE_BUILD_TYPE="Release"; \
make install -j16
RUN \
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/install/lib/"; \
\
PYTHON_USER_SITELIB="$(/usr/bin/python3 -m site --user-site)"; \
mkdir -p "${PYTHON_USER_SITELIB}"; \
echo "/install/lib/python3/dist-packages" > "${PYTHON_USER_SITELIB}/user_site.pth" I'm sharing the docker image on docker hub as requested ! |
Thanks |
What is the patch.diff file? |
The patch here right above in the discussion. It is necessary to fix compilation failure with |
No description provided.