Home › Forum › SOFA › Building SOFA › [SOLVED] Cmake error in building SOFA : cannot find Eigen3
Tagged: 64_bits, SOFA_other, VS2012, Windows_7
- This topic has 9 replies, 4 voices, and was last updated 8 years, 10 months ago by Guillaume.
-
AuthorPosts
-
13 January 2016 at 01:38 #5317JoBlocked
Hi!
I’ve got an error as follows.
Would anyone help me?
Thanks in advance.* Windows 7(64bit), Visual studio 2012, cmake 3.2.3
SOFA is latest version(I downloaded it today from git)
=================================================================================
CMake Error at SofaFramework/CMakeLists.txt:169 (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.cmakeAdd 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.Configuring incomplete, errors occurred!
==============================================================================13 January 2016 at 08:51 #5319HugoKeymasterDear Jo,
I am not working on Windows but did you try to set a variable “Eigen3_DIR” to the path: PATH_TO_SOFA/extlibs/eigen-3.2.7 in the Cmake configuration ?
Let us know if it helps.
Cheers,
Hugo
13 January 2016 at 08:56 #5320GuillaumeKeymasterHi Jo,
CMake is supposed to auto-detect Eigen libs.
They are in YOUR_SOFA_DIR/extlibs/eigen-3.2.7After running “Configure” in CMake-GUI, search for “eigen”.
You should find these two entries :EIGEN3_INCLUDE_DIR YOUR_SOFA_DIR/extlibs/eigen-3.2.7 EIGEN_ROOT YOUR_SOFA_DIR/extlibs/eigen-3.2.7
If they are not well set, try to set them yourself and re-run “Configure”.
Regards,
Guillaume.19 January 2016 at 00:47 #5333JoBlockedThank you for answering.
These are paths in CMake.
EIGEN3_INCLUDE_DIR D:/SOFA_160113/sofa/extlibs/eigen-3.2.7
EIGEN_ROOT D:/SOFA_160113/sofa/extlibs/eigen-3.2.7
EIGEN3_DIR Eigen3_DIR-NOTFOUNDI tried to set EIGEN3_DIR path to “D:/SOFA_160113/sofa/extlibs/eigen-3.2.7”, but path was reset after I clicked “Configure” button. And then same error occured.
Do I have to install any other program for eigen3?
If so, please let me know.
Thanks again.19 January 2016 at 00:55 #5334HugoKeymasterHmm looks strange.
I will let the developers know about this, and come back to you asap.Cheers,
Hugo
19 January 2016 at 16:14 #5336FroyKeymasterEven before checking the Eigen3 variables, the error message
“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.”
is already awkward.Can you check that you have the file FindEigen3.cmake in the cmake/Modules directory ?
21 January 2016 at 01:15 #5357JoBlockedDear Froy
In my system, FindEigen3.cmake is in the D:\SOFA_160113\sofa\extlibs\eigen-3.2.7\cmake directory and there is no modules folder in D:\SOFA_160113\sofa\cmake directory.
Is this why I got an error?
If so, do you know why this happened?
I’m pretty sure that I followed all directions in your website to download and build SOFA.
Please let me some advice.
Thanks again.21 January 2016 at 07:50 #5358FroyKeymasterHello,
The fact you dont have a folder named “Modules” in your cmake is really weird (it is where all our custom cmake scripts are located so if you dont have it, CMake wont be able to detect anything, such as Eigen).
I just tried the instructions from the website to fetch the code
(executing git clone -b master git://scm.gforge.inria.fr/sofa/sofa.git with master and v15.12 branches) and I got the complete source, with contents in the directory cmake/Modules.
Maybe there was a problem when you cloned the repo ?
git might have failed and your source tree is incomplete ? Can you try again the cloning process ?22 January 2016 at 01:25 #5363JoBlockedI’m very appreciate for your help.
I found the reason and fixed it.
The error was occurred because I set the build directory same to source one.
Thus, Module directory was deleted when I pressed “configure” in CMake.
That’s the reason and now it works well.
22 January 2016 at 08:51 #5365GuillaumeKeymasterHi Jo,
Glad to see you solved your problem !
Indeed, separating source from build directory in a very clean way is one of CMake super-powers (but I didn’t know it was necessary).
It allows you to manage easily as many builds as you want from the same source (debug build, release build, GCC build, Clang build, …).Do not hesitate to come back on the forum if you have other questions.
Regards,
Guillaume.PS: Many thanks to Hugo and Froy who helped on this topic. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.