pastix-5.2.2.22-r1.ebuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit fortran-2 toolchain-funcs
  5. # TODO:
  6. # testing: emake examples?
  7. # better doc instalation and building
  8. # pypastix (separate package?)
  9. # multilib with eselect?
  10. # static libs building without pic
  11. # metis?
  12. # package id: change every version, see the link on inriaforge
  13. PID=35070
  14. # commit id: change every version
  15. #CID=351ef60
  16. # leave empty if this is not a post release bug fix
  17. #PPV=bugfix9_
  18. #MYPN=pastix_release
  19. #SRC_URI="https://gforge.inria.fr/frs/download.php/${PID}/${MYPN}_${PPV}${CID}.tar.bz2"
  20. DESCRIPTION="Parallel solver for very large sparse linear systems"
  21. HOMEPAGE="http://pastix.gforge.inria.fr"
  22. SRC_URI="https://gforge.inria.fr/frs/download.php/${PID}/${PN}_${PV}.tar.bz2"
  23. LICENSE="CeCILL-C"
  24. SLOT="0"
  25. KEYWORDS="~alpha amd64 ~arm ~ppc64 ~x86 ~amd64-linux ~x86-linux"
  26. IUSE="doc int64 mpi +smp starpu static-libs"
  27. RDEPEND="
  28. sci-libs/scotch:0=[int64?,mpi?]
  29. sys-apps/hwloc:0=
  30. virtual/blas
  31. mpi? ( virtual/mpi )
  32. starpu? ( dev-libs/starpu:0= )"
  33. DEPEND="${RDEPEND}
  34. virtual/pkgconfig"
  35. PATCHES=(
  36. "${FILESDIR}/${P}-nosmp-undefined-variable.patch"
  37. "${FILESDIR}/${P}-isnan-floating-point-cast.patch"
  38. )
  39. S="${WORKDIR}/${PN}_${PV}/src"
  40. src_prepare() {
  41. default
  42. sed -e 's/^\(HOSTARCH\s*=\).*/\1 ${HOST}/' \
  43. -e "s:^\(CCPROG\s*=\).*:\1 $(tc-getCC):" \
  44. -e "s:^\(CFPROG\s*=\).*:\1 $(tc-getFC):" \
  45. -e "s:^\(CF90PROG\s*=\).*:\1 $(tc-getFC):" \
  46. -e "s:^\(ARPROG\s*=\).*:\1 $(tc-getAR):" \
  47. -e "s:^\(CCFOPT\s*=\).*:\1 ${FFLAGS}:" \
  48. -e "s:^\(CCFDEB\s*=\).*:\1 ${FFLAGS}:" \
  49. -e 's:^\(EXTRALIB\s*=\).*:\1 -lm -lrt:' \
  50. -e "s:^#\s*\(ROOT\s*=\).*:\1 \$(DESTDIR)${EPREFIX%/}/usr:" \
  51. -e 's:^#\s*\(INCLUDEDIR\s*=\).*:\1 $(ROOT)/include:' \
  52. -e 's:^#\s*\(BINDIR\s*=\).*:\1 $(ROOT)/bin:' \
  53. -e "s:^#\s*\(LIBDIR\s*=\).*:\1 \$(ROOT)/$(get_libdir):" \
  54. -e 's:^#\s*\(SHARED\s*=\).*:\1 1:' \
  55. -e 's:^#\s*\(SOEXT\s*=\).*:\1 .so:' \
  56. -e '/fPIC/s/^#//g' \
  57. -e "s:^#\s*\(SHARED_FLAGS\s*=.*\):\1 ${LDFLAGS}:" \
  58. -e "s:pkg-config:$(tc-getPKG_CONFIG):g" \
  59. -e "s:^\(BLASLIB\s*=\).*:\1 $($(tc-getPKG_CONFIG) --libs blas):" \
  60. -e "s:^\s*\(HWLOC_HOME\s*?=\).*:\1 ${EPREFIX}/usr:" \
  61. -e "s:-I\$(HWLOC_INC):$($(tc-getPKG_CONFIG) --cflags hwloc):" \
  62. -e "s:-L\$(HWLOC_LIB) -lhwloc:$($(tc-getPKG_CONFIG) --libs hwloc):" \
  63. -e "s:^\s*\(SCOTCH_HOME\s*?=\).*:\1 ${EPREFIX}/usr:" \
  64. -e "s:^\s*\(SCOTCH_INC\s*?=.*\):\1/scotch:" \
  65. -e "s:^\s*\(SCOTCH_LIB\s*?=.*\)lib:\1$(get_libdir):" \
  66. config/LINUX-GNU.in > config.in || die
  67. sed -e 's/__SO_NAME__,$@/__SO_NAME__,$(notdir $@)/g' -i Makefile || die
  68. }
  69. src_configure() {
  70. if use amd64; then
  71. sed -e 's/^\(VERSIONBIT\s*=\).*/\1 _64bit/' \
  72. -i config.in || die
  73. fi
  74. if use int64; then
  75. sed -e '/VERSIONINT.*_int64/s/#//' \
  76. -e '/CCTYPES.*INTSSIZE64/s/#//' \
  77. -i config.in || die
  78. fi
  79. if ! use mpi; then
  80. sed -e '/VERSIONMPI.*_nompi/s/#//' \
  81. -e '/CCTYPES.*NOMPI/s/#//' \
  82. -e '/MPCCPROG\s*= $(CCPROG)/s/#//' \
  83. -e '/MCFPROG\s*= $(CFPROG)/s/#//' \
  84. -e 's/-DDISTRIBUTED//' \
  85. -e 's/-lptscotch/-lscotch/g' \
  86. -i config.in || die
  87. fi
  88. if ! use smp; then
  89. sed -e '/VERSIONSMP.*_nosmp/s/#//' \
  90. -e '/CCTYPES.*NOSMP/s/#//' \
  91. -i config.in || die
  92. fi
  93. if use starpu; then
  94. sed -e '/libstarpu/s/#//g' -i config.in || die
  95. fi
  96. }
  97. src_compile() {
  98. emake all drivers
  99. }
  100. src_test() {
  101. # both test and tests targets are defined and do not work
  102. echo
  103. }
  104. src_install() {
  105. default
  106. sed -e "s:${D}::g" -i "${ED}"/usr/bin/pastix-conf || die
  107. # quick and dirty (static libs should really be built without pic)
  108. cd .. || die
  109. dodoc README.txt doc/refcard/refcard.pdf
  110. }