amd-3.3.1.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Copyright 1999-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit cmake-multilib
  5. Sparse_PV="7.6.0"
  6. Sparse_P="SuiteSparse-${Sparse_PV}"
  7. DESCRIPTION="Library to order a sparse matrix prior to Cholesky factorization"
  8. HOMEPAGE="https://people.engr.tamu.edu/davis/suitesparse.html"
  9. SRC_URI="https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v${Sparse_PV}.tar.gz -> ${Sparse_P}.gh.tar.gz"
  10. LICENSE="BSD"
  11. SLOT="0/3"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
  13. IUSE="debug doc fortran static-libs test"
  14. RESTRICT="!test? ( test ) mirror"
  15. BDEPEND="
  16. virtual/pkgconfig
  17. doc? ( virtual/latex-base )
  18. "
  19. DEPEND=">=sci-libs/suitesparseconfig-${Sparse_PV}"
  20. REPEND="${DEPEND}"
  21. S="${WORKDIR}/${Sparse_P}/${PN^^}"
  22. multilib_src_configure() {
  23. CMAKE_BUILD_TYPE=$(usex debug RelWithDebInfo Release)
  24. local mycmakeargs=(
  25. -DBUILD_STATIC_LIBS=$(usex static-libs)
  26. -DSUITESPARSE_HAS_FORTRAN=$(usex fortran)
  27. -DSUITESPARSE_DEMOS=$(usex test)
  28. )
  29. cmake_src_configure
  30. }
  31. multilib_src_test() {
  32. # Run demo files
  33. local demofiles=(
  34. amd_demo
  35. amd_l_demo
  36. amd_demo2
  37. amd_simple
  38. )
  39. if use fortran; then
  40. demofiles+=(
  41. amd_f77simple
  42. amd_f77demo
  43. )
  44. fi
  45. for i in ${demofiles[@]}; do
  46. ./"${i}" > "${i}.out" || die "failed to run test ${i}"
  47. diff "${S}/Demo/${i}.out" "${i}.out" || die "failed testing ${i}"
  48. done
  49. einfo "All tests passed"
  50. }
  51. multilib_src_install() {
  52. if use doc; then
  53. pushd "${S}/Doc"
  54. emake clean
  55. rm -rf *.pdf
  56. emake
  57. popd
  58. DOCS="${S}/Doc/*.pdf"
  59. fi
  60. cmake_src_install
  61. }
  62. multilib_src_install_all() {
  63. use doc && einstalldocs
  64. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  65. # strip .la files
  66. find "${ED}" -name '*.la' -delete || die
  67. }