首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Eigen3构建CXX_FLAGS

用Eigen3构建CXX_FLAGS
EN

Stack Overflow用户
提问于 2017-06-06 10:19:56
回答 1查看 1.9K关注 0票数 3

我正在尝试使用Eigen3构建CMake,如安装手册中所述:

代码语言:javascript
复制
root@60e449767588:/opt/tr/src/eigen/build_dir$ ../../cmake-3.8.1/bin/cmake  -DCMAKE_BUILD_TYPE=Release --build ..

这是输出:

代码语言:javascript
复制
-- Standard libraries to link to explicitly: none
-- Found unsuitable Qt version "" from NOTFOUND
-- Could NOT find CHOLMOD (missing:  CHOLMOD_INCLUDES CHOLMOD_LIBRARIES) 
-- Could NOT find UMFPACK (missing:  UMFPACK_INCLUDES UMFPACK_LIBRARIES) 
-- Could NOT find SUPERLU (missing:  SUPERLU_INCLUDES SUPERLU_LIBRARIES SUPERLU_VERSION_OK) 
-- Could NOT find PASTIX (missing:  PASTIX_INCLUDES PASTIX_LIBRARIES) 
-- Could NOT find SCOTCH (missing:  SCOTCH_INCLUDES SCOTCH_LIBRARIES) 
-- Could NOT find METIS (missing:  METIS_INCLUDES METIS_LIBRARIES) 
-- Could NOT find SPQR (missing:  SPQR_INCLUDES SPQR_LIBRARIES) 
-- Found unsuitable Qt version "" from NOTFOUND
-- Boost version: 1.64.0
-- Could NOT find GOOGLEHASH (missing:  GOOGLEHASH_INCLUDES GOOGLEHASH_COMPILE) 
-- Could NOT find ADOLC (missing:  ADOLC_INCLUDES ADOLC_LIBRARIES) 
-- Could NOT find MPFR (missing:  MPFR_INCLUDES MPFR_LIBRARIES MPFR_VERSION_OK) (Required is at least version "2.3.0")
-- Could NOT find GMP (missing:  GMP_INCLUDES GMP_LIBRARIES) 
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
-- Could NOT find FFTW (missing:  FFTW_INCLUDES FFTW_LIBRARIES) 
-- Could NOT find OpenGL (missing:  OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) 
-- Could NOT find GLUT (missing:  GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) 
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing:  CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.0")
-- Found unsuitable Qt version "" from NOTFOUND
-- Qt4 not found, so disabling the mandelbrot and opengl demos
-- Could NOT find CHOLMOD (missing:  CHOLMOD_INCLUDES CHOLMOD_LIBRARIES) 
-- Could NOT find UMFPACK (missing:  UMFPACK_INCLUDES UMFPACK_LIBRARIES) 
-- Could NOT find SUPERLU (missing:  SUPERLU_INCLUDES SUPERLU_LIBRARIES SUPERLU_VERSION_OK) 
-- Could NOT find PASTIX (missing:  PASTIX_INCLUDES PASTIX_LIBRARIES) 
-- Could NOT find SCOTCH (missing:  SCOTCH_INCLUDES SCOTCH_LIBRARIES) 
-- Could NOT find METIS (missing:  METIS_INCLUDES METIS_LIBRARIES) 
-- ************************************************************
-- ***    Eigen's unit tests configuration summary          ***
-- ************************************************************
-- 
-- Build type:        Release
-- Build site:        60e449767588
-- Build string:      linux-4.4.0-78-generic-_-4.9.2-sse2-64bit
-- Enabled backends:  Boost.Multiprecision, 
-- Disabled backends: Cholmod,  UmfPack,  SuperLU,  PaStiX,  METIS,  SPQR,  Qt4 support,  GoogleHash,  Adolc,  MPFR C++,  fftw,  OpenGL, 
-- Default order:     Column-major
-- Maximal matrix/vector size: 320
-- SSE2:              Using architecture defaults
-- SSE3:              Using architecture defaults
-- SSSE3:             Using architecture defaults
-- SSE4.1:            Using architecture defaults
-- SSE4.2:            Using architecture defaults
-- AVX:               Using architecture defaults
-- FMA:               Using architecture defaults
-- AVX512:            Using architecture defaults
-- Altivec:           Using architecture defaults
-- VSX:               Using architecture defaults
-- ARM NEON:          Using architecture defaults
-- ARMv8 NEON:        Using architecture defaults
-- S390X ZVECTOR:     Using architecture defaults
-- C++11:             OFF
-- SYCL:              OFF
-- CUDA:              OFF
-- 
CXX:               /usr/bin/c++
 CXX_VERSION:       c++ (Debian 4.9.2-10) 4.9.2
 CXX_FLAGS:         -O3 -DNDEBUG -fPIC -DEIGEN_USE_MKL_ALL -DMKL_ILP64 -fopenmp -m64 -v -pedantic -Wall -Wextra -Wundef -Wcast-align -Wchar-subscripts -Wnon-virtual-dtor -Wunused-local-typedefs -Wpointer-arith -Wwrite-strings -Wformat-security -Wlogical-op -Wdouble-promotion -Wno-psabi -Wno-variadic-macros -Wno-long-long -fno-check-new -fno-common -fstrict-aliasing -ansi
 Sparse lib flags:   

-- ************************************************************
-- 
-- Configured Eigen 3.3.3
-- 
-- Some things you can do now:
-- --------------+--------------------------------------------------------------
-- Command       |   Description
-- --------------+--------------------------------------------------------------
-- make install  | Install Eigen. Headers will be installed to:
--               |     <CMAKE_INSTALL_PREFIX>/<INCLUDE_INSTALL_DIR>
--               |   Using the following values:
--               |     CMAKE_INSTALL_PREFIX: /usr/local
--               |     INCLUDE_INSTALL_DIR:  include/eigen3
--               |   Change the install location of Eigen headers using:
--               |     cmake . -DCMAKE_INSTALL_PREFIX=yourprefix
--               |   Or:
--               |     cmake . -DINCLUDE_INSTALL_DIR=yourdir
-- make doc      | Generate the API documentation, requires Doxygen & LaTeX
-- make check    | Build and run the unit-tests. Read this page:
--               |   http://eigen.tuxfamily.org/index.php?title=Tests
-- make blas     | Build BLAS library (not the same thing as Eigen)
-- make uninstall| Removes files installed by make install
-- --------------+--------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/tr/src/eigen/build_dir

我的问题是:

  1. 如何删除CXX_FLAGS的默认值?
  2. 如何指定我希望使用C++11,甚至14?
  3. 如何指定我希望使用SYCL?

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2017-06-06 13:13:55

正如我在评论中所建议的,Eigen只是一个标头库(没有源文件),您不需要构建它。只需包含想要使用本征的相关标题即可。您可以将头文件(使用简单的cp)复制到您认为合适的地方。

请参阅快速入门手册:

为了使用Eigen,您只需下载并解压Eigen的源代码(有关下载说明,请参阅wiki )。实际上,Eigen子目录中的头文件是使用Eigen编译程序所需的唯一文件。所有平台的头文件都是相同的。没有必要使用CMake或安装任何东西。

艾根维基提到:

我们使用CMake构建系统,但只用于构建文档和单元测试,以及自动化安装。如果您只想使用Eigen,您可以立即使用头文件。没有要链接到的二进制库,也没有配置的头文件。特征是在标头中定义的一个纯模板库。

因此,如果您对构建单元测试或文档不感兴趣,则不需要cmake

结论:您必须指定编译器标志(CXX_FLAGS,.)在使用艾根的项目中。

find_package:CMake的注见安德鲁W.

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44387388

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档