diff options
author | Kacper Kowalik <xarthisius@gentoo.org> | 2010-11-16 20:05:49 +0000 |
---|---|---|
committer | Kacper Kowalik <xarthisius@gentoo.org> | 2010-11-16 20:05:49 +0000 |
commit | 389179b4161b54da1d5cd0856bca7b5226ba8e73 (patch) | |
tree | f8e60f5366c55c049f487eb6d591b2685f242b73 /sci-chemistry | |
parent | Fix glib dep, bug 344869 (diff) | |
download | historical-389179b4161b54da1d5cd0856bca7b5226ba8e73.tar.gz historical-389179b4161b54da1d5cd0856bca7b5226ba8e73.tar.bz2 historical-389179b4161b54da1d5cd0856bca7b5226ba8e73.zip |
Link proper openmp lib when using intel compiler
Package-Manager: portage-2.1.9.24/cvs/Linux x86_64
Diffstat (limited to 'sci-chemistry')
-rw-r--r-- | sci-chemistry/cns/ChangeLog | 7 | ||||
-rw-r--r-- | sci-chemistry/cns/Manifest | 13 | ||||
-rw-r--r-- | sci-chemistry/cns/cns-1.2.1-r5.ebuild | 223 |
3 files changed, 237 insertions, 6 deletions
diff --git a/sci-chemistry/cns/ChangeLog b/sci-chemistry/cns/ChangeLog index f1de133e998d..f9a32a5912a6 100644 --- a/sci-chemistry/cns/ChangeLog +++ b/sci-chemistry/cns/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sci-chemistry/cns # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/cns/ChangeLog,v 1.24 2010/06/28 21:05:46 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/cns/ChangeLog,v 1.25 2010/11/16 20:05:49 xarthisius Exp $ + +*cns-1.2.1-r5 (16 Nov 2010) + + 16 Nov 2010; Kacper Kowalik <xarthisius@gentoo.org> +cns-1.2.1-r5.ebuild: + Link proper openmp lib when using intel compiler 28 Jun 2010; Justin Lecher <jlec@gentoo.org> cns-1.2.1.ebuild, cns-1.2.1-r1.ebuild, cns-1.2.1-r2.ebuild, cns-1.2.1-r3.ebuild, diff --git a/sci-chemistry/cns/Manifest b/sci-chemistry/cns/Manifest index e8d90de25ebd..6ba9f342d1fd 100644 --- a/sci-chemistry/cns/Manifest +++ b/sci-chemistry/cns/Manifest @@ -24,14 +24,17 @@ EBUILD cns-1.2.1-r1.ebuild 5585 RMD160 d25d66002ffe133c390912e265f81aae860134c9 EBUILD cns-1.2.1-r2.ebuild 6132 RMD160 8dd964fed1d90f708689d6e63e9ec0dc6b9f45cf SHA1 7ebbf35a7e8ec2e2f246389a3fdfcf93e8fb5d87 SHA256 853162df3142ce1a46e05d77b2e50672cda0a41efd25daee1261109d91493aaf EBUILD cns-1.2.1-r3.ebuild 6258 RMD160 353ad806f567cc71f4137f75f78743ed38d14fed SHA1 9424d69c95fa65418b6c34b2675dc7827f465b59 SHA256 0ee874568facb4e188d4718f034c8cdb60f1517cdc663996468f5b1f6ad46d4e EBUILD cns-1.2.1-r4.ebuild 6582 RMD160 544cf18f4dd459c7d2325da7998fef6db0eebaa3 SHA1 e263f40adcd54c724b341e3b49d79286521fe352 SHA256 192c853f998484cd71a7d6bec6a35071c5846dd74cbc67c6bca7ff08c2a029d1 +EBUILD cns-1.2.1-r5.ebuild 6589 RMD160 0faf1a389e72ef6b75a17930ccc814ec6777926c SHA1 bc14809d78f7bcbbea8dbb31ed5a4c57aa25f93c SHA256 fd257513ef87379d509c7f7ed55ab98dbafbc15d297d0c01cc50e5bb02f8686b EBUILD cns-1.2.1.ebuild 5620 RMD160 84fae2bc1f0780f77b931ee23a18acdd7353e766 SHA1 4b58160d9a20c103a7f443491ed5e1d5bade2afe SHA256 8504163c5874f0e90582ef37a44800ec2dbf9b112282682c237236e708ed79cf EBUILD cns-1.2.ebuild 3497 RMD160 9e097171ebd44f1a7e5dd317beeb6b65aefac2f6 SHA1 3afc4b415d2ef559b717843a05bc6afb8ee651a2 SHA256 1a6094c8bca3797e62c375a2370cc7425e9c1dd1106d20f202681bc5a87da1fc -MISC ChangeLog 4337 RMD160 022a7c7f918ff9d65e7827a3e56b3b97aac64fdd SHA1 f43a0d2049d1edcdba2f1618c4f8f72da6180923 SHA256 68c4cc815f176428f011d5fc27576e6bdb797b8f180dfab72a512bafde14244a +MISC ChangeLog 4500 RMD160 4d0cfea2f8c7a9798b000d9bd3ac5a30a8d806e1 SHA1 1aa7a55e53334007978f004beb65140a484b2d20 SHA256 a19abdc674b3431e08e86e9eb3607033c4d3bdf87aa563731bf3709a45c8d062 MISC metadata.xml 302 RMD160 d60d9cd875115eaba68ad4b504bff76b39a136b0 SHA1 ecdd8feeea2de489927403f1941acfc582c17222 SHA256 a374144760a8ac1f72b1c625c41f98cee3f74511c964133bda119da580664c50 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.15 (GNU/Linux) +Version: GnuPG v2.0.16 (GNU/Linux) -iEYEARECAAYFAkwpDrEACgkQgAnW8HDreRY32gCeJua/25A5KHDLHXWKhBTvpnUM -S7AAoLdLqa/LhNY4pWbj0E1lFJ7btAzI -=xHBI +iJwEAQECAAYFAkzi5CYACgkQIiMqcbOVdxR8dwP+OMBCoGhSWqR3otNDKUkOb9WL +AdAX3fF8gFGAOgqvlteAZnz2EvBttc8Pouwx/yST/c7NQdcc8eCtF5HEC2dwJuVD +7Ya3tyJjIEbZzYf41FQd7OuCLZWZT7k2GTpfPxTB90mD3FA4/UyN+TeZqUsPshxh +2NKzLT4piomaE8TxtPI= +=NEEx -----END PGP SIGNATURE----- diff --git a/sci-chemistry/cns/cns-1.2.1-r5.ebuild b/sci-chemistry/cns/cns-1.2.1-r5.ebuild new file mode 100644 index 000000000000..ba5850280fcc --- /dev/null +++ b/sci-chemistry/cns/cns-1.2.1-r5.ebuild @@ -0,0 +1,223 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/cns/cns-1.2.1-r5.ebuild,v 1.1 2010/11/16 20:05:49 xarthisius Exp $ + +EAPI="3" + +inherit eutils fortran toolchain-funcs versionator flag-o-matic + +MY_PN="${PN}_solve" +MY_PV="$(delete_version_separator 2)" +MY_P="${MY_PN}_${MY_PV}" + +DESCRIPTION="Crystallography and NMR System" +HOMEPAGE="http://cns.csb.yale.edu/" +SRC_URI="${MY_P}_all-mp.tar.gz + aria? ( aria2.3.1.tar.gz )" + +SLOT="0" +LICENSE="cns" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="aria openmp" + +RDEPEND="app-shells/tcsh" +DEPEND="${RDEPEND}" +PDEPEND="aria? ( ~sci-chemistry/aria-2.3.1 )" + +RESTRICT="fetch" +S="${WORKDIR}/${MY_P}" + +FORTRAN="gfortran ifc" + +pkg_nofetch() { + elog "Fill out the form at http://cns.csb.yale.edu/cns_request/" + use aria && elog "and http://aria.pasteur.fr/" + elog "and place these files:" + elog ${A} + elog "in ${DISTDIR}." +} + +pkg_setup() { + fortran_pkg_setup + + if [[ $(tc-getCC) == *gcc* ]] && + ( [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] || + ! built_with_use sys-devel/gcc openmp ) + then + ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 " + ewarn "Switch CC to an OpenMP capable compiler" + fi +} + +src_prepare() { + epatch "${FILESDIR}"/${PV}-gentoo.patch + epatch "${FILESDIR}"/${PV}-parallel.patch + + if use aria; then + pushd "${WORKDIR}"/aria* >& /dev/null + # Update the cns sources in aria for version 1.2.1 + epatch "${FILESDIR}"/1.2.1-aria2.3.patch + + # Update the code with aria specific things + cp -rf cns/src/* "${S}"/source/ + popd >& /dev/null + fi + + # the code uses Intel-compiler-specific directives + if [[ ${FORTRANC} == gfortran ]]; then + epatch "${FILESDIR}"/${PV}-allow-gcc-openmp.patch + use openmp && \ + OMPLIB="-lgomp" && append-flags -fopenmp + COMP="gfortran" + use amd64 && \ + append-fflags -fdefault-integer-8 + else + epatch "${FILESDIR}"/${PV}-ifort.patch + use openmp && OMPLIB="-liomp5" && \ + append-flags -openmp && append-ldflags -openmp + COMP="ifort" + use amd64 && append-fflags -i8 + append-fflags -Vaxlib + append-ldflags -Vaxlib + fi + + use amd64 && \ + append-cflags "-DINTEGER='long long int'" + + # Set up location for the build directory + # Uses obsolete `sort` syntax, so we set _POSIX2_VERSION + cp "${FILESDIR}"/cns_solve_env_sh "${T}"/ + sed -i \ + -e "s:_CNSsolve_location_:${S}:g" \ + -e "17 s:\(.*\):\1\nsetenv _POSIX2_VERSION 199209:g" \ + "${S}"/cns_solve_env + sed -i \ + -e "s:_CNSsolve_location_:${S}:g" \ + -e "17 s:\(.*\):\1\nexport _POSIX2_VERSION; _POSIX2_VERSION=199209:g" \ + "${T}"/cns_solve_env_sh + + einfo "Fixing shebangs..." + find "${S}" -type f \ + -exec sed "s:/bin/csh:${EPREFIX}/bin/csh:g" -i '{}' \; || die +} + +src_compile() { + local GLOBALS + local MALIGN + if [[ ${FORTRANC} = g77 ]]; then + GLOBALS="-fno-globals" + MALIGN='\$(CNS_MALIGN_I86)' + fi + + # Set up the compiler to use + pushd instlib/machine/unsupported/g77-unix 2>/dev/null + ln -s Makefile.header Makefile.header.${FORTRANC} || die + popd 2>/dev/null + + # make install really means build, since it's expected to be used in-place + # -j1 doesn't mean we do no respect MAKEOPTS! + emake -j1 \ + CC="$(tc-getCC)" \ + F77="${FORTRANC}" \ + LD="${FORTRANC}" \ + CCFLAGS="${CFLAGS} -DCNS_ARCH_TYPE_\$(CNS_ARCH_TYPE) \$(EXT_CCFLAGS)" \ + LDFLAGS="${LDFLAGS}" \ + F77OPT="${FFLAGS:- -O2} ${MALIGN}" \ + F77STD="${GLOBALS}" \ + OMPLIB="${OMPLIB}" \ + compiler="${COMP}" \ + install \ + || die "emake failed" + +} + +src_test() { + # We need to force on g77 manually, because we can't get aliases working + # when we source in a -c + einfo "Running tests ..." + sh -c \ + "export CNS_G77=ON; source ${T}/cns_solve_env_sh; make run_tests" \ + || die "tests failed" + einfo "Displaying test results ..." + cat "${S}"/*_g77/test/*.diff-test +} + +src_install() { + # Install to locations resembling FHS + sed -i \ + -e "s:${S}:usr:g" \ + -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_ROOT ${EPREFIX}/usr:g" \ + -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_DATA \$CNS_ROOT/share/cns:g" \ + -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_DOC \$CNS_ROOT/share/doc/${PF}:g" \ + -e "s:CNS_LIB \$CNS_SOLVE/libraries:CNS_LIB \$CNS_DATA/libraries:g" \ + -e "s:CNS_MODULE \$CNS_SOLVE/modules:CNS_MODULE \$CNS_DATA/modules:g" \ + -e "s:CNS_HELPLIB \$CNS_SOLVE/helplib:CNS_HELPLIB \$CNS_DATA/helplib:g" \ + -e "s:\$CNS_SOLVE/bin/cns_info:\$CNS_DATA/cns_info:g" \ + "${S}"/cns_solve_env + # I don't entirely understand why the sh version requires a leading / + # for CNS_SOLVE and CNS_ROOT, but it does + sed -i \ + -e "s:${S}:/usr:g" \ + -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_ROOT=${EPREFIX}/usr:g" \ + -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_DATA=\$CNS_ROOT/share/cns:g" \ + -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_DOC=\$CNS_ROOT/share/doc/${PF}:g" \ + -e "s:CNS_LIB=\$CNS_SOLVE/libraries:CNS_LIB=\$CNS_DATA/libraries:g" \ + -e "s:CNS_MODULE=\$CNS_SOLVE/modules:CNS_MODULE=\$CNS_DATA/modules:g" \ + -e "s:CNS_HELPLIB=\$CNS_SOLVE/helplib:CNS_HELPLIB=\$CNS_DATA/helplib:g" \ + -e "s:\$CNS_SOLVE/bin/cns_info:\$CNS_DATA/cns_info:g" \ + "${T}"/cns_solve_env_sh + + # Get rid of setup stuff we don't need in the installed script + sed -i \ + -e "83,$ d" \ + -e "37,46 d" \ + "${S}"/cns_solve_env + sed -i \ + -e "84,$ d" \ + -e "39,50 d" \ + "${T}"/cns_solve_env_sh + + newbin "${S}"/*linux*/bin/cns_solve* cns_solve \ + || die "install cns_solve failed" + + # Can be run by either cns_solve or cns + dosym cns_solve /usr/bin/cns + + # Don't want to install this + rm -f "${S}"/*linux*/utils/Makefile + + dobin "${S}"/*linux*/utils/* || die "install utils failed" + + sed -i \ + -e "s:\$CNS_SOLVE/doc/:\$CNS_SOLVE/share/doc/${PF}/:g" \ + "${S}"/bin/cns_web || die + + dobin "${S}"/bin/cns_{edit,header,transfer,web} || die "install bin failed" + + insinto /usr/share/cns + doins -r "${S}"/libraries "${S}"/modules "${S}"/helplib || die + doins "${S}"/bin/cns_info || die + + insinto /etc/profile.d + newins "${S}"/cns_solve_env cns_solve_env.csh || die + newins "${T}"/cns_solve_env_sh cns_solve_env.sh || die + + dohtml \ + -A iq,cgi,csh,cv,def,fm,gif,hkl,inp,jpeg,lib,link,list,mask,mtf,param,pdb,pdf,pl,ps,sc,sca,sdb,seq,tbl,top \ + -f all_cns_info_template,omac,def \ + -r doc/html/* || die + # Conflits with app-text/dos2unix + rm -f "${D}"/usr/bin/dos2unix +} + +pkg_info() { + if use openmp; then + elog "Set OMP_NUM_THREADS to the number of threads you want." + elog "If you get segfaults on large structures, set the GOMP_STACKSIZE" + elog "variable if using gcc (16384 should be good)." + fi +} + +pkg_postinst() { + pkg_info +} |