mpich-3.2.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. FORTRAN_NEEDED=fortran
  5. inherit fortran-2
  6. MY_PV=${PV/_/}
  7. DESCRIPTION="A high performance and portable MPI implementation"
  8. HOMEPAGE="http://www.mpich.org/"
  9. SRC_URI="http://www.mpich.org/static/downloads/${PV}/${P}.tar.gz"
  10. SLOT="0"
  11. LICENSE="mpich"
  12. KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
  13. IUSE="+cxx doc fortran mpi-threads romio threads"
  14. COMMON_DEPEND="
  15. dev-libs/libaio
  16. >=sys-apps/hwloc-1.9
  17. romio? ( net-fs/nfs-utils )"
  18. DEPEND="${COMMON_DEPEND}
  19. dev-lang/perl
  20. sys-devel/libtool"
  21. RDEPEND="${COMMON_DEPEND}
  22. !sys-cluster/mpich2
  23. !sys-cluster/openmpi"
  24. S="${WORKDIR}"/${PN}-${MY_PV}
  25. pkg_setup() {
  26. FORTRAN_STANDARD="77 90"
  27. fortran-2_pkg_setup
  28. if use mpi-threads && ! use threads; then
  29. ewarn "mpi-threads requires threads, assuming that's what you want"
  30. fi
  31. }
  32. src_prepare() {
  33. # Using MPICHLIB_LDFLAGS doesn't seem to fully work.
  34. sed -i 's| *@WRAPPER_LDFLAGS@ *||' \
  35. src/packaging/pkgconfig/mpich.pc.in \
  36. src/env/*.in \
  37. || die
  38. }
  39. src_configure() {
  40. local c="--enable-shared"
  41. local hydra_c="--with-hwloc-prefix=/usr"
  42. # The configure statements can be somewhat confusing, as they
  43. # don't all show up in the top level configure, however, they
  44. # are picked up in the children directories. Hence the separate
  45. # local vars.
  46. if use mpi-threads; then
  47. # MPI-THREAD requries threading.
  48. c="${c} --with-thread-package=pthreads"
  49. c="${c} --enable-threads=runtime"
  50. else
  51. if use threads ; then
  52. c="${c} --with-thread-package=pthreads"
  53. else
  54. c="${c} --with-thread-package=none"
  55. fi
  56. c="${c} --enable-threads=single"
  57. fi
  58. c="${c} --sysconfdir=${EPREFIX}/etc/${PN}"
  59. c="${c} --docdir=${EPREFIX}/usr/share/doc/${PF}"
  60. export MPICHLIB_CFLAGS=${CFLAGS}
  61. export MPICHLIB_CPPFLAGS=${CPPFLAGS}
  62. export MPICHLIB_CXXFLAGS=${CXXFLAGS}
  63. export MPICHLIB_FFLAGS=${FFLAGS}
  64. export MPICHLIB_FCFLAGS=${FCFLAGS}
  65. export MPICHLIB_LDFLAGS=${LDFLAGS}
  66. unset CFLAGS CPPFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS
  67. econf ${c} \
  68. --with-pm=hydra \
  69. --disable-fast \
  70. --enable-versioning \
  71. ${hydra_c}
  72. $(use_enable romio) \
  73. $(use_enable cxx) \
  74. $(use_enable fortran f77) \
  75. $(use_enable fortran fc)
  76. }
  77. src_test() {
  78. emake -j1 check
  79. }
  80. src_install() {
  81. default
  82. dodir /usr/share/doc/${PF}
  83. dodoc README{,.envvar} CHANGES RELEASE_NOTES
  84. newdoc src/pm/hydra/README README.hydra
  85. if use romio; then
  86. newdoc src/mpi/romio/README README.romio
  87. fi
  88. if ! use doc; then
  89. rm -rf "${D}"usr/share/doc/${PF}/www*
  90. fi
  91. }