FS#39727 - [eigen] Eigen folder is inside /usr/include/eigen3 and not /usr/include/
Attached to Project:
Arch Linux
Opened by Kashyap Chhatbar (decryptedepsilon) - Thursday, 03 April 2014, 14:13 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 05 April 2014, 18:03 GMT
Opened by Kashyap Chhatbar (decryptedepsilon) - Thursday, 03 April 2014, 14:13 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 05 April 2014, 18:03 GMT
|
Details
Description:
There are multiple versions of eigen library (version 2 and 3) and it installs in /usr/include/eigen2 and /usr/include/eigen3 respectively. If we try to use the headers from eigen library it throws the following error: fatal error: Eigen/Dense: No such file or directory Additional info: * package version(s): eigen3 eigen2 * test.cpp #include <fstream> #include <iostream> #include <Eigen/Dense> using namespace std; int main() { char str[10]; //Creates an instance of ofstream, and opens example.txt ofstream a_file ( "example.txt" ); // Outputs to example.txt through a_file a_file<<"This text will now be inside of example.txt"; // Close the file stream explicitly a_file.close(); //Opens for reading the file ifstream b_file ( "example.txt" ); //Reads one string from the file b_file>> str; //Should output 'this' cout<< str <<"\n"; cin.get(); // wait for a keypress // b_file is closed implicitly here } Steps to reproduce: * Install eigen3 package using pacman -S eigen3 * Create a test.cpp file which uses an Eigen header * Try to compile and compilation fails resulting in fatal error: No such file or directory found Steps to solve: * Provide a symlink of /usr/include/eigen3/Eigen to /usr/include/Eigen * It successfully compiles |
This task depends upon
Closed by Dave Reisner (falconindy)
Saturday, 05 April 2014, 18:03 GMT
Reason for closing: Not a bug
Additional comments about closing: pkg-config files provide necessary CFLAGS to make this Just Work™
Saturday, 05 April 2014, 18:03 GMT
Reason for closing: Not a bug
Additional comments about closing: pkg-config files provide necessary CFLAGS to make this Just Work™
$ pkg-config --cflags eigen
-I/usr/include/eigen3
This way, your code has "#include <Eigen/Dense>" and it Just Works™
Unrelated, the pkg-config file is in the wrong directory, but this doesn't matter for your purposes (and seems to be an upstream bug).
You should never assume where headers are installed, but get the locations with pkg-config. In this case, upstream is installing them to the eigen3 dir, so it is correct.