My goal:
I am trying to run ORBSlam3 in a vm hosted in my local machine.In order to that I need to install Eigen3 version 3.2.1 because latest version 3.4.4 that comes with packet manager has compatibility issues with the code I am running.
Steps I have taken:
Before installing Eigen3 I have also installed Pangolin using :
cd ~/Dev
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
git checkout 86eb4975fc4fc8b5d92148c2e370045ae9bf9f5d
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j 3
sudo make install
and opencv too using :
cd ~
$ mkdir Dev && cd Dev
$ git clone https://github.com/opencv/opencv.git
$ cd opencv
$ git checkout 3.2.0
mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=Release -D WITH_CUDA=OFF -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make -j 3
$ sudo make install
As far as I know usr/local/include folder contains source code and in my case it contains 4 folders eigen3 opencv opencv2 pangolin
And my usr/local/lib/cmake folder only contains Pangolin folder which contains cmake configuration files.
I tried to build eigen3 using following code and could not generate .cmake files in usr/local/lib/cmake:
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make
$ sudo make install
When I run build.sh in my Orbslam3 folder I get following output:
-- Configuring incomplete, errors occurred!
See also "/home/orbslamhost/Dev/ORB_SLAM3/build/CMakeFiles/CMakeOutput.log".
Build type: Release
-- Using flag -std=c++11.
OPENCV VERSION:
3.2.0
CMake Error at CMakeLists.txt:47 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen3" (requested
version 3.2.1) with any of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
My questions are:
1-Why can’t I create Eigen3 configuration files while I can create Pangolin files with same command logic?
2- There is no opencv either but somehow it can be detected How is that possible?
I can edit the question to include files like CMakeLists.Since I don’t know what is important or not I want to keep the question as simple as I can.I reviewed similar questions but I may not have been able to understand it because but I have not written any cmake or source code of the project myself I just added include_directories to CmakeFile in my ORBSlam3 project and it is my first time working with cmake.
EDIT:
I have noticed that my Opencv files are located in /usr/local/share/opencv but my Pangolin file is only located in usr/local/lib/cmake
EDIT2:
When I look at CMakeCache at my orbslam folder I found :
//The directory containing a CMake configuration file for Eigen3.
Eigen3_DIR:PATH=Eigen3_DIR-NOTFOUND
//Directory of Eigen3
G2O_EIGEN3_INCLUDE:PATH=/usr/include/eigen3
//Build g2o with OpenMP support (EXPERIMENTAL)
G2O_USE_OPENMP:BOOL=OFF
//Value Computed by CMake
ORB_SLAM3_BINARY_DIR:STATIC=/home/orbslamhost/Dev/ORB_SLAM3/build
//Dependencies for the target
ORB_SLAM3_LIB_DEPENDS:STATIC=general;opencv_calib3d;general;opencv_core;general;opencv_features2d;general;opencv_flann;general;opencv_highgui;general;opencv_imgcodecs;general;opencv_imgproc;general;openc$
//Value Computed by CMake
ORB_SLAM3_SOURCE_DIR:STATIC=/home/orbslamhost/Dev/ORB_SLAM3
//The directory containing a CMake configuration file for OpenCV.
OpenCV_DIR:PATH=/usr/local/share/OpenCV
I am not still certain why Opencv and Pangolin are located in different folders.
3