eigen-3.2.8-r2.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Copyright 1999-2016 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 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 debug doc openmp test"
  13. IUSE+=" cpu_flags_x86_sse2"
  14. IUSE+=" cpu_flags_x86_sse3"
  15. IUSE+=" cpu_flags_x86_sse4_1"
  16. IUSE+=" cpu_flags_x86_sse4_2"
  17. IUSE+=" cpu_flags_x86_ssse3"
  18. #IUSE+=" cpu_flags_x86_x87"
  19. RDEPEND="!dev-cpp/eigen:0"
  20. DEPEND="
  21. doc? ( app-doc/doxygen[dot,latex] )
  22. test? (
  23. dev-libs/gmp:0
  24. dev-libs/mpfr:0
  25. media-libs/freeglut
  26. media-libs/glew
  27. sci-libs/adolc
  28. sci-libs/cholmod
  29. sci-libs/fftw:3.0
  30. sci-libs/pastix
  31. sci-libs/umfpack
  32. sci-libs/scotch
  33. sci-libs/spqr
  34. sci-libs/superlu
  35. dev-qt/qtcore:4
  36. virtual/opengl
  37. virtual/pkgconfig
  38. )
  39. "
  40. # Missing:
  41. # METIS-5
  42. # GOOGLEHASH
  43. PATCHES=(
  44. "${FILESDIR}"/${PN}-3.2.7-pastix-5.2-backport.patch
  45. "${FILESDIR}"/${PN}-3.2.7-adaolc-backport.patch
  46. )
  47. src_unpack() {
  48. default
  49. mv ${PN}* ${P} || die
  50. }
  51. src_prepare() {
  52. sed \
  53. -e 's:-g2::g' \
  54. -i cmake/EigenConfigureTesting.cmake || die
  55. sed -i CMakeLists.txt \
  56. -e "/add_subdirectory(demos/d" \
  57. || die "sed disable unused bundles failed"
  58. if ! use test; then
  59. sed -i CMakeLists.txt \
  60. -e "/add_subdirectory(blas/d" \
  61. -e "/add_subdirectory(lapack/d" \
  62. || die "sed disable unused bundles failed"
  63. fi
  64. sed -i -e "/Unknown build type/d" CMakeLists.txt || die
  65. cmake-utils_src_prepare
  66. }
  67. src_compile() {
  68. cmake-utils_src_compile
  69. use doc && cmake-utils_src_compile doc
  70. }
  71. src_test() {
  72. local mycmakeargs=(
  73. -DEIGEN_BUILD_TESTS=ON
  74. -DEIGEN_TEST_ALTIVEC="$(usex altivec)"
  75. -DEIGEN_TEST_OPENMP="$(usex openmp)"
  76. -DEIGEN_TEST_SSE2="$(usex cpu_flags_x86_sse2)"
  77. -DEIGEN_TEST_SSE3="$(usex cpu_flags_x86_sse3)"
  78. -DEIGEN_TEST_SSE4_1="$(usex cpu_flags_x86_sse4_1)"
  79. -DEIGEN_TEST_SSE4_2="$(usex cpu_flags_x86_sse4_2)"
  80. -DEIGEN_TEST_SSSE3="$(usex cpu_flags_x86_ssse3)"
  81. # -DEIGEN_TEST_X87="$(usex cpu_flags_x86_x87)"
  82. )
  83. cmake-utils_src_configure
  84. cmake-utils_src_compile blas
  85. cmake-utils_src_compile buildtests
  86. cmake-utils_src_test
  87. }
  88. src_install() {
  89. cmake-utils_src_install
  90. use doc && dodoc -r "${BUILD_DIR}"/doc/html
  91. # Debian installs it and some projects started using it.
  92. insinto /usr/share/cmake/Modules/
  93. doins "${S}/cmake/FindEigen3.cmake"
  94. }