How to add Eigen library to c project. For example, use the query 'c install eigen library code blocks' – Thomas Matthews Apr 13 '16 at 20:32 @ThomasMatthews yes, the problem is, when i go to project build options linker settings tab add library, I don't know what file to choose!
I was kind of desperate: For my research I need to work with Eigen and CMake. I'm capable to make use of Eigen if I duplicate the entire collection in the web directories where my compiler looks by default but mainly because quickly as I try to find it via
I obtain the following error:
findpackage(Eigen3 Needed)
I obtain the following error:
Now I looked for options but all I those I attempted (also those available on stackoverflow:
Look for package Eigen3 for CMake or CMake Can't find Eigen3 )did not really function.My Eigen Version (based to the Macros in
Look for package Eigen3 for CMake or CMake Can't find Eigen3 )did not really function.My Eigen Version (based to the Macros in
Core/util/Macros.h
) will be 3.2.5.I keep the Eigen listing in/usr/nearby/include
, I use theFindEigen3.cmake
which arrives with the Eigen collection and myCMakeLists.txt
looks as comes after:Offers anyone an concept what's heading incorrect?
Type respect,Julien
Neighborhood♦
JulienJulien
2 Answers
Turning my comment into an answer
The find package scripts - like
FindEigen3.cmake
- normally use thefindpath
control to identify the package's i9000 include directory site (discover it's paperwork for the full details).FindEigen3.cmake
utilizes the using program code snippet:So it appears in
CMAKEINSTALLPREFIX
which on Unix/Linux owners will be/usr/local
by default.The using has worked well for me:
- Go to the
Eigen
supply website directory and run the CMake and installation steps - Then duplicate - as you possess carried out -
FindEigen3.cmake
to your projects source directory website. - Now your program code does discover
Eigen
(simply transformed tolisting(APPEND.)
)
References
Neighborhood♦
FlorianFlorian21.7k44 gold badges5454 metallic badges7777 bronze badges
Add the path of
Jens LöpkenFindEigen3.cmake
beforefindpackage(Eigen3 REQUIRED)
, like this:1,41911 yellow metal logo1414 metallic badges2323 bronze badges
youkeyouke
Not the response you're also searching for? Search other questions labeled ccmakeeigen3 or ask your personal issue.
I have got set up
libeigen3-dev
in purchase to compile programs using Eigen 3. when I include a file, like asEigen/Dense
I get this error when I attempt to operateg
:Working the pursuing line functions fine:
g -I /usr/consist of/eigen3/ src/main.cpp -MMD -std=c11
shouldn'capital t that consist of website directory be instantly discovered by GCC because I set up the Eigen package through abilities? Why are usually increase and OpenGL discovered automatically when I set up the your local library but not Eigen? (Notice that eigen will be a header-only collection, but that shouldn't issue ideal?)
Operating
gary the gadget guy src/major.cpp -MMD -std=c11 -verbose
produces the adhering to output:quant
quantquant6,8351818 silver badges7272 silver badges143143 bronze badges
6 Answers
Run your compiler with the
-verbose
switch:If your includes are relatives to one of the pathways shown in this output, you wear't have to make use of
-I
. It depends how gcc offers been configured, and it depends where that additional stuff is usually set up.Take note that
.
is certainly typically not really in the -We paths.Afterwards
After exchanging a few of feedback it is usually obvious that
/usr/include/eigen3/Eigen/Dense
should become include-able by#include lt;Eigen/Densegt;
, but not by#include lt;eigen3/Eigen/Densegt;
. Consequently, the inclusion of the order line option-I /usr/consist of/eigen3
is definitely necessary.Whether some installation selects to set up header files into a index that in one of the ones put together into gcc, is dependent on the default, a choice made by the provider, or a choice made during installation. I'd state that 'regularly utilized' header data files (Increase) are usually well positioned into /usr/local/include while some 'elitist' things would become better off in a index of its personal.
launelaune28.5k33 gold badges2020 silver badges3131 bronze badges
I acquired this exact same issue on my Ubuntu 14 box. Ended up creating symlinks to obtain around it. With eigen3 set up in /usr/nearby/include perform the using:
You should right now be capable to include the headers by:
kbrownkbrown
raksiraksi
Yuchen ZhongYuchen Zhong13.3k88 money badges101101 metallic badges139139 bronze badges
This worked well for me (using Macports for setting up Shogun on Mac Operating-system 10.11):
scottlittlescottlittle6,63533 platinum badges2828 sterling silver badges5151 bronze badges
If you follow the getting started directions at the major Eigen site then you can't move far wrong.
To surmise, download after that extract the Eigen resource program code into a website directory of selection. Next copy the 'Eigen' index into
/usr/local/include/
. Notice this is the directory site named 'Eigen' WITHIN the directory structure taken out, NOT the whole directory framework itself. It worked well for me on an Ubuntu 14.04 virtual machine.badPhysicistbadPhysicist