Эйген - это библиотека шаблонов C ++ для линейной алгебры: матрицы, векторы, числовые решатели и связанные алгоритмы. У меня были проблемы с установкой. Когда я запустил cmake '/home/brentonhorne/eigen-eigen-5097c01bcdc4
, где /home/brentonhorne/eigen-eigen-5097c01bcdc4
- это местоположение исходного каталога, извлеченного из архива, который я скачал с сайта Eigen , я получил ошибку:
CMake Error at CMakeLists.txt:8 (message):
In-source builds not allowed. Please make a new directory (called a build
directory) and run CMake from there. You may need to remove
CMakeCache.txt.
-- Configuring incomplete, errors occurred!
Пожалуйста, сообщите как мне пройти этот контрольно-пропускной пункт. Я не очень разбираюсь в программировании, но если вы можете объяснить мне, что мне нужно сделать с точки зрения того, что вставить в терминал, я могу это сделать! Если мне нужно помочь, я бегу 12.10.
Если вам нужно знать содержимое файла INSTALL в исходном каталоге, вот они:
Installation instructions for Eigen
***********************************
Explanation before starting
***************************
Eigen consists only of header files, hence there is nothing to compile
before you can use it. Moreover, these header files do not depend on your
platform, they are the same for everybody.
Method 1. Installing without using CMake
****************************************
You can use right away the headers in the Eigen/ subdirectory. In order
to install, just copy this Eigen/ subdirectory to your favorite location.
If you also want the unsupported features, copy the unsupported/
subdirectory too.
Method 2. Installing using CMake
********************************
Let's call this directory 'source_dir' (where this INSTALL file is).
Before starting, create another directory which we will call 'build_dir'.
Do:
cd build_dir
cmake source_dir
make install
The "make install" step may require administrator privileges.
You can adjust the installation destination (the "prefix")
by passing the -DCMAKE_INSTALL_PREFIX=myprefix option to cmake, as is
explained in the message that cmake prints at the end.
Ну, я установил его сам, и он работает отлично. Вот что я сделал (что аналогично тому, что я писал ранее):
Eigen 3.1.2
из http://eigen.tuxfamily.org/index.php?title=Main_Page
. cd ~/Downloads tar xzf eigen-eigen-5097c01bcdc4.tar.bz2 cd eigen-eigen-5097c01bcdc4 sudo cp -r Eigen /usr/include/
Eigen
в /usr/include
. Для этого вам понадобятся привилегии пользователя root. Итак, откройте терминал, перейдите в каталог, содержащий каталог Eigen, и запустите sudo cp -r Eigen /usr/include/
.
Dense
, из каталога Eigen
используйте #include <Eigen/Dense>
Я не знаком с Eigen, но из сообщения об ошибке похоже, что требуется сборка «вне источника».
Это означает, что если вы скачали и извлекли Eigen в / home / brentonhorne / eigen-eigen-5097c01bcdc4, то вам следует создать новый каталог вне корневого каталога Eigen, например, / home / brentonhorne / build_eigen и запустить оттуда CMake. Я думаю, что-то вроде:
mkdir /home/brentonhorne/build_eigen
cd /home/brentonhorne/build_eigen
cmake /home/brentonhorne/eigen-eigen-5097c01bcdc4
make
sudo make install
Следует отметить, что библиотека Eigen может быть установлена как пакет. sudo apt-get install libeigen3-dev
для самой последней библиотеки и sudo apt-get install libeigen2-dev
для библиотеки, упомянутой в этом вопросе.