Borrar filtros
Borrar filtros

mex not finding eigen library

11 visualizaciones (últimos 30 días)
Joseph
Joseph el 12 de Ag. de 2018
Editada: Walter Roberson el 12 de Ag. de 2018
I'm trying to use the Eigen 3.3.5 library with mex using Matlab2018a and OS X 10.13.6 and gcc 4.2.1. I installed it into /usr/local/lib using cmake and also put a symbolic link to it in /usr/local/include. I named the directory eigen. The terminal command gcc -xc -E -v - indicates that /usr/local/include is on the include path for gcc. Nonetheless, the command mex ep_bootdat.c (which has #include <Eigen>) results in "error: 'Eigen' file not found" I've also tried #include <eigen/Eigen> and #include <eigen>. I've also tried mex -I/usr/local/include/eigen/ ep_bootdat.c. Nothing seems to help. Can anyone suggest what might be going wrong?

Respuesta aceptada

Joseph
Joseph el 12 de Ag. de 2018
Editada: Walter Roberson el 12 de Ag. de 2018
okay, after much mucking around, I found the solution, which was #include <Eigen/Dense> in the .c file and mex ep_bootdat.c -I/usr/local/include/eigen3/ as the Matlab invocation. eigen3 was placed in /usr/local/include by the "make install" command that one is supposed to do after the cmake command, according to the eigen INSTALL documenation.

Más respuestas (1)

Joseph
Joseph el 12 de Ag. de 2018
Editada: Walter Roberson el 12 de Ag. de 2018
footnote - apparently it needs to be C++ (as in ep_bootdat.cc -I/usr/local/include/eigen3/) otherwise it errors out with a:
/usr/local/include/eigen3/Eigen/Core:82:12: fatal error: 'new' file not found
#include <new>

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by