Gentoo Archives: gentoo-commits

From: "Honza Macháček" <Hloupy.Honza@×××××××.cz>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/nwchem/files/, sci-chemistry/nwchem/
Date: Wed, 30 Mar 2016 14:36:14
Message-Id: 1459348449.94a06710354314bfd07d9a8b124079193ddd1d4a.honza_machacek@gentoo
1 commit: 94a06710354314bfd07d9a8b124079193ddd1d4a
2 Author: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
3 AuthorDate: Wed Mar 30 14:34:09 2016 +0000
4 Commit: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
5 CommitDate: Wed Mar 30 14:34:09 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=94a06710
7
8 sci-chemistry/nwchem version bumped to 6.6 with minor ebuild improvements; Infiniband support should compile, source patched to allow unique names for all atoms
9
10 Package-Manager: portage-2.2.27
11
12 .../nwchem/files/nwchem-6.6-unique_tags.patch | 12 +
13 sci-chemistry/nwchem/nwchem-6.6_p27746-r2.ebuild | 279 +++++++++++++++++++++
14 2 files changed, 291 insertions(+)
15
16 diff --git a/sci-chemistry/nwchem/files/nwchem-6.6-unique_tags.patch b/sci-chemistry/nwchem/files/nwchem-6.6-unique_tags.patch
17 new file mode 100644
18 index 0000000..e129406
19 --- /dev/null
20 +++ b/sci-chemistry/nwchem/files/nwchem-6.6-unique_tags.patch
21 @@ -0,0 +1,12 @@
22 +diff -Naurp nwchem-6.6.orig/src/util/nwc_const.fh nwchem-6.6/src/util/nwc_const.fh
23 +--- nwchem-6.6.orig/src/util/nwc_const.fh 2015-10-01 17:33:14.000000000 +0000
24 ++++ nwchem-6.6/src/util/nwc_const.fh 2015-11-26 10:53:46.386110924 +0000
25 +@@ -62,7 +62,7 @@
26 + * Maximum number of unique tags
27 + *
28 + integer nw_max_unq_tags
29 +- parameter (nw_max_unq_tags = 40)
30 ++ parameter (nw_max_unq_tags = nw_max_atom)
31 + *------------------------------------------------------------------------------
32 + * Maximum number of general contractions in a shell
33 + *
34
35 diff --git a/sci-chemistry/nwchem/nwchem-6.6_p27746-r2.ebuild b/sci-chemistry/nwchem/nwchem-6.6_p27746-r2.ebuild
36 new file mode 100644
37 index 0000000..4c10fe8
38 --- /dev/null
39 +++ b/sci-chemistry/nwchem/nwchem-6.6_p27746-r2.ebuild
40 @@ -0,0 +1,279 @@
41 +# Copyright 1999-2015 Gentoo Foundation
42 +# Distributed under the terms of the GNU General Public License v2
43 +# $Header: $
44 +
45 +EAPI=5
46 +
47 +PYTHON_COMPAT=( python2_7 )
48 +
49 +inherit eutils flag-o-matic fortran-2 multilib python-single-r1 toolchain-funcs
50 +
51 +DATE="2015-10-20"
52 +
53 +DESCRIPTION="Delivering High-Performance Computational Chemistry to Science"
54 +HOMEPAGE="http://www.nwchem-sw.org/index.php/Main_Page"
55 +PATCH_REPO="http://www.nwchem-sw.org/images"
56 +PATCH_LIST="Tddft_mxvec20 Tools_lib64 Config_libs66 Cosmo_meminit Sym_abelian
57 +Xccvs98 Dplot_tolrho Driver_smalleig Ga_argv Raman_displ Ga_defs Zgesvd Cosmo_dftprint"
58 +SRC_URI="http://www.nwchem-sw.org/images/Nwchem-${PV%_p*}.revision${PV#*_p}-src.${DATE}.tar.bz2
59 + $(for p in ${PATCH_LIST[@]}; do echo ${PATCH_REPO}/${p}.patch.gz; done)"
60 +
61 +LICENSE="ECL-2.0"
62 +SLOT="0"
63 +KEYWORDS="~x86 ~amd64"
64 +IUSE="blas cuda doc examples infiniband int64 lapack mrcc nwchem-tests openmp python scalapack"
65 +
66 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
67 + scalapack? ( !int64 )
68 + lapack? ( blas )
69 + scalapack? ( blas )"
70 +
71 +RDEPEND="
72 + sys-fs/sysfsutils
73 + blas? ( virtual/blas )
74 + lapack? ( virtual/lapack )
75 + scalapack? ( virtual/scalapack )
76 + cuda? ( dev-util/nvidia-cuda-sdk )
77 + int64? (
78 + blas? ( virtual/blas[int64] )
79 + lapack? ( virtual/lapack[int64] )
80 + )
81 + python? ( ${PYTHON_DEPS} )"
82 +DEPEND="${RDEPEND}
83 + virtual/pkgconfig
84 + app-shells/tcsh
85 + virtual/mpi[fortran]
86 + infiniband? ( || (
87 + sys-cluster/openmpi[fortran,openmpi_fabrics_ofed]
88 + sys-cluster/mvapich2[fortran]
89 + ) )
90 + doc? (
91 + dev-texlive/texlive-latex
92 + dev-tex/latex2html )"
93 +
94 +LONG_S="${WORKDIR}/Nwchem-${PV%_p*}.revision${PV#*_p}-src.${DATE}"
95 +S="${WORKDIR}/${PN}-${PV%_p*}"
96 +
97 +pkg_setup() {
98 + # fortran-2.eclass does not handle mpi wrappers
99 + export FC="mpif90"
100 + export F77="mpif77"
101 + export CC="mpicc"
102 + export CXX="mpic++"
103 +
104 + use openmp && FORTRAN_NEED_OPENMP=1
105 +
106 + fortran-2_pkg_setup
107 +
108 + if use openmp; then
109 + # based on _fortran-has-openmp() of fortran-2.eclass
110 + local openmp=""
111 + local fcode=ebuild-openmp-flags.f
112 + local _fc=$(tc-getFC)
113 +
114 + pushd "${T}"
115 + cat <<- EOF > "${fcode}"
116 + 1 call omp_get_num_threads
117 + 2 end
118 + EOF
119 +
120 + for openmp in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
121 + "${_fc}" "${openmp}" "${fcode}" -o "${fcode}.x" && break
122 + done
123 +
124 + rm -f "${fcode}.*"
125 + popd
126 +
127 + export FC="${FC} ${openmp}"
128 + export F77="${F77} ${openmp}"
129 + export CC="${CC} ${openmp}"
130 + export CXX="${CXX} ${openmp}"
131 + fi
132 +
133 + use python && python-single-r1_pkg_setup
134 +}
135 +
136 +src_unpack() {
137 + unpack ${A}
138 + mv "${LONG_S}" "${S}"
139 +}
140 +
141 +src_prepare() {
142 + for p in ${PATCH_LIST[@]}
143 + do epatch "${WORKDIR}"/"${p}.patch"
144 + done
145 + epatch "${FILESDIR}"/nwchem-6.1.1-nwchemrc.patch
146 + epatch "${FILESDIR}"/nwchem-6.5-icosahedron_zcoord.patch
147 + epatch "${FILESDIR}"/nwchem-6.6-unique_tags.patch
148 + use python && epatch "${FILESDIR}"/nwchem-6.5-python_makefile.patch
149 + use doc && epatch "${FILESDIR}"/nwchem-6.3-r1-html_doc.patch
150 +
151 + sed \
152 + -e "s:DBASIS_LIBRARY=\"'\$(SRCDIR)'\":DBASIS_LIBRARY=\"'${EPREFIX}/usr/share/NWChem'\":g" \
153 + -i src/basis/MakeFile src/basis/GNUmakefile || die
154 + sed \
155 + -e "s:DNWPW_LIBRARY=\"'\$(SRCDIR)'\":DNWPW_LIBRARY=\"'${EPREFIX}/usr/share/NWChem'\":g" \
156 + -i src/nwpw/libraryps/GNUmakefile || die
157 + sed \
158 + -e "s:-DCOMPILATION_DIR=\"'\$(TOPDIR)'\":-DCOMPILATION_DIR=\"''\":g" \
159 + -i src/GNUmakefile src/MakeFile || die
160 +
161 + if [[ $(tc-getFC) == *-*-*-*-gfortran ]]; then
162 + sed \
163 + -e "s:ifneq (\$(FC),gfortran):ifneq (\$(FC),$(tc-getFC)):g" \
164 + -e "s:ifeq (\$(FC),gfortran):ifeq (\$(FC),$(tc-getFC)):g" \
165 + -i src/config/makefile.h || die
166 + fi
167 +}
168 +
169 +src_compile() {
170 + export NWCHEM_LONG_PATHS=Y
171 + use openmp && export USE_OPENMP=1
172 + export USE_MPI=y
173 + export USE_MPIF=y
174 + export USE_MPIF4=y
175 + export MPI_LOC="${EPREFIX}"/usr
176 + export MPI_INCLUDE=$MPI_LOC/include
177 + export MPI_LIB=$MPI_LOC/$(get_libdir)
178 + export LIBMPI="$(mpif90 -showme:link)"
179 + if use infiniband; then
180 + export ARMCI_NETWORK=OPENIB
181 + export MSG_COMMS=MPI
182 + export IB_INCLUDE="-I${MPI_INCLUDE}"
183 + export IB_LIB="-L${MPI_LIB}"
184 + else
185 + unset ARMCI_NETWORK
186 + fi
187 + if [ "$ARCH" = "amd64" ]; then
188 + export NWCHEM_TARGET=LINUX64
189 + elif [ "$ARCH" = "ia64" ]; then
190 + export NWCHEM_TARGET=LINUX64
191 + elif [ "$ARCH" = "x86" ]; then
192 + export NWCHEM_TARGET=LINUX
193 + elif [ "$ARCH" = "ppc" ]; then
194 + export NWCHEM_TARGET=LINUX
195 + else
196 + die "Unknown architecture"
197 + fi
198 + if use python ; then
199 + if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "ia64" ]; then
200 + export USE_PYTHON64=yes
201 + fi
202 + export PYTHONHOME=/usr
203 + export PYTHONVERSION=$(eselect python show --python2 |awk -Fpython '{ print $2 }')
204 + export PYTHONPATH="./:${S}/contrib/python/"
205 + export NWCHEM_MODULES="all python"
206 + else
207 + export NWCHEM_MODULES="all"
208 + fi
209 + use mrcc && export MRCC_METHODS="TRUE" # Multi Reference Coupled Clusters
210 + export CCSDTQ="TRUE" # Coupled Clusters Singlets + Dublets + Triplets + Quadruplets
211 + export CCSDTLR="TRUE" # CCSDT (and CCSDTQ?) Linear Response
212 + export EACCSD="TRUE" # Electron Affinities at the CCSD level
213 + export IPCCSD="TRUE" # Ionisation Potentials at the CCSD level
214 + unset BLASOPT
215 + local blaspkg="blas"
216 + local lapackpkg="lapack"
217 + if use int64; then
218 + blaspkg="blas-int64"
219 + lapackpkg="lapack-int64"
220 + fi
221 + use blas && export BLASOPT="$($(tc-getPKG_CONFIG) --libs ${blaspkg})"
222 + use lapack && export BLASOPT+=" $($(tc-getPKG_CONFIG) --libs ${lapackpkg})"
223 + use scalapack && export BLASOPT+=" $($(tc-getPKG_CONFIG) --libs scalapack)"
224 + if use cuda; then
225 + export TCE_CUDA=Y
226 + export CUDA_PATH=/opt/cuda
227 + export CUDA=${CUDA_PATH}/bin/nvcc
228 + export CUDA_FLAGS="-arch=compute_20 -code=sm_20,compute_20"
229 + export CUDA_INCLUDE="-I${CUDA_PATH}/include"
230 + export CUDA_LIBS="-L${CUDA_PATH}/$(get_libdir) -lcublas -lcufft -lcudart -lcuda -lstdc++"
231 + fi
232 + export LARGE_FILES="TRUE"
233 +
234 + cd src
235 + if use blas && [ "$NWCHEM_TARGET" = "LINUX64" ]; then
236 + if use int64; then
237 + export BLAS_SIZE=8
238 + export LAPACK_SIZE=8
239 + export SCALAPACK_SIZE=8
240 + else
241 + emake \
242 + DIAG=PAR \
243 + FC="$(tc-getFC)" \
244 + CC="$(tc-getCC)" \
245 + CXX="$(tc-getCXX)" \
246 + NWCHEM_TOP="${S}" \
247 + clean
248 + emake \
249 + DIAG=PAR \
250 + FC="$(tc-getFC)" \
251 + CC="$(tc-getCC)" \
252 + CXX="$(tc-getCXX)" \
253 + NWCHEM_TOP="${S}" \
254 + 64_to_32
255 + export BLAS_SIZE=4
256 + export LAPACK_SIZE=4
257 + export SCALAPACK_SIZE=4
258 + export USE_64TO32=y
259 + fi
260 + fi
261 + emake \
262 + DIAG=PAR \
263 + FC="$(tc-getFC)" \
264 + CC="$(tc-getCC)" \
265 + CXX="$(tc-getCXX)" \
266 + NWCHEM_TOP="${S}" \
267 + NWCHEM_EXECUTABLE="${S}/bin/${NWCHEM_TARGET}/nwchem" \
268 + nwchem_config
269 + emake \
270 + DIAG=PAR \
271 + FC="$(tc-getFC)" \
272 + CC="$(tc-getCC)" \
273 + CXX="$(tc-getCXX)" \
274 + NWCHEM_TOP="${S}" \
275 + NWCHEM_EXECUTABLE="${S}/bin/${NWCHEM_TARGET}/nwchem"
276 +
277 + if use doc; then
278 + cd "${S}"/doc
279 + export VARTEXFONTS="${T}/fonts"
280 + emake \
281 + DIAG=PAR \
282 + NWCHEM_TOP="${S}" \
283 + pdf html
284 + fi
285 +}
286 +
287 +src_install() {
288 + dobin bin/${NWCHEM_TARGET}/nwchem
289 +
290 + insinto /usr/share/NWChem/basis/
291 + doins -r src/basis/libraries src/data
292 + insinto /usr/share/NWChem/nwpw
293 + doins -r src/nwpw/libraryps
294 +
295 + insinto /etc
296 + doins nwchemrc
297 +
298 + use examples && \
299 + insinto /usr/share/NWChem/ && \
300 + doins -r examples
301 +
302 + use nwchem-tests && \
303 + insinto /usr/share/NWChem && \
304 + doins -r QA/tests
305 +
306 + use doc && \
307 + insinto /usr/share/doc/"${P}" && \
308 + doins -r doc/nwahtml && \
309 + doins -r web
310 +
311 +}
312 +
313 +pkg_postinst() {
314 + echo
315 + elog "The user will need to link \$HOME/.nwchemrc to /etc/nwchemrc"
316 + elog "or copy it in order to tell NWChem the right position of the"
317 + elog "basis library and other necessary data."
318 + echo
319 +}