karnikram / autocalib-sensor-extrinsics

2018 GSoC Project with MRPT
BSD 3-Clause "New" or "Revised" License
12 stars 6 forks source link

can not include mrpt library #25

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi! I try to use autocalib-sensor-extrinsics project.

First, I built mrpt (from master branch) at my home directory (/hone/username/mrpt/build) (mrpt build was complete!)

Second, I try to build autocalib-sensor-extrinsics follow your build command at my home directory

git clone https://github.com/karnikram/autocalib-sensor-extrinsics
cd autocalib-sensor-extrinsics
mkdir build && cd build
cmake ..
make
./gui/autocalib-sensor-extrinsics 

But, at make step, the error is occured

Scanning dependencies of target core
[  3%] Building CXX object core/CMakeFiles/core.dir/CObservationTree.cpp.o
In file included from /home/jinho-sesol/auto_calib/autocalib-sensor-extrinsics/core/CObservationTree.h:3:0,
                 from /home/jinho-sesol/auto_calib/autocalib-sensor-extrinsics/core/CObservationTree.cpp:1:
/home/jinho-sesol/auto_calib/autocalib-sensor-extrinsics/core/Utils.h:6:10: fatal error: mrpt/img/TCamera.h: No such file or directory
 #include <mrpt/img/TCamera.h>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
core/CMakeFiles/core.dir/build.make:62: recipe for target 'core/CMakeFiles/core.dir/CObservationTree.cpp.o' failed
make[2]: *** [core/CMakeFiles/core.dir/CObservationTree.cpp.o] Error 1
CMakeFiles/Makefile2:140: recipe for target 'core/CMakeFiles/core.dir/all' failed
make[1]: *** [core/CMakeFiles/core.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Even though mrpt build was complete, It seems to not find mrpt libs and some files. How can I fix this problem?

karnikram commented 4 years ago

Hi,

Thank you for your interest in this project. It appears that CMake was unable to locate the MRPT library files. After building MRPT, did you run make install? That is required to install the library files to the /usr/local space, from where CMake should automatically be able to pick it up.

Else, modify this line to find_package(MRPT COMPONENTS obs serialization rtti maps gui pbmap QUIET PATHS "/your/mrpt/build/path")

Let me know if this helps. But please also note that this app in its current state doesn't give good results and needs more fixing.

ghost commented 4 years ago

Thanks for your reply.

I do 'make install' and I check there are some file about mrpt where /usr/local/include and /usr/local/lib.

Also, I modified that line to find_package(MRPT COMPONENTS obs serialization rtti maps gui pbmap QUIET PATHS "/home/mrpt/build") but same error is occured.

++ I have some question. I'm using virtual environment with anaconda. If I compile this project in virtual env, then cmake can not detect library files in /usr/local ?

(++ thank you for making this project. I hope you will complete this!!!)

karnikram commented 4 years ago

Hi,

If adding PATHS did not work you can instead pass your build directory as an argument to cmake as follows, cmake .. -DCMAKE_PREFIX_PATH=/home/karnik/tools/mrpt/build

With this, cmake will be able to find mrpt irrespective of how your conda environment is configured. However I'm afraid the project still might not build completely due to changes in the dependency sources that this project hasn't been updated for.