mpqc-2.3.1-r4.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools 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 static-libs tk"
  12. RDEPEND="
  13. virtual/blas
  14. virtual/lapack
  15. mpi? ( virtual/mpi[cxx] )
  16. tk? ( dev-lang/tk:0 )"
  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. PATCHES=(
  26. "${FILESDIR}/${P}-as-needed.patch"
  27. "${FILESDIR}/${P}-respect-ldflags.patch"
  28. "${FILESDIR}/${P}-test-failure-hack.patch"
  29. "${FILESDIR}/${P}-blas.patch"
  30. "${FILESDIR}/${P}-wformat-security.patch"
  31. )
  32. DOCS=(CHANGES CITATION README)
  33. src_prepare() {
  34. # do not install tkmolrender if not requested
  35. if ! use tk; then
  36. sed \
  37. -e "s:.*/bin/molrender/tkmolrender.*::" \
  38. -e "s:.*\$(INSTALLBINOPT) tkmolrender.*::" \
  39. -e "s:/bin/rm -f tkmolrender::" \
  40. -i "./src/bin/molrender/Makefile" \
  41. || die "failed to disable tkmolrender"
  42. fi
  43. default
  44. mv configure.{in,ac} || die
  45. eautoreconf
  46. }
  47. src_configure() {
  48. tc-export CC CXX
  49. if use mpi; then
  50. export CC=mpicc
  51. export CXX=mpicxx
  52. fi
  53. econf \
  54. $(use_enable threads) \
  55. $(use_enable mpi parallel) \
  56. $(use_enable static-libs static)
  57. sed \
  58. -e "s:^CFLAGS =.*$:CFLAGS=${CFLAGS}:" \
  59. -e "s:^FFLAGS =.*$:FFLAGS=${FFLAGS:- -O2}:" \
  60. -e "s:^CXXFLAGS =.*$:CXXFLAGS=${CXXFLAGS}:" \
  61. -i lib/LocalMakefile || die
  62. }
  63. src_test() {
  64. cd src/bin/mpqc/validate || die
  65. # we'll only run the small test set, since the
  66. # medium and large ones take >10h and >24h on my
  67. # 1.8Ghz P4M
  68. emake -j1 check1
  69. }
  70. src_install() {
  71. emake installroot="${D}" install install_devel install_inc
  72. # make extended docs
  73. if use doc; then
  74. cd doc || die
  75. emake all
  76. doman man/man1/* man/man3/*
  77. dodoc -r html/
  78. fi
  79. }
  80. pkg_postinst() {
  81. echo
  82. einfo "MPQC can be picky with regard to compilation flags."
  83. einfo "If during mpqc runs you have trouble converging or "
  84. einfo "experience oscillations during SCF interations, "
  85. einfo "consider recompiling with less aggressive CFLAGS/CXXFLAGS."
  86. einfo "Particularly, replacing -march=pentium4 by -march=pentium3"
  87. einfo "might help if you encounter problems with correlation "
  88. einfo "consistent basis sets."
  89. echo
  90. }