mpqc-2.3.1-r2.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=2
  4. inherit autotools eutils toolchain-funcs
  5. DESCRIPTION="The Massively Parallel Quantum Chemistry Program"
  6. HOMEPAGE="http://www.mpqc.org/"
  7. SRC_URI="mirror://sourceforge/mpqc/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~ppc ~ppc64 x86"
  11. IUSE="doc mpi threads tk"
  12. RDEPEND="
  13. virtual/blas
  14. virtual/lapack
  15. mpi? ( virtual/mpi[cxx] )
  16. tk? ( dev-lang/tk )"
  17. DEPEND="${RDEPEND}
  18. dev-lang/perl
  19. sys-devel/flex
  20. sys-apps/sed
  21. virtual/pkgconfig
  22. doc? (
  23. app-doc/doxygen
  24. media-gfx/graphviz )"
  25. src_prepare() {
  26. epatch \
  27. "${FILESDIR}"/${P}-as-needed.patch \
  28. "${FILESDIR}"/${P}-respect-ldflags.patch \
  29. "${FILESDIR}"/${P}-test-failure-hack.patch
  30. # do not install tkmolrender if not requested
  31. if ! use tk; then
  32. sed \
  33. -e "s:.*/bin/molrender/tkmolrender.*::" \
  34. -e "s:.*\$(INSTALLBINOPT) tkmolrender.*::" \
  35. -e "s:/bin/rm -f tkmolrender::" \
  36. -i "./src/bin/molrender/Makefile" \
  37. || die "failed to disable tkmolrender"
  38. fi
  39. eautoreconf
  40. }
  41. src_configure() {
  42. tc-export CC CXX
  43. if use mpi; then
  44. export CC=mpicc
  45. export CXX=mpicxx
  46. fi
  47. econf \
  48. $(use_enable threads) \
  49. $(use_enable mpi parallel) \
  50. --enable-shared \
  51. ${myconf}
  52. sed \
  53. -e "s:^CFLAGS =.*$:CFLAGS=${CFLAGS}:" \
  54. -e "s:^FFLAGS =.*$:FFLAGS=${FFLAGS:- -O2}:" \
  55. -e "s:^CXXFLAGS =.*$:CXXFLAGS=${CXXFLAGS}:" \
  56. lib/LocalMakefile
  57. }
  58. src_test() {
  59. cd "${S}"/src/bin/mpqc/validate
  60. # we'll only run the small test set, since the
  61. # medium and large ones take >10h and >24h on my
  62. # 1.8Ghz P4M
  63. emake -j1 check0 || die "failed in test routines"
  64. }
  65. src_install() {
  66. emake installroot="${D}" install install_devel install_inc \
  67. || die "install failed"
  68. dodoc CHANGES CITATION README || die "failed to install docs"
  69. # make extended docs
  70. if use doc; then
  71. cd "${S}"/doc
  72. emake -j1 all || die "failed to generate documentation"
  73. doman man/man1/* man/man3/* || \
  74. die "failed to install man pages"
  75. dohtml -r html/
  76. fi
  77. }
  78. pkg_postinst() {
  79. echo
  80. einfo "MPQC can be picky with regard to compilation flags."
  81. einfo "If during mpqc runs you have trouble converging or "
  82. einfo "experience oscillations during SCF interations, "
  83. einfo "consider recompiling with less aggressive CFLAGS/CXXFLAGS."
  84. einfo "Particularly, replacing -march=pentium4 by -march=pentium3"
  85. einfo "might help if you encounter problems with correlation "
  86. einfo "consistent basis sets."
  87. echo
  88. }