pastix-5.2.3.ebuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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=218
  14. DESCRIPTION="Parallel solver for very large sparse linear systems"
  15. HOMEPAGE="http://pastix.gforge.inria.fr"
  16. SRC_URI="https://gforge.inria.fr/frs/download.php/latestfile/${PID}/${PN}_${PV}.tar.bz2"
  17. LICENSE="CeCILL-C"
  18. SLOT="0"
  19. KEYWORDS="~alpha ~amd64 ~x86 ~amd64-linux ~x86-linux"
  20. IUSE="doc int64 mpi +smp starpu static-libs"
  21. RDEPEND="
  22. sci-libs/scotch:0=[int64?,mpi?]
  23. sys-apps/hwloc:0=
  24. virtual/blas
  25. mpi? ( virtual/mpi )
  26. starpu? ( dev-libs/starpu:0= )"
  27. DEPEND="${RDEPEND}
  28. virtual/pkgconfig"
  29. S="${WORKDIR}/${PN}_${PV}/src"
  30. src_prepare() {
  31. default
  32. sed -e 's/^\(HOSTARCH\s*=\).*/\1 ${HOST}/' \
  33. -e "s:^\(CCPROG\s*=\).*:\1 $(tc-getCC):" \
  34. -e "s:^\(CFPROG\s*=\).*:\1 $(tc-getFC):" \
  35. -e "s:^\(CF90PROG\s*=\).*:\1 $(tc-getFC):" \
  36. -e "s:^\(ARPROG\s*=\).*:\1 $(tc-getAR):" \
  37. -e "s:^\(CCFOPT\s*=\).*:\1 ${FFLAGS}:" \
  38. -e "s:^\(CCFDEB\s*=\).*:\1 ${FFLAGS}:" \
  39. -e 's:^\(EXTRALIB\s*=\).*:\1 -lm -lrt:' \
  40. -e "s:^#\s*\(ROOT\s*=\).*:\1 \$(DESTDIR)${EPREFIX%/}/usr:" \
  41. -e 's:^#\s*\(INCLUDEDIR\s*=\).*:\1 $(ROOT)/include:' \
  42. -e 's:^#\s*\(BINDIR\s*=\).*:\1 $(ROOT)/bin:' \
  43. -e "s:^#\s*\(LIBDIR\s*=\).*:\1 \$(ROOT)/$(get_libdir):" \
  44. -e 's:^#\s*\(SHARED\s*=\).*:\1 1:' \
  45. -e 's:^#\s*\(SOEXT\s*=\).*:\1 .so:' \
  46. -e '/fPIC/s/^#//g' \
  47. -e "s:^#\s*\(SHARED_FLAGS\s*=.*\):\1 ${LDFLAGS}:" \
  48. -e "s:pkg-config:$(tc-getPKG_CONFIG):g" \
  49. -e "s:^\(BLASLIB\s*=\).*:\1 $($(tc-getPKG_CONFIG) --libs blas):" \
  50. -e "s:^\s*\(HWLOC_HOME\s*?=\).*:\1 ${EPREFIX}/usr:" \
  51. -e "s:-I\$(HWLOC_INC):$($(tc-getPKG_CONFIG) --cflags hwloc):" \
  52. -e "s:-L\$(HWLOC_LIB) -lhwloc:$($(tc-getPKG_CONFIG) --libs hwloc):" \
  53. -e "s:^\s*\(SCOTCH_HOME\s*?=\).*:\1 ${EPREFIX}/usr:" \
  54. -e "s:^\s*\(SCOTCH_INC\s*?=.*\):\1/scotch:" \
  55. -e "s:^\s*\(SCOTCH_LIB\s*?=.*\)lib:\1$(get_libdir):" \
  56. config/LINUX-GNU.in > config.in || die
  57. sed -e 's/__SO_NAME__,$@/__SO_NAME__,$(notdir $@)/g' -i Makefile || die
  58. }
  59. src_configure() {
  60. if use amd64; then
  61. sed -e 's/^\(VERSIONBIT\s*=\).*/\1 _64bit/' \
  62. -i config.in || die
  63. fi
  64. if use int64; then
  65. sed -e '/VERSIONINT.*_int64/s/#//' \
  66. -e '/CCTYPES.*INTSSIZE64/s/#//' \
  67. -i config.in || die
  68. fi
  69. if ! use mpi; then
  70. sed -e '/VERSIONMPI.*_nompi/s/#//' \
  71. -e '/CCTYPES.*NOMPI/s/#//' \
  72. -e '/MPCCPROG\s*= $(CCPROG)/s/#//' \
  73. -e '/MCFPROG\s*= $(CFPROG)/s/#//' \
  74. -e 's/-DDISTRIBUTED//' \
  75. -e 's/-lptscotch/-lscotch/g' \
  76. -i config.in || die
  77. fi
  78. if ! use smp; then
  79. sed -e '/VERSIONSMP.*_nosmp/s/#//' \
  80. -e '/CCTYPES.*NOSMP/s/#//' \
  81. -i config.in || die
  82. fi
  83. if use starpu; then
  84. sed -e '/libstarpu/s/#//g' -i config.in || die
  85. fi
  86. }
  87. src_compile() {
  88. emake all drivers
  89. }
  90. src_test() {
  91. # both test and tests targets are defined and do not work
  92. emake examples
  93. echo
  94. }
  95. src_install() {
  96. default
  97. sed -e "s:${D}::g" -i "${ED}"/usr/bin/pastix-conf || die
  98. # quick and dirty (static libs should really be built without pic)
  99. cd .. || die
  100. dodoc README.txt doc/refcard/refcard.pdf
  101. }