eigen-3.3.2.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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="LGPL-2 GPL-3"
  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
  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 \
  46. -e 's:-g2::g' \
  47. -i cmake/EigenConfigureTesting.cmake || die
  48. sed -i CMakeLists.txt \
  49. -e "/add_subdirectory(demos/d" \
  50. || die "sed disable unused bundles failed"
  51. if ! use test; then
  52. sed -i CMakeLists.txt \
  53. -e "/add_subdirectory(test/d" \
  54. || die "sed disable tests failed"
  55. sed -i CMakeLists.txt \
  56. -e "/add_subdirectory(blas/d" \
  57. -e "/add_subdirectory(lapack/d" \
  58. || die "sed disable unused bundles failed"
  59. fi
  60. sed -i -e "/Unknown build type/d" CMakeLists.txt || die
  61. use cuda && cuda_src_prepare
  62. cmake-utils_src_prepare
  63. }
  64. src_compile() {
  65. cmake-utils_src_compile
  66. use doc && cmake-utils_src_compile doc
  67. }
  68. src_test() {
  69. local mycmakeargs=(
  70. -DEIGEN_TEST_ALTIVEC="$(usex altivec)"
  71. -DEIGEN_TEST_CXX11="$(usex c++11)"
  72. -DEIGEN_TEST_CUDA="$(usex cuda)"
  73. -DEIGEN_TEST_OPENMP="$(usex openmp)"
  74. -DEIGEN_TEST_AVX="$(usex cpu_flags_x86_avx)"
  75. -DEIGEN_TEST_AVX512="$(usex cpu_flags_x86_avx2)"
  76. -DEIGEN_TEST_F16C="$(usex cpu_flags_x86_f16c)"
  77. -DEIGEN_TEST_FMA="$(usex cpu_flags_x86_fma3)"
  78. -DEIGEN_TEST_SSE3="$(usex cpu_flags_x86_sse3)"
  79. -DEIGEN_TEST_SSE4_1="$(usex cpu_flags_x86_sse4_1)"
  80. -DEIGEN_TEST_SSE4_2="$(usex cpu_flags_x86_sse4_2)"
  81. -DEIGEN_TEST_SSSE3="$(usex cpu_flags_x86_ssse3)"
  82. -DEIGEN_TEST_NEON64="$(usex neon)"
  83. # -DEIGEN_TEST_X87="$(usex cpu_flags_x86_x87)"
  84. )
  85. cmake-utils_src_configure
  86. cmake-utils_src_compile blas
  87. cmake-utils_src_compile buildtests
  88. cmake-utils_src_test
  89. }
  90. src_install() {
  91. cmake-utils_src_install
  92. use doc && dodoc -r "${BUILD_DIR}"/doc/html
  93. # Debian installs it and some projects started using it.
  94. insinto /usr/share/cmake/Modules/
  95. doins "${S}/cmake/FindEigen3.cmake"
  96. }