stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
http://stack-of-tasks.github.io/pinocchio/
BSD 2-Clause "Simplified" License
1.67k stars 357 forks source link

undefined reference to `boost::filesystem::detail::path_algorithms::find_root_directory` #2237

Closed wzjscut closed 1 month ago

wzjscut commented 1 month ago

Bug description

cannot build the project in ubuntu20.04

Reproduction steps

I follow the installation step and when I use make, it returns the erros

/usr/bin/ld: ../src/libpinocchio.so.2.7.1: undefined reference to boost::filesystem::detail::path_algorithms::append_v3(boost::filesystem::path&, char const*, char const*)' /usr/bin/ld: ../src/libpinocchio.so.2.7.1: undefined reference toboost::filesystem::detail::path_algorithms::find_root_directory(boost::filesystem::path const&)' /usr/bin/ld: ../bindings/python/pinocchio/pinocchio_pywrap.cpython-38-x86_64-linux-gnu.so.2.7.1: undefined reference to `boost::python::instance_holder::allocate(_object*, unsigned long, unsigned long, unsigned long)' collect2: error: ld returned 1 exit status make[2]: [unittest/CMakeFiles/test-cpp-python_parser.dir/build.make:99: unittest/test-cpp-python_parser] Error 1 make[2]: Leaving directory '/home/ubuntu/hand/pinocchio/build' make[1]: [CMakeFiles/Makefile2:2076: unittest/CMakeFiles/test-cpp-python_parser.dir/all] Error 2 make[1]: Leaving directory '/home/ubuntu/hand/pinocchio/build' make: *** [Makefile:144: all] Error 2

System

i use the command dpkg -S /usr/include/boost/version.hpp and check the boost version of my system libboost1.71-dev:amd64: /usr/include/boost/version.hpp

nim65s commented 1 month ago

Can you provide the output of the env command ?

wzjscut commented 1 month ago

Can you provide the output of the env command ?

env
SHELL=/bin/bash
ROS_VERSION=1
SESSION_MANAGER=local/wzj:@/tmp/.ICE-unix/2659,unix/wzj:/tmp/.ICE-unix/2659
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
CONDA_MKL_INTERFACE_LAYER_BACKUP=
GTK_IM_MODULE=fcitx
CONDA_EXE=/home/ubuntu/anaconda3/bin/conda
_CE_M=
PKG_CONFIG_PATH=/opt/ros/noetic/lib/pkgconfig:/opt/ros/noetic/lib/x86_64-linux-gnu/pkgconfig
ROS_PYTHON_VERSION=3
LANGUAGE=en_US:en
QT4_IM_MODULE=fcitx
LC_ADDRESS=en_HK.UTF-8
GNOME_SHELL_SESSION_MODE=ubuntu
LC_NAME=en_HK.UTF-8
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XMODIFIERS=@im=fcitx
DESKTOP_SESSION=ubuntu
LC_MONETARY=en_HK.UTF-8
SSH_AGENT_PID=2616
ROS_PACKAGE_PATH=/opt/ros/noetic/share
XML_CATALOG_FILES=file:///home/ubuntu/anaconda3/envs/ros/etc/xml/catalog file:///etc/xml/catalog
GTK_MODULES=gail:atk-bridge
ROSLISP_PACKAGE_DIRECTORIES=
PWD=/home/ubuntu/hand/pinocchio
LOGNAME=ubuntu
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=x11
CONDA_PREFIX=/home/ubuntu/anaconda3/envs/ros
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
XAUTHORITY=/run/user/1000/gdm/Xauthority
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
WINDOWPATH=2
HOME=/home/ubuntu
USERNAME=ubuntu
IM_CONFIG_PHASE=1
LC_PAPER=en_HK.UTF-8
LANG=en_US.UTF-8
ROS_ETC_DIR=/opt/ros/noetic/etc/ros
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=ubuntu:GNOME
VTE_VERSION=6003
CONDA_PROMPT_MODIFIER=(ros) 
CMAKE_PREFIX_PATH=/opt/ros/noetic
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/7eae121c_239a_4dc3_8a0d_751dfe21b8e5
INVOCATION_ID=c6b3c91a1b414ba7bb76572373519d2d
MANAGERPID=2501
CLUTTER_IM_MODULE=fcitx
GJS_DEBUG_OUTPUT=stderr
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
PYTHONPATH=/opt/ros/noetic/lib/python3/dist-packages::/home/ubuntu/hand/raisim/dgrasp/raisim/linux/lib
TERM=xterm-256color
LC_IDENTIFICATION=en_HK.UTF-8
_CE_CONDA=
LESSOPEN=| /usr/bin/lesspipe %s
USER=ubuntu
GNOME_TERMINAL_SERVICE=:1.240
CONDA_SHLVL=2
DISPLAY=:1
SHLVL=1
LC_TELEPHONE=en_HK.UTF-8
ROS_MASTER_URI=http://localhost:11311
QT_IM_MODULE=fcitx
LC_MEASUREMENT=en_HK.UTF-8
PAPERSIZE=a4
CONDA_PYTHON_EXE=/home/ubuntu/anaconda3/bin/python
LD_LIBRARY_PATH=/opt/ros/noetic/lib:/opt/ros/noetic/lib/x86_64-linux-gnu::/home/ubuntu/hand/raisim/dgrasp/raisim/linux/lib
XDG_RUNTIME_DIR=/run/user/1000
CONDA_DEFAULT_ENV=ros
LC_TIME=en_HK.UTF-8
JOURNAL_STREAM=8:103078
XDG_DATA_DIRS=/usr/share/ubuntu:/home/ubuntu/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
PATH=/opt/ros/noetic/bin:/home/ubuntu/anaconda3/envs/ros/bin:/home/ubuntu/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
GDMSESSION=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
CONDA_PREFIX_1=/home/ubuntu/anaconda3
ROS_ROOT=/opt/ros/noetic/share/ros
ROS_DISTRO=noetic
LC_NUMERIC=en_HK.UTF-8
MKL_INTERFACE_LAYER=LP64,GNU
OLDPWD=/home/ubuntu
_=/usr/bin/env
nim65s commented 1 month ago

You have conda in there, and it is possible that conda provide another boost version somewhere.

You must choose either

  1. using conda (and in this case you should not have things finding /usr/include/boost)
  2. not using conda ( and in this case, you should not have anything with "conda" in this env output)