1

I'm getting an error while installing Caffe2. After the succesful build, in the sudo make install step, it throws an error as #error Caffe2 requires Eigen to be at least 3.3.0

doruk.sonmez
  • 397
  • 2
  • 5
  • 14

1 Answers1

5

The solution is:

  1. Check the Eigen version with: cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h | grep VERSION

It will show some version variable values like below:

EIGEN_WORLD_VERSION 3 EIGEN_MAJOR_VERSION 2 EIGEN_MINOR_VERSION 192

These values are telling your problem directly. Your Eigen version is 3.2.192 instead of 3.3.0. So we need to upgrade this package.

  1. Install the latest version of eigen from http://eigen.tuxfamily.org/index.php?title=Main_Page .

  2. Extract the file wherever you want and rename it to eigen3.

  3. cd /usr/include

  4. sudo rm -rf eigen3/

  5. Place the file you just extracted withsudo mv path/of/eigen3 /usr/include/

  6. Lastly check the version again with cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h | grep VERSION

You should see these variables:

EIGEN_WORLD_VERSION 3 EIGEN_MAJOR_VERSION 3 EIGEN_MINOR_VERSION 4

You can run sudo make install again in the caffe2 directory and you will see that everything will be installed succesfully!

doruk.sonmez
  • 397
  • 2
  • 5
  • 14
  • 2
    I would generally advise against overriding the contents of `/usr/include` (this may or may not be overridden by the OS at any update). Rather put a new version into `/usr/local/include` -- this has to be found by caffe2 then, of course. – chtz Mar 07 '18 at 07:38