eigen-3.2.10.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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-adaolc-backport.patch
  45. )
  46. src_unpack() {
  47. default
  48. mv ${PN}* ${P} || die
  49. }
  50. src_prepare() {
  51. sed \
  52. -e 's:-g2::g' \
  53. -i cmake/EigenConfigureTesting.cmake || die
  54. sed -i CMakeLists.txt \
  55. -e "/add_subdirectory(demos/d" \
  56. || die "sed disable unused bundles failed"
  57. if ! use test; then
  58. sed -i CMakeLists.txt \
  59. -e "/add_subdirectory(blas/d" \
  60. -e "/add_subdirectory(lapack/d" \
  61. || die "sed disable unused bundles failed"
  62. fi
  63. sed -i -e "/Unknown build type/d" CMakeLists.txt || die
  64. cmake-utils_src_prepare
  65. }
  66. src_compile() {
  67. cmake-utils_src_compile
  68. use doc && cmake-utils_src_compile doc
  69. }
  70. src_test() {
  71. local mycmakeargs=(
  72. -DEIGEN_BUILD_TESTS=ON
  73. -DEIGEN_TEST_ALTIVEC="$(usex altivec)"
  74. -DEIGEN_TEST_OPENMP="$(usex openmp)"
  75. -DEIGEN_TEST_SSE2="$(usex cpu_flags_x86_sse2)"
  76. -DEIGEN_TEST_SSE3="$(usex cpu_flags_x86_sse3)"
  77. -DEIGEN_TEST_SSE4_1="$(usex cpu_flags_x86_sse4_1)"
  78. -DEIGEN_TEST_SSE4_2="$(usex cpu_flags_x86_sse4_2)"
  79. -DEIGEN_TEST_SSSE3="$(usex cpu_flags_x86_ssse3)"
  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. }