spqr-4.3.2.ebuild 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 toolchain-funcs
  5. Sparse_PV="7.6.0"
  6. Sparse_P="SuiteSparse-${Sparse_PV}"
  7. DESCRIPTION="Multithreaded multifrontal sparse QR factorization library"
  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="GPL-2+"
  11. SLOT="0/4"
  12. KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
  13. IUSE="cuda debug doc openmp static-libs test"
  14. RESTRICT="!test? ( test ) mirror"
  15. DEPEND=">=sci-libs/suitesparseconfig-${Sparse_PV}[openmp?,cuda?]
  16. >=sci-libs/amd-3.3.1
  17. >=sci-libs/colamd-3.3.1
  18. >=sci-libs/cholmod-5.2.0
  19. virtual/blas"
  20. RDEPEND="${DEPEND}"
  21. BDEPEND="doc? ( virtual/latex-base )"
  22. S="${WORKDIR}/${Sparse_P}/${PN^^}"
  23. pkg_pretend() {
  24. [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
  25. }
  26. pkg_setup() {
  27. [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
  28. }
  29. multilib_src_configure() {
  30. CMAKE_BUILD_TYPE=$(usex debug RelWithDebInfo Release)
  31. local mycmakeargs=(
  32. -DBUILD_STATIC_LIBS=$(usex static-libs)
  33. -DSPQR_USE_CUDA=$(usex cuda)
  34. -DSUITESPARSE_DEMOS=$(usex test)
  35. )
  36. cmake_src_configure
  37. }
  38. multilib_src_test() {
  39. # Run demo files
  40. ./qrsimple < "${S}"/Matrix/ash219.mtx || die "failed testing"
  41. ./qrsimplec < "${S}"/Matrix/ash219.mtx || die "failed testing"
  42. ./qrsimple < "${S}"/Matrix/west0067.mtx || die "failed testing"
  43. ./qrsimplec < "${S}"/Matrix/west0067.mtx || die "failed testing"
  44. ./qrdemo < "${S}"/Matrix/a2.mtx || die "failed testing"
  45. ./qrdemo < "${S}"/Matrix/r2.mtx || die "failed testing"
  46. ./qrdemo < "${S}"/Matrix/a04.mtx || die "failed testing"
  47. ./qrdemo < "${S}"/Matrix/a2.mtx || die "failed testing"
  48. ./qrdemo < "${S}"/Matrix/west0067.mtx || die "failed testing"
  49. ./qrdemo < "${S}"/Matrix/c2.mtx || die "failed testing"
  50. ./qrdemo < "${S}"/Matrix/a0.mtx || die "failed testing"
  51. ./qrdemo < "${S}"/Matrix/lfat5b.mtx || die "failed testing"
  52. ./qrdemo < "${S}"/Matrix/bfwa62.mtx || die "failed testing"
  53. ./qrdemo < "${S}"/Matrix/LFAT5.mtx || die "failed testing"
  54. ./qrdemo < "${S}"/Matrix/b1_ss.mtx || die "failed testing"
  55. ./qrdemo < "${S}"/Matrix/bcspwr01.mtx || die "failed testing"
  56. ./qrdemo < "${S}"/Matrix/lpi_galenet.mtx || die "failed testing"
  57. ./qrdemo < "${S}"/Matrix/lpi_itest6.mtx || die "failed testing"
  58. ./qrdemo < "${S}"/Matrix/ash219.mtx || die "failed testing"
  59. ./qrdemo < "${S}"/Matrix/a4.mtx || die "failed testing"
  60. ./qrdemo < "${S}"/Matrix/s32.mtx || die "failed testing"
  61. ./qrdemo < "${S}"/Matrix/c32.mtx || die "failed testing"
  62. ./qrdemo < "${S}"/Matrix/lp_share1b.mtx || die "failed testing"
  63. ./qrdemo < "${S}"/Matrix/a1.mtx || die "failed testing"
  64. ./qrdemo < "${S}"/Matrix/GD06_theory.mtx || die "failed testing"
  65. ./qrdemo < "${S}"/Matrix/GD01_b.mtx || die "failed testing"
  66. ./qrdemo < "${S}"/Matrix/Tina_AskCal_perm.mtx || die "failed testing"
  67. ./qrdemo < "${S}"/Matrix/Tina_AskCal.mtx || die "failed testing"
  68. ./qrdemo < "${S}"/Matrix/GD98_a.mtx || die "failed testing"
  69. ./qrdemo < "${S}"/Matrix/Ragusa16.mtx || die "failed testing"
  70. ./qrdemo < "${S}"/Matrix/young1c.mtx || die "failed testing"
  71. ./qrdemo < "${S}"/Matrix/lp_e226_transposed.mtx || die "failed testing"
  72. ./qrdemoc < "${S}"/Matrix/a2.mtx || die "failed testing"
  73. ./qrdemoc < "${S}"/Matrix/r2.mtx || die "failed testing"
  74. ./qrdemoc < "${S}"/Matrix/a04.mtx || die "failed testing"
  75. ./qrdemoc < "${S}"/Matrix/a2.mtx || die "failed testing"
  76. ./qrdemoc < "${S}"/Matrix/west0067.mtx || die "failed testing"
  77. ./qrdemoc < "${S}"/Matrix/c2.mtx || die "failed testing"
  78. ./qrdemoc < "${S}"/Matrix/a0.mtx || die "failed testing"
  79. ./qrdemoc < "${S}"/Matrix/lfat5b.mtx || die "failed testing"
  80. ./qrdemoc < "${S}"/Matrix/bfwa62.mtx || die "failed testing"
  81. ./qrdemoc < "${S}"/Matrix/LFAT5.mtx || die "failed testing"
  82. ./qrdemoc < "${S}"/Matrix/b1_ss.mtx || die "failed testing"
  83. ./qrdemoc < "${S}"/Matrix/bcspwr01.mtx || die "failed testing"
  84. ./qrdemoc < "${S}"/Matrix/lpi_galenet.mtx || die "failed testing"
  85. ./qrdemoc < "${S}"/Matrix/lpi_itest6.mtx || die "failed testing"
  86. ./qrdemoc < "${S}"/Matrix/ash219.mtx || die "failed testing"
  87. ./qrdemoc < "${S}"/Matrix/a4.mtx || die "failed testing"
  88. ./qrdemoc < "${S}"/Matrix/s32.mtx || die "failed testing"
  89. ./qrdemoc < "${S}"/Matrix/c32.mtx || die "failed testing"
  90. ./qrdemoc < "${S}"/Matrix/lp_share1b.mtx || die "failed testing"
  91. ./qrdemoc < "${S}"/Matrix/a1.mtx || die "failed testing"
  92. ./qrdemoc < "${S}"/Matrix/GD06_theory.mtx || die "failed testing"
  93. ./qrdemoc < "${S}"/Matrix/GD01_b.mtx || die "failed testing"
  94. ./qrdemoc < "${S}"/Matrix/Tina_AskCal_perm.mtx || die "failed testing"
  95. ./qrdemoc < "${S}"/Matrix/Tina_AskCal.mtx || die "failed testing"
  96. ./qrdemoc < "${S}"/Matrix/GD98_a.mtx || die "failed testing"
  97. ./qrdemoc < "${S}"/Matrix/Ragusa16.mtx || die "failed testing"
  98. ./qrdemoc < "${S}"/Matrix/young1c.mtx || die "failed testing"
  99. ./qrdemoc < "${S}"/Matrix/lp_e226_transposed.mtx || die "failed testing"
  100. }
  101. multilib_src_install() {
  102. if use doc; then
  103. pushd "${S}/Doc"
  104. emake clean
  105. rm -rf *.pdf
  106. emake
  107. popd
  108. DOCS="${S}/Doc/*.pdf"
  109. fi
  110. cmake_src_install
  111. }
  112. multilib_src_install_all() {
  113. use doc && einstalldocs
  114. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  115. # strip .la files
  116. find "${ED}" -name '*.la' -delete || die
  117. }