web-dev-qa-db-ja.com

Eigen2をインストールするにはどうすればよいですか?

Eigenは、線形代数用のC++テンプレートライブラリです:行列、ベクトル、数値ソルバー、および関連アルゴリズム。インストールに問題があります。 cmake '/home/brentonhorne/eigen-eigen-5097c01bcdc4を実行すると、/home/brentonhorne/eigen-eigen-5097c01bcdc4Eigen Webサイト からダウンロードしたtarballから抽出されたソースディレクトリの場所です。エラーが表示されました。

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.
6
BH2017

私は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
8
Fraser

Eigenライブラリはパッケージとしてインストールできることに注意してください。 Sudo apt-get install libeigen3-devは最新のライブラリ用、Sudo apt-get install libeigen2-devはこの質問で言及されたライブラリ用です。

7
Seanny123

まあ、私はそれを自分でインストールし、それは完璧に動作しています。これが私がしたことです(これは前に投稿したものと同じです)。

  • Eigen 3.1.2からhttp://eigen.tuxfamily.org/index.php?title=Main_Pageをダウンロードします。
  • ターミナルを開きます(Ctrl+Alt+T)および実行:
 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 <固有/密集> 
1
green