What's the Eigen library setup for OpenFOAM?
I want to use the Eigen header file library in an OpenFOAM preconditioner but I keep getting compiler errors telling me, that Eigen is not found.
Eigen is "installed" i.e. header files are located in the directory: /home/klaus/Programme/eigen-3.4.0/Eigen I added the Eigen3_ROOT to the .bashrc and rebooted as shown below Code:
# set Eigen3_ROOT Code:
#include <Eigen/Sparse> Online instructions tell me to add Code:
EXTERNAL_LIBS += -lEigen3 Code:
MYPreconditioner.C:32:10: Fatal error: Eigen/: File or directory not found Eigen can be found at: HTML Code:
https://eigen.tuxfamily.org/index.php?title=Main_Page E.g. how to adjust the Make/options file: Code:
EXE_INC = \ |
1/ Distinguish between compile and link stage.
2/ For compile stage: -I<dir> where <dir> is the directory where header files are located. 3/ For link stage: -L<dir> where <dir> is the directory where library files are located. |
Quote:
Typically you would try something like "sh wmake/scripts/have_eigen -test" from the command-line to see how things work (or not). If you take a look through the file, you will see that it also likes to find its preferences via config.sh/eigen file, where it possibly obtains an EIGEN_ARCH_PATH. If this detection works OK, then you would add this detection in an src/OpenFOAM/Allwmake script (you need inject this yourself) and then pass through (see src/renumber/Allwmake for an example). Of course, you could also just define it all yourself in the OpenFOAM/Make/options (might actually be easier). For example (not tested): OpenFOAM/Make/options Code:
EXE_INC = \ |
I followed the setup for an OpenFOAM solver I found online:
Add the following to the .bashrc file: Code:
# set Eigen3_ROOT and EIGEN_LIBRARY_PATH Code:
EXE_INC = \ |
All times are GMT -4. The time now is 02:41. |