mpich-3.1.3.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Copyright 1999-2014 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. # The configure statements can be somewhat confusing, as they
  42. # don't all show up in the top level configure, however, they
  43. # are picked up in the children directories.
  44. if use mpi-threads; then
  45. # MPI-THREAD requries threading.
  46. c="${c} --with-thread-package=pthreads"
  47. c="${c} --enable-threads=runtime"
  48. else
  49. if use threads ; then
  50. c="${c} --with-thread-package=pthreads"
  51. else
  52. c="${c} --with-thread-package=none"
  53. fi
  54. c="${c} --enable-threads=single"
  55. fi
  56. c="${c} --sysconfdir=${EPREFIX}/etc/${PN}"
  57. c="${c} --docdir=${EPREFIX}/usr/share/doc/${PF}"
  58. export MPICHLIB_CFLAGS=${CFLAGS}
  59. export MPICHLIB_CPPFLAGS=${CPPFLAGS}
  60. export MPICHLIB_CXXFLAGS=${CXXFLAGS}
  61. export MPICHLIB_FFLAGS=${FFLAGS}
  62. export MPICHLIB_FCFLAGS=${FCFLAGS}
  63. export MPICHLIB_LDFLAGS=${LDFLAGS}
  64. unset CFLAGS CPPFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS
  65. econf ${c} \
  66. --with-pm=hydra \
  67. --disable-mpe \
  68. --disable-fast \
  69. --enable-smpcoll \
  70. --enable-versioning \
  71. --with-hwloc-prefix=/usr \
  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. }