use-eigen

use-eigen

#


eigen

eigen / eigen3

Eigen is a C++ template library for linear algebra: matrices, vectors,
numerical solvers, and related algorithms.

use

ubuntu and with cmake

example

# install
sudo apt-get install libeigen3-dev

# cflags
pkg-config eigen3 --cflags
-I/usr/include/eigen3

# watch
ls -F /usr/include/eigen3/
Eigen/  signature_of_eigen3_matrix_library  unsupported/

note: cmake find package maybe not work well e.x. for ubuntu 14.04 ..
so see below
(TODO: find out where wrong!)

  • compile by cmake
find_package(Eigen3 REQUIRED)
if(NOT EIGEN3_INCLUDE_DIRS)
  find_package(PkgConfig REQUIRED)
  pkg_search_module(EIGEN3 REQUIRED eigen3)
endif()

# or
find_package(Eigen3)
if(NOT EIGEN3_INCLUDE_DIRS)
  message(STATUS "use EIGEN3_INCLUDE_DIRS: /usr/include/eigen3")
  set(EIGEN3_INCLUDE_DIRS /usr/include/eigen3)
endif()
  • by travis-ci

but env not work!

sudo: required
dist: trusty # 14.04

env:
  global:
    - Eigen3_DIR=/usr/lib/cmake/eigen3
before_install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libeigen3-dev -y ; fi

get

see also