2

I try to install eigen3.3.7 with cmake on ubuntu 16 but cmake fails.

I follow the INSTALL file hints : 1) I extract the tar archive 2) Make a "build" dir named buildDir 3) Go to build dir : cd buildDir 4) Start cmake : cmake ../Eigen

Then the cmake process ends up with the error :

CMake Error at CMakeLists.txt:1 (include): include could not find load file:

RegexUtils

CMake Error at CMakeLists.txt:2 (test_escape_string_as_regex): Unknown CMake command "test_escape_string_as_regex".

May I ask you some hints please ? Regards Sylvain

I followed the advices of chtz, but it still fails, see below the console output :

     syl@spica:~/tmp/eigen/eigen-eigen-323c052e1731$ cat INSTALL 
Installation instructions for Eigen
***********************************
Method 2. Installing using CMake
********************************

Let's call this directory 'source_dir' (where this INSTALL file is).
Before starting, create another directory which we will call 'build_dir'.

Do:

  cd build_dir
  cmake source_dir
  make install

syl@spica:~/tmp/eigen/eigen-eigen-323c052e1731$ mkdir build && cd build

syl@spica:~/tmp/eigen/eigen-eigen-323c052e1731/build$ cmake ../
CMake Error at CMakeLists.txt:1 (include):
  include could not find load file:

    RegexUtils


CMake Error at CMakeLists.txt:2 (test_escape_string_as_regex):
  Unknown CMake command "test_escape_string_as_regex".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.5)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/syl/tmp/eigen/eigen-eigen-323c052e1731/CMakeFiles/CMakeOutput.log".
syl@spica:~/tmp/eigen/eigen-eigen-323c052e1731/build$ vim ../CMakeFiles/CMakeOutput.log

Thanks for helping.

sylwa06
  • 77
  • 10
  • 1
    The path of step 4) must point to the main directory of Eigen, not the `Eigen` subdirectory. – chtz Jun 17 '19 at 14:59
  • Hi chtz, Thanks for helping, unfortunately it still fails, see my answer below... Cheers – sylwa06 Jun 21 '19 at 12:31
  • Hi chtz, I modified my question with the new attempt results. Sorry for having put this in an answer. Thanks for your support. – sylwa06 Jun 22 '19 at 07:30
  • 1
    Are you sure that there are no artifacts left from your previous attempt? It looks like your cmake is still starting with the `Eigen/CMakeLists.txt` instead of the one in the main directory. – chtz Jun 22 '19 at 08:35
  • Hi chtz ! Before calling cmake, I delete everything in the build directory. By the way, when I extract the .tar archive and before doing anything, it exists yet a directory named "build" with a CMakeCache.txt file and a directory CMakefiles. Did you try once to use successfully the cmake installation procedure of Eigen3 on linux from the tar file ? – sylwa06 Jun 23 '19 at 16:12
  • What tar did you download? I don't see any build-directory from, e.g., using `wget http://bitbucket.org/eigen/eigen/get/3.3.7.tar.bz2; tar tf 3.3.7.tar.bz2 | grep build` – chtz Jun 23 '19 at 18:03
  • Hi chtz ! Yes you're right, the directory build was one of my attempts to build the lib. It does not exist on the original archive. Still, I don't see what's wrong in my approach :-( – sylwa06 Jun 30 '19 at 14:50
  • If you still have a spurious CMakeCache.txt file and/or a CMakeFiles subdirectory in your build directory from previous attempts you should first delete them. Then start a new try with an empty build directory. – RHertel May 21 '20 at 20:23

1 Answers1

0

This sequence of commands seems to work properly after downloading (in my case the currently latest version eigen-3.3.7):

bunzip2 eigen-3.3.7.tar.bz2
tar -xvf eigen-3.3.7.tar
cd eigen-3.3.7/
mkdir build
cd build
cmake ../.
sudo make install
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83