leovandriel / caffe2_cpp_tutorial

C++ transcripts of the Caffe2 Python tutorials and other C++ example code
BSD 2-Clause "Simplified" License
431 stars 94 forks source link

CMake error Eigen3 #3

Closed Sparkier closed 7 years ago

Sparkier commented 7 years ago

By following your instructions, I get the following error:

CMake Error at CMakeLists.txt:6 (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" 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.

Im running Ubuntu 16.04 LTS.

leovandriel commented 7 years ago

Hi @Sparkier. The readme is indeed not mentioning the Eigen package, which is required for the tutorials. You can install it with:

sudo apt-get install libeigen3-dev

I updated the readme. Let me know if that works. Thanks for reporting.

Sparkier commented 7 years ago

Hello @leonardvandriel , that indeed solved the issue with not finding the package. However, when running make inside caffe3_cpp_tutorial, which I assume should build all the tutorials, i get another error.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: NCCL_LIB linked by target "train" in directory /home/***********/caffe2_cpp_tutorial linked by target "retrain" in directory /home/***********/caffe2_cpp_tutorial linked by target "imagenet" in directory /home/***********/caffe2_cpp_tutorial linked by target "dream" in directory /home/***********/caffe2_cpp_tutorial linked by target "mnist" in directory /home/***********/caffe2_cpp_tutorial

leovandriel commented 7 years ago

can you see what happens if you add nccl to the CMAKE_LIBRARY_PATH:

export CMAKE_LIBRARY_PATH=$CMAKE_LIBRARY_PATH:$HOME/caffe2/third_party/nccl/build/lib

Make sure you change $HOME/caffe2 into where you installed caffe2. If that works, consider adding the line to your .bashrc.

Sparkier commented 7 years ago

Thank you, that did the trick. Don't know if that belongs here anymore though since it's not related to Eigen3.

leovandriel commented 7 years ago

no worries, excellent question. I'll add it to the readme.