ethz-asl/segmap

catkin build segmapper fails on building minkindr_gtsam

Closed this issue · 2 comments

Hi,
I have a problem when building segmapper. I can't build minkindr_gtsam because it complains that mkl.h does not exist.

Errors     << minkindr_gtsam:make /home/tuan/segmap_ws/logs/minkindr_gtsam/build.make.003.log                     
In file included from /usr/include/eigen3/Eigen/Core:84:0,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/tuan/segmap_ws/devel/include/gtsam/base/OptionalJacobian.h:22,
                 from /home/tuan/segmap_ws/devel/include/gtsam/base/Matrix.h:25,
                 from /home/tuan/segmap_ws/devel/include/gtsam/base/Manifold.h:22,
                 from /home/tuan/segmap_ws/src/minkindr_gtsam/minkindr_gtsam/include/kindr/minimal/quat-transformation-gtsam.h:28,
                 from /home/tuan/segmap_ws/src/minkindr_gtsam/minkindr_gtsam/src/quat-transformation-gtsam.cc:25:
**/usr/include/eigen3/Eigen/src/Core/util/MKL_support.h:57:21: fatal error: mkl.h: No such file or directory
compilation terminated.**
make[2]: *** [CMakeFiles/minkindr_gtsam.dir/src/quat-transformation-gtsam.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/eigen3/Eigen/Core:84:0,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/tuan/segmap_ws/devel/include/gtsam/base/OptionalJacobian.h:22,
                 from /home/tuan/segmap_ws/devel/include/gtsam/base/Matrix.h:25,
                 from /home/tuan/segmap_ws/devel/include/gtsam/base/Manifold.h:22,
                 from /home/tuan/segmap_ws/src/minkindr_gtsam/minkindr_gtsam/include/kindr/minimal/rotation-quaternion-gtsam.h:28,
                 from /home/tuan/segmap_ws/src/minkindr_gtsam/minkindr_gtsam/src/rotation-quaternion-gtsam.cc:25:
**/usr/include/eigen3/Eigen/src/Core/util/MKL_support.h:57:21: fatal error: mkl.h: No such file or directory
compilation terminated.**
make[2]: *** [CMakeFiles/minkindr_gtsam.dir/src/rotation-quaternion-gtsam.cc.o] Error 1
make[1]: *** [CMakeFiles/minkindr_gtsam.dir/all] Error 2
make: *** [all] Error 2
cd /home/tuan/segmap_ws/build/minkindr_gtsam; catkin build --get-env minkindr_gtsam | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -

I verified that I have mkl.h installed at opt/intel/mkl/include. My $PATH is as follows:

echo $PATH
/opt/ros/kinetic/bin:/opt/intel/mkl/intel64:/usr/local/cuda-9.1/extras/CUPTI/lib64:/usr/local/cuda-9.1/lib64:/usr/local/cuda-9.1/bin:/usr/lib/ccache:/home/tuan/bin:/home/tuan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I have no idea what causes this. Any help is greatly appreciated!

smauq commented

Can you give more details about how did you install eigen? Is it a custom install or from the default apt repositories? Eigen should also compile without MKL support, it seems you have a flag set to compile with MKL support.

As for a solution, first thing is that $PATH in linux is where binaries are searched. The compiler will look for header files in the locations pointed by $CPATH. Afterwards libraries, e.g. .so files, are searched for in the locations pointed by $LD_LIBRARY_PATH.

@smauq Thank you for your quick reply. I installed eigen by sudo apt-get install libeigen3-dev. I export mkl library to $CPATH and it compiled :) Thank you for your help!