eigen-3.3.3.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. FORTRAN_NEEDED="test"
  5. inherit cmake-utils cuda fortran-2
  6. DESCRIPTION="C++ template library for linear algebra"
  7. HOMEPAGE="http://eigen.tuxfamily.org/"
  8. SRC_URI="https://bitbucket.org/eigen/eigen/get/${PV}.tar.bz2 -> ${P}.tar.bz2"
  9. LICENSE="MPL-2.0"
  10. SLOT="3"
  11. KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
  12. IUSE="altivec c++11 cuda debug doc neon openmp test" #zvector vsx
  13. IUSE_CPU_FLAGS=" avx avx2 f16c fma3 sse2 sse3 sse4_1 sse4_2 ssse3" #x87
  14. IUSE+=" ${IUSE_CPU_FLAGS// / cpu_flags_x86_}"
  15. RDEPEND="!dev-cpp/eigen:0"
  16. DEPEND="
  17. doc? ( app-doc/doxygen[dot,latex] )
  18. test? (
  19. dev-libs/gmp:0
  20. dev-libs/mpfr:0
  21. media-libs/freeglut
  22. media-libs/glew
  23. sci-libs/adolc[sparse]
  24. sci-libs/cholmod
  25. sci-libs/fftw:3.0
  26. sci-libs/pastix
  27. sci-libs/umfpack
  28. sci-libs/scotch
  29. sci-libs/spqr
  30. sci-libs/superlu
  31. dev-qt/qtcore:4
  32. virtual/opengl
  33. virtual/pkgconfig
  34. cuda? ( dev-util/nvidia-cuda-toolkit )
  35. )
  36. "
  37. # Missing:
  38. # METIS-5
  39. # GOOGLEHASH
  40. src_unpack() {
  41. default
  42. mv ${PN}* ${P} || die
  43. }
  44. src_prepare() {
  45. sed -e 's:-g2::g' \
  46. -i cmake/EigenConfigureTesting.cmake || die
  47. sed -e "/add_subdirectory(demos/d" \
  48. -i CMakeLists.txt || die
  49. if ! use test; then
  50. sed -e "/add_subdirectory(test/d" \
  51. -i CMakeLists.txt || die
  52. sed -e "/add_subdirectory(blas/d" \
  53. -e "/add_subdirectory(lapack/d" \
  54. -i CMakeLists.txt || die
  55. fi
  56. sed -e "/Unknown build type/d" \
  57. -i CMakeLists.txt || die
  58. use cuda && cuda_src_prepare
  59. cmake-utils_src_prepare
  60. }
  61. src_compile() {
  62. cmake-utils_src_compile
  63. use doc && cmake-utils_src_compile doc
  64. }
  65. src_test() {
  66. local mycmakeargs=(
  67. -DEIGEN_TEST_ALTIVEC="$(usex altivec)"
  68. -DEIGEN_TEST_CXX11="$(usex c++11)"
  69. -DEIGEN_TEST_CUDA="$(usex cuda)"
  70. -DEIGEN_TEST_OPENMP="$(usex openmp)"
  71. -DEIGEN_TEST_AVX="$(usex cpu_flags_x86_avx)"
  72. -DEIGEN_TEST_AVX512="$(usex cpu_flags_x86_avx2)"
  73. -DEIGEN_TEST_F16C="$(usex cpu_flags_x86_f16c)"
  74. -DEIGEN_TEST_FMA="$(usex cpu_flags_x86_fma3)"
  75. -DEIGEN_TEST_SSE3="$(usex cpu_flags_x86_sse3)"
  76. -DEIGEN_TEST_SSE4_1="$(usex cpu_flags_x86_sse4_1)"
  77. -DEIGEN_TEST_SSE4_2="$(usex cpu_flags_x86_sse4_2)"
  78. -DEIGEN_TEST_SSSE3="$(usex cpu_flags_x86_ssse3)"
  79. -DEIGEN_TEST_NEON64="$(usex neon)"
  80. # -DEIGEN_TEST_X87="$(usex cpu_flags_x86_x87)"
  81. )
  82. cmake-utils_src_configure
  83. cmake-utils_src_compile blas
  84. cmake-utils_src_compile buildtests
  85. cmake-utils_src_test
  86. }
  87. src_install() {
  88. cmake-utils_src_install
  89. use doc && dodoc -r "${BUILD_DIR}"/doc/html
  90. # Debian installs it and some projects started using it.
  91. insinto /usr/share/cmake/Modules/
  92. doins "${S}/cmake/FindEigen3.cmake"
  93. }