It took an afternoon to configure the Pangolin environment, and I kept encountering the error Unknown CMake command "pybind11_add_module". The author found a lot of tutorials during installation, but they did not completely solve my problem, so I inserted a tree for future generations to enjoy the shade.
installation steps
This part refers to Ubuntu20.04 - the process of installing ORB-SLAM3 from scratch in the new system (2022)
Install dependencies that may be required
# 安装Pangolin所需依赖
sudo apt install libgl1-mesa-dev
sudo apt install libglew-dev
# sudo apt install cmake # 注意以前装了就不需要安装了
sudo apt install libpython2.7-dev
# sudo apt install python-pip
# sudo python -mpip install numpy pyopengl Pillow pybind11
sudo apt install pkg-config
sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
# sudo apt install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev
# sudo apt install libdc1394-22-dev libraw1394-dev
# sudo apt install libjpeg-dev libpng-dev libtiff5-dev libopenexr-dev
clone, compile and install
git clone https://github.com/stevenlovegrove/Pangolin.git
# 或者用老版本
# git clone https://github.com/stevenlovegrove/Pangolin/tree/v0.6.git
cd Pangolin
mkdir build && cd build
cmake ..
make -j4
sudo make install
cmake
easy to run into problems at one step
Problem description: The pybind environment is missing
Prompt me that pybind11 is not installed
method exploration
Tried:
- After git clone pybind, compile and install with cmake
pybind11
For specific steps, see:
pybind11 installation and library use (ubuntu20.14) - pip install directly
pybind11
- pip installation
pytest
and so on a series of things - “sudo python -mpip install pybind11”
fruitless
The correct way ✅
In a word, Pangolin has a path to put third-party library files, but it pybind11
is empty! !
Therefore, clone it on github pybind11
and put it in the corresponding position
Supplement:
It is possible to install pybind on the virtual machine (i.e. tried method 1) , but I think this step is not necessary, readers can try to skip this step
Find third-party libraries for Pangolin
Enter the Pangolin
find ./ -name pybind11
Find the location of the third-party library [I downloaded two versions of Pangolin]
Before the compilation is successful, there should be only one pybind11
path
to enter the path, but it is empty .
download pybind11
After downloading on hithub: https://github.com/pybind/pybind11
, replace the above blank pybind11
, and then cmake ..
, success!
If this article is helpful to you, please like/collect it~