Question

I hope I dont get downvoted, but I have search online and the Eigen wiki and I cant find instructions on how to install Eigen3 to use it on Xcode5.

I downloaded the tar file and untar it, but then I dont know where to go.

Was it helpful?

Solution

I managed to do it.

Because in Eigen3 there is no library to link to. What you have to do is to untar the downloaded file and then copy the Eigen folder into

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include

After that you can create any project and just add the headers of Eigen3

To try it, you can run a the following example given in the "Getting started" guide:

#include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd;
int main()
{
  MatrixXd m(2,2);
  m(0,0) = 3;
  m(1,0) = 2.5;
  m(0,1) = -1;
  m(1,1) = m(1,0) + m(0,1);
  std::cout << m << std::endl;
}

That has the following output:

  3  -1
2.5 1.5
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top