Skip to content

Instantly share code, notes, and snippets.

@pierceh89
Forked from UnaNancyOwen/Eigen.md
Last active October 12, 2021 06:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pierceh89/253d04ff4a55e0ef3084 to your computer and use it in GitHub Desktop.
Save pierceh89/253d04ff4a55e0ef3084 to your computer and use it in GitHub Desktop.
Building Eigen with Visual Studio

Building Eigen with Visual Studio (비주얼 스투디오로 Eigen 빌드하는 법)

Eigen은 빌드 없이 include만 하면 쓸 수 있는 라이브러리이기 때문에 솔직히 이 방법이 필요하지 않은것 같지만 지정된 경로(Program files)에 카피하기 쉬운 방법인것같다.

Download

  1. Eigen 3.2.2(eigen-eigen-1306d75b4a21.zip)를 다운받아 압축을 푼다. latest-stable버전을 다운받아도 무방하다. http://eigen.tuxfamily.org/
    https://bitbucket.org/eigen/eigen/downloads/

CMake

  1. CMake를 실행하여 아래와 같이 경로를 지정한다.

    • Where is the source code: C:\eigen-eigen-1306d75b4a21 (소스 파일 경로)
    • Where is build the binaries: C:\eigen-eigen-1306d75b4a21\build (빌드가 저장될 경로)
  2. [Configure]를 누르고 타겟으로 Visual studio를 선택한다.

  3. 아래 설정을 확인한다.

    • CMAKE_INSTALL_PREFIX C:\Program Files\Eigen (64bit) 또는 C:\Program Files (x86)\Eigen (32bit)
  4. [Generate]를 눌러서 솔루션이 나오는지 확인해본다.

Build

  1. Build 폴더에 들어가면 솔루션(*.sln)이 있다. 관리자 모드로 Visual studio를 실행한다.

  2. Eigen은 빌드할 필요가 없기 때문에 바로 INSTALL하면 된다.

    1. 솔루션 탐색기에서 INSTALL을 선택한다.
    2. [빌드] -> [프로젝트만] -> [INSTALL만 빌드] 선택하여 INSTALL 한다.
      CMAKE_INSTALL_PREFIX 에 지정된 경로로 필요한 파일들이 복사된다.

Environment Variable (환경 변수)

  1. EIGEN_ROOT 라는 이름으로 환경변수를 저장해준다. 경로는 (C:\Program Files\Eigen)
@chureee77
Copy link

고맙습니다!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment