diff options
author | Justin Lecher <jlec@gentoo.org> | 2010-11-17 13:10:04 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2010-11-17 13:10:04 +0000 |
commit | d70ebd5cf353f5144be3945c34dc81accc4b5dad (patch) | |
tree | 864427359da108429c2fed097a8dd7dca1fd0ea7 /sci-chemistry | |
parent | Version bump. Remove old version. (diff) | |
download | historical-d70ebd5cf353f5144be3945c34dc81accc4b5dad.tar.gz historical-d70ebd5cf353f5144be3945c34dc81accc4b5dad.tar.bz2 historical-d70ebd5cf353f5144be3945c34dc81accc4b5dad.zip |
Version Bump
Package-Manager: portage-2.1.9.24/cvs/Linux x86_64
Diffstat (limited to 'sci-chemistry')
-rw-r--r-- | sci-chemistry/cns/ChangeLog | 8 | ||||
-rw-r--r-- | sci-chemistry/cns/Manifest | 15 | ||||
-rw-r--r-- | sci-chemistry/cns/cns-1.3.ebuild | 208 | ||||
-rw-r--r-- | sci-chemistry/cns/files/1.3-delete.patch | 13 | ||||
-rw-r--r-- | sci-chemistry/cns/files/1.3-gentoo.patch | 76 | ||||
-rw-r--r-- | sci-chemistry/cns/files/cns_solve_env_sh-1.3 | 229 |
6 files changed, 542 insertions, 7 deletions
diff --git a/sci-chemistry/cns/ChangeLog b/sci-chemistry/cns/ChangeLog index f9a32a5912a6..ddf3bacbbbc6 100644 --- a/sci-chemistry/cns/ChangeLog +++ b/sci-chemistry/cns/ChangeLog @@ -1,6 +1,12 @@ # 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.25 2010/11/16 20:05:49 xarthisius Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/cns/ChangeLog,v 1.26 2010/11/17 13:10:04 jlec Exp $ + +*cns-1.3 (17 Nov 2010) + + 17 Nov 2010; Justin Lecher <jlec@gentoo.org> +files/1.3-delete.patch, + +files/1.3-gentoo.patch, +files/cns_solve_env_sh-1.3, +cns-1.3.ebuild: + Version Bump *cns-1.2.1-r5 (16 Nov 2010) diff --git a/sci-chemistry/cns/Manifest b/sci-chemistry/cns/Manifest index 6ba9f342d1fd..7da8baa911d8 100644 --- a/sci-chemistry/cns/Manifest +++ b/sci-chemistry/cns/Manifest @@ -9,7 +9,10 @@ AUX 1.2.1-aria2.3.patch 658 RMD160 a372156b7a783cb78c81aadae2eca5c64c9630e5 SHA1 AUX 1.2.1-gentoo.patch 2411 RMD160 a82893524541961a9797fd2bb84982e609fda717 SHA1 7d3168a9cf7622923138022a5683aa65b5d5c34d SHA256 58972606d23d87fdeb08c9e37d9d5c536983e5a1ad4647dedd5b283ef67bc52c AUX 1.2.1-ifort.patch 5346 RMD160 106cf7dc7b4e13674fdf34ca0fd9af78effbc84b SHA1 26ccc71740ee2539352009f730b79b2ae20b5047 SHA256 bac35147159fac06fcb3a03a4f09c56224d4ee852b86a771121d98c42f3a9c65 AUX 1.2.1-parallel.patch 641 RMD160 dffcaf7a4d7c79b9362640b64e677a7fde04ac80 SHA1 5de790cee7acf9ff4a87a61fdc866c330ef6d6f1 SHA256 7cd3312c35d2dbbd2146fdfa977f9866365c4a7be16787b1ba5d9807ff823d31 +AUX 1.3-delete.patch 448 RMD160 17b6ac426c11ae1832e7edf71a954e02434a5a46 SHA1 cd6f63a167dd9392c35d06ffdd31afd086e5c146 SHA256 aa61180b60fd008e3ba445bab5a4a6b0c4634b34fc5655be94ce07dc45abe958 +AUX 1.3-gentoo.patch 2536 RMD160 335c1e6374f3ad9b4340de223ce5e481e96ac875 SHA1 99072abd426614979eb7659a4fb2187bb5ffb3d2 SHA256 0cf8135a5680ebd3df0474d3b04e66c08e8b31547afeed91ceb3108dce8d8864 AUX cns_solve_env_sh 7070 RMD160 4104b22476a61a80c7adae8a363da1dd4ab4f136 SHA1 30ba978f4862fd94d9fa939cbb7c3eb55ece46cd SHA256 da571cba2a2244e571870b1783fd6cdce1b595e14234cfb43011e9e9eb50151c +AUX cns_solve_env_sh-1.3 7332 RMD160 eee19d64dc863e434159994282a78d8d576adf62 SHA1 050de938d0c0b4d1e497b03ff196416e416a0da7 SHA256 88127d99380544e502dfe3b3a7788102a7f6b30e7245b26e5e204b8b611bbc1d DIST aria2.2.tar.gz 1710084 RMD160 b96a900befd5521649ccce84d4d5b93d30709799 SHA1 faa5ff9e7682026afc334f1c8b3b10259a5e69f9 SHA256 a1695ee11b06a045c4b4bb9f0113d1e48c86e12d4149c0dcb505ca894069d054 DIST aria2.3.1.tar.gz 1833973 RMD160 f2ee0bfc7e3164b5c34c81abb74256c5d76f53d7 SHA1 b257094bdaf6ba5b64645b8251d9243654e6d0fc SHA256 cc45ed2d66182cf0ee197a7cf3bc7edd8d5043d95cdcd19e1cec9aeb82c2fdbc DIST cns_solve_1.1_basic_inputs.tar.gz 5049767 RMD160 eb5686a006d53cf269456eaecd7507842c8a10eb SHA1 255e7c5170168f9e032ef9e84a870eddf176f4ce SHA256 916d86d96159bd945a3b05e26c71af0cc6097234776385630f618fa2641cf3eb @@ -18,6 +21,7 @@ DIST cns_solve_1.1_test.tar.gz 2852870 RMD160 2f7e7b5ed4e603b2459944a8991829d136 DIST cns_solve_1.21_all-mp.tar.gz 32748040 RMD160 0da9c1858e858474a8798149b7692b9e097adc9e SHA1 3ba32a6622b55dfff397b6844e8b8a594124a482 SHA256 7ab464e20932eb024ba6378738da77a4a03642d63b0ca9772b612a7cf27baec1 DIST cns_solve_1.21_all.tar.gz 32739912 RMD160 ab763373923264497d1ccb507cab23b2e1af9826 SHA1 93059805e14f0482cf58755daecc52cf97863215 SHA256 a581c6a0e9e5ffd45f025520959921d7ba91bb5d1e6569f1c81e709bb6f87c81 DIST cns_solve_1.2_all.tar.gz 30456531 RMD160 45cff57b3f026d730032cfc1c9476880f7cc81ab SHA1 1611ad499746993a9d210e6053e1cdd1553848a7 SHA256 230847d8e00def4b55dda8c50d9148bca11a88ed6bc575e735041c91f8fff064 +DIST cns_solve_1.3_all.tar.gz 61208156 RMD160 430e733e05166330b93977e48b72546c4ddabadd SHA1 b708e3006627642279ae571c31d6ec013adaa4c6 SHA256 de5c0be8ab924f5cbd57b1d651fcfea32a76766b7ff4af69556203191b4e40b6 EBUILD cns-1.1.ebuild 3598 RMD160 c659528cda734552ca1faa9bc85c371b92d90d46 SHA1 e891a1be5f873e869bce5a6b617bbfd54a7aa71d SHA256 2be38322ddc333590c4d891f675921cabb0e18ef795042c1c4a849beb0793f6b EBUILD cns-1.2-r1.ebuild 4467 RMD160 cc3f1a26a8c28c111f25b74572dc4af3bb1d56c9 SHA1 f4da145be4190c1837e3262291f75c9eeaa3ef2d SHA256 ac40399a59987612e7602811cb79fdb4ae0295d23222afb6947ad1b79f5a8238 EBUILD cns-1.2.1-r1.ebuild 5585 RMD160 d25d66002ffe133c390912e265f81aae860134c9 SHA1 239355135deb0213fe9bb9c85c480e3bce86a887 SHA256 9c91c6093b03f28c7c59cd73aa08c32397867fce5bfc28a6f1b5534a92c73ec4 @@ -27,14 +31,13 @@ EBUILD cns-1.2.1-r4.ebuild 6582 RMD160 544cf18f4dd459c7d2325da7998fef6db0eebaa3 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 4500 RMD160 4d0cfea2f8c7a9798b000d9bd3ac5a30a8d806e1 SHA1 1aa7a55e53334007978f004beb65140a484b2d20 SHA256 a19abdc674b3431e08e86e9eb3607033c4d3bdf87aa563731bf3709a45c8d062 +EBUILD cns-1.3.ebuild 5763 RMD160 719c446c9efb69ab36e308a8ea1673e22b1c9357 SHA1 e6921f1814aa51b8d6e757700fcba68f7bc2dd4f SHA256 cfa1b1f03c51cb3c0fbe60c7e3f81f2d55be0aed7950e6181b70ce492763efd2 +MISC ChangeLog 4679 RMD160 ce4873d827a347d47ae19a3bf5c51b215cfa2282 SHA1 c990b481eab917d844dba4152e758b47d8edb1ee SHA256 c9d306e158e161e223bdcd6fe26e8fa1399a90577b85e36b8a7343137ee1a291 MISC metadata.xml 302 RMD160 d60d9cd875115eaba68ad4b504bff76b39a136b0 SHA1 ecdd8feeea2de489927403f1941acfc582c17222 SHA256 a374144760a8ac1f72b1c625c41f98cee3f74511c964133bda119da580664c50 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) -iJwEAQECAAYFAkzi5CYACgkQIiMqcbOVdxR8dwP+OMBCoGhSWqR3otNDKUkOb9WL -AdAX3fF8gFGAOgqvlteAZnz2EvBttc8Pouwx/yST/c7NQdcc8eCtF5HEC2dwJuVD -7Ya3tyJjIEbZzYf41FQd7OuCLZWZT7k2GTpfPxTB90mD3FA4/UyN+TeZqUsPshxh -2NKzLT4piomaE8TxtPI= -=NEEx +iEYEARECAAYFAkzj1DIACgkQgAnW8HDreRYqDgCg0AFLX4y4VGLvqqJc0HBN4+mr +LY4An3zbhOaZ+Jlxr3v86v28cSFf4ui6 +=35Xe -----END PGP SIGNATURE----- diff --git a/sci-chemistry/cns/cns-1.3.ebuild b/sci-chemistry/cns/cns-1.3.ebuild new file mode 100644 index 000000000000..22e5224782de --- /dev/null +++ b/sci-chemistry/cns/cns-1.3.ebuild @@ -0,0 +1,208 @@ +# 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.3.ebuild,v 1.1 2010/11/17 13:10:04 jlec 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.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 \ + "${FILESDIR}"/${PV}-delete.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 + use openmp && \ + OMPLIB="-lgomp" && append-flags -fopenmp + COMP="gfortran" + use amd64 && \ + append-fflags -fdefault-integer-8 + else + 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-${PV} "${T}"/cns_solve_env_sh || die + 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 + + ebegin "Fixing shebangs..." + find "${S}" -type f \ + -exec sed "s:/bin/csh:${EPREFIX}/bin/csh:g" -i '{}' \; || die + find . -name "Makefile*" \ + -exec \ + sed \ + -e "s:^SHELL=/bin/sh:SHELL=${EPREFIX}/bin/sh:g" \ + -e "s:/bin/ls:ls:g" \ + -e "s:/bin/rm:rm:g" \ + -i '{}' \; || die + eend +} + +src_compile() { + local GLOBALS + local MALIGN + + # 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)" \ + CXX="$(tc-getCXX)" \ + F77="${FORTRANC}" \ + LD="${FORTRANC}" \ + CCFLAGS="${CFLAGS} -DCNS_ARCH_TYPE_\$(CNS_ARCH_TYPE) \$(EXT_CCFLAGS)" \ + CXXFLAGS="${CXXFLAGS} -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() { + cat >> "${T}"/66cns <<- EOF + CNS_SOLVE="${EPREFIX}/usr" + CNS_ROOT="${EPREFIX}/usr" + CNS_DATA="${EPREFIX}/usr/share/cns" + CNS_DOC="${EPREFIX}/usr/share/doc/cns-1.3" + CNS_LIB="${EPREFIX}/usr/share/cns/libraries" + CNS_MODULE="${EPREFIX}/usr/share/cns/modules" + CNS_TOPPAR="${EPREFIX}/usr/share/cns/libraries/toppar" + CNS_CONFDB="${EPREFIX}/usr/share/cns/libraries/confdb" + CNS_XTALLIB="${EPREFIX}/usr/share/cns/libraries/xtal" + CNS_NMRLIB="${EPREFIX}/usr/share/cns/libraries/nmr" + CNS_XRAYLIB="${EPREFIX}/usr/share/cns/libraries/xray" + CNS_XTALMODULE="${EPREFIX}/usr/share/cns/modules/xtal" + CNS_NMRMODULE="${EPREFIX}/usr/share/cns/modules/nmr" + CNS_HELPLIB="${EPREFIX}/usr/share/cns/helplib" + EOF + + doenvd "${T}"/66cns || die + + # Don't want to install this + rm -f "${S}"/*linux*/utils/Makefile + + sed -i \ + -e "s:\$CNS_SOLVE/doc/:\$CNS_SOLVE/share/doc/${PF}/:g" \ + "${S}"/bin/cns_web || die + + 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 + + dobin \ + "${S}"/*linux*/utils/* \ + "${S}"/bin/cns_{edit,header,import_cif,transfer,web} || die "install bin failed" + + insinto /usr/share/cns + doins -r "${S}"/libraries "${S}"/modules "${S}"/helplib "${S}"/bin/cns_info || 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 || die +} + +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 +} diff --git a/sci-chemistry/cns/files/1.3-delete.patch b/sci-chemistry/cns/files/1.3-delete.patch new file mode 100644 index 000000000000..cbddf4289158 --- /dev/null +++ b/sci-chemistry/cns/files/1.3-delete.patch @@ -0,0 +1,13 @@ +diff --git a/utils/cluster_struc.cpp b/utils/cluster_struc.cpp +index b64467a..5f727db 100644 +--- a/utils/cluster_struc.cpp ++++ b/utils/cluster_struc.cpp +@@ -173,7 +173,7 @@ int main(int argc, char *argv[]) { + for (int i = 0; i < nrstruc; i++) { + delete[] neighbor[i]; + } +- delete[] neighbor, neighborcount; ++ delete[] neighbor, delete[] neighborcount; + return 5; + } + if (rmsd < cutoff) { diff --git a/sci-chemistry/cns/files/1.3-gentoo.patch b/sci-chemistry/cns/files/1.3-gentoo.patch new file mode 100644 index 000000000000..95961fe6ff0c --- /dev/null +++ b/sci-chemistry/cns/files/1.3-gentoo.patch @@ -0,0 +1,76 @@ +diff --git a/instlib/source/Makefile.proto b/instlib/source/Makefile.proto +index 0d0dd3e..dd4b680 100644 +--- a/instlib/source/Makefile.proto ++++ b/instlib/source/Makefile.proto +@@ -11,6 +11,8 @@ + + SHELL=/bin/sh + ++cns_string=`date "+%y%m%d%H%M"` ++ + # commands + RM = /bin/rm + +@@ -19,32 +21,26 @@ DEPENDS = $(OBJS) dmemory.o machine_c.o + + # the default is to make the cns executable + cns_solve: +- @ make -k printflags F77BUG="$(debug)" DEBUG="$(debug)" +- @ make -k ../bin/cns_solve F77BUG="$(debug)" DEBUG="$(debug)" +- @ make -k exepurge ++ @ make printflags F77BUG="$(debug)" DEBUG="$(debug)" ++ @ make ${MAKEOPTS} ../bin/cns_solve F77BUG="$(debug)" DEBUG="$(debug)" ++ @ make exepurge + + # rule for the fortran routines + $(OBJS): +- @ echo "compiling: $(@:.o=.f)"; \ +- $(F77) -c $(F77FLAGS) $(@:.o=.f) ++ $(F77) -c $(F77FLAGS) $(@:.o=.f) + + # rule for the dynamic memory allocation C routines + dmemory.o: dmemory.c +- @ echo ; echo "compiling: $?" +- @ $(CC) -c $(CCFLAGS) $? ++ $(CC) -c $(CCFLAGS) $? + + # rule for the machine specific C routines + machine_c.o: machine_c.c +- @ echo ; echo "compiling: $?" +- @ $(CC) -c $(CCFLAGS) $? ++ $(CC) -c $(CCFLAGS) $? + + # rule for the executable itself + ../bin/cns_solve: $(DEPENDS) +- @ echo ; echo "linking: cns_solve"; echo +- @ cns_string=`date "+%y%m%d%H%M"`; \ +- $(LD) -o cns_solve-$$cns_string.exe $(OBJS) dmemory.o machine_c.o \ +- $(LDFLAGS) \ +- $(CNS_FFTDIR) $(CNS_FFTLIB); \ ++ $(LD) $(LDFLAGS) -o cns_solve-$$cns_string.exe $(OBJS) dmemory.o machine_c.o \ ++ $(CNS_FFTDIR) $(CNS_FFTLIB) $(OMPLIB); \ + if [ -x cns_solve-$$cns_string.exe ]; \ + then echo "created executable file cns_solve-$$cns_string.exe"; \ + echo ""; cd ../bin; $(RM) -f cns_solve; $(RM) -f cns; \ +@@ -59,7 +55,7 @@ printflags: + @ echo; echo "flags:"; \ + echo " fortran -> [$(F77)] $(F77FLAGS)"; \ + echo " c -> [$(CC)] $(CCFLAGS)"; \ +- echo " link -> [$(LD)] $(LDFLAGS) $(CNS_FFTDIR) $(CNS_FFTLIB)"; \ ++ echo " link -> [$(LD)] $(LDFLAGS) $(CNS_FFTDIR) $(CNS_FFTLIB) $(OMP_LIB)"; \ + echo + + # regenerate makefiles +diff --git a/instlib/utils/Makefile b/instlib/utils/Makefile +index 98de84f..2b0a9ce 100644 +--- a/instlib/utils/Makefile ++++ b/instlib/utils/Makefile +@@ -28,7 +28,7 @@ utils: + $(CC) -o $@ $(CCFLAGS) $(@).c $(CCLINK) + + .cpp: +- $(CPP) -o $@ $(CCFLAGS) $(@).cpp $(CCLINK) ++ $(CXX) -o $@ $(CXXFLAGS) $(@).cpp $(CCLINK) + + .l: + lex $(@).l diff --git a/sci-chemistry/cns/files/cns_solve_env_sh-1.3 b/sci-chemistry/cns/files/cns_solve_env_sh-1.3 new file mode 100644 index 000000000000..12368f87b596 --- /dev/null +++ b/sci-chemistry/cns/files/cns_solve_env_sh-1.3 @@ -0,0 +1,229 @@ +#!/bin/sh +# +# This file sets up the appropriate environmental variables and paths +# for CNSsolve. In the case of the same machines with different versions +# of the OS, backward compatibility is assumed - ie. a later version will +# be setup for a previous version of the OS if nothing else is available. +# +# written by: Paul Adams +# +# copyright Yale University +# +# ========================================================================== +# +# >>>>>> Important: define the location of the CNSsolve directory <<<<<< +# +# CHANGE THE NEXT LINE TO POINT TO THE LOCATION OF THE CNSsolve DIRECTORY + + CNS_SOLVE=_CNSsolve_location_ + +# +# ========================================================================== +# +# full expansion of the CNS_SOLVE variable prior to use. +# +export CNS_SOLVE; CNS_SOLVE=$CNS_SOLVE +# +# ========================================================================== +# +# get the machine architecture +# +if [ -d $CNS_SOLVE ]; then + if [ ! "$CNS_ARCH" ]; then + export CNS_ARCH; CNS_ARCH=`$CNS_SOLVE/bin/getarch` + fi +else + export CNS_ARCH; CNS_ARCH='unknown' +fi +# +# ========================================================================== +# +# system variables for OpenMP +# +# The default stack sizes are usually insufficient, especially when +# CNS is compiled using OpenMP. If the stack sizes are too +# small segfaults may occur. Recommended setting for "stacksize": +limit stacksize unlimited +# +# KMP_STACKSIZE is specific for Intel ifort, icc: +##setenv KMP_STACKSIZE 256m +# +# OMP_STACKSIZE is used by all compilers: +setenv OMP_STACKSIZE 256m +# +# Uncomment the following line and change as appropriate to set the number +# of processors (threads) to use. +###setenv OMP_NUM_THREADS 4 +# +# ========================================================================== +# +# general environmental variables +# +export CNS_LIB; CNS_LIB=$CNS_SOLVE/libraries +export CNS_MODULE; CNS_MODULE=$CNS_SOLVE/modules +export CNS_TOPPAR; CNS_TOPPAR=$CNS_LIB/toppar +export CNS_CONFDB; CNS_CONFDB=$CNS_LIB/confdb +export CNS_XTALLIB; CNS_XTALLIB=$CNS_LIB/xtal +export CNS_NMRLIB; CNS_NMRLIB=$CNS_LIB/nmr +export CNS_XRAYLIB; CNS_XRAYLIB=$CNS_LIB/xray +export CNS_XTALMODULE; CNS_XTALMODULE=$CNS_MODULE/xtal +export CNS_NMRMODULE; CNS_NMRMODULE=$CNS_MODULE/nmr +export CNS_HELPLIB; CNS_HELPLIB=$CNS_SOLVE/helplib +# +# general user aliases +# +cns_web () { $CNS_SOLVE/bin/cns_web; } +cns_header () { $CNS_SOLVE/bin/cns_header; } +cns_info () { cat $CNS_SOLVE/bin/cns_info; } +cns_transfer () { $CNS_SOLVE/bin/cns_transfer; } +if [ -x $CNS_SOLVE/bin/cns_edit_local ]; then + cns_edit () { $CNS_SOLVE/bin/cns_edit_local; } +else + cns_edit () { $CNS_SOLVE/bin/cns_edit; } +fi +# +# g77 compilation and use +# +g77on () { CNS_G77=ON; . $CNS_SOLVE/.cns_solve_env_sh; } +g77off () { unset CNS_G77; . $CNS_SOLVE/.cns_solve_env_sh; } +# +# developer aliases +# +run_tests () { $CNS_SOLVE/bin/run_tests; } +run_diffs () { $CNS_SOLVE/bin/run_diffs; } +maketar () { $CNS_SOLVE/bin/maketar; } +create_patch () { $CNS_SOLVE/bin/create_patch; } +# +# +# ========================================================================== +# +# to do expansions - unset noglob just in case user has it otherwise +# +set +f +# +# try to set up appropriate path +# +# first strip off any trailing information (eg. _g77) +# +CNS_ARCH=`echo ${CNS_ARCH} | sed -e 's/_g77//g'` +# +cns_vendor=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $1}'` +cns_cpu=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $2}'` +cns_os=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $3}'` +cns_major=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $4}'` +cns_minor=`echo $cns_major | sed -e 's/\./ /g'` +# +# if we are looking for a specific type of setup then limit search +# +cns_dirs="" +if [ ! "$CNS_G77" ]; then + if /bin/ls -d $CNS_SOLVE/$cns_vendor-* >/dev/null 2>&1 ; then + cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-* 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`" + fi +else + CNS_ARCH="${CNS_ARCH}_g77" + if /bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 >/dev/null 2>&1 ; then + cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`" + fi +fi +# +# first look for an exact match (with os version) +# +# +cns_found=0 +if [ -n "$cns_dirs" ]; then + for cns_dir in $cns_dirs ; do + cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}'` + if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then + if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major} -o \ + $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major}_g77 ]; then + cns_archenv=$cns_dir + cns_found=1 + fi + fi + done +# +# +# now look for an exact match (without os version) +# + if [ $cns_found -eq 0 ]; then + for cns_dir in $cns_dirs ; do + if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then + if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os} -o \ + $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}_g77 ]; then + cns_archenv=$cns_dir + cns_found=1 + fi + fi + done + fi +# +# now look for a backwards compatible match (with os version major/minor) +# + if [ $cns_found -eq 0 ]; then + for cns_dir in $cns_dirs ; do + if [ $cns_found -eq 0 ]; then + cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}' | sed 's/_g77//g'` + if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then + if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-* ]; then + osv_test=`echo $cns_major $cns_tmp_major | awk '{if ($1 > $2) print 1}'` + if [ $osv_test -eq 1 ]; then + cns_archenv=$cns_dir + cns_found=1 + fi + fi + fi + fi + done + fi +# +# now look for a wildcard match on cpu +# + if [ $cns_found -eq 0 ]; then + cpu_cpu=`echo $cns_cpu | sed 's/[0-9]*\.*[0-9]*$//'` + cpu_ver=`echo $cns_cpu | sed 's/[A-Za-z]*//'` + for cns_dir in $cns_dirs ; do + if [ $cns_found -eq 0 ]; then + cns_tmp_cpu=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[0-9]*\.*[0-9]*$//'` + cns_tmp_ver=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[A-Za-z]*//'` + if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then + if [ $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major} -o \ + $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major}_g77 ]; then + cpu_test=`echo $cpu_ver $cns_tmp_ver | awk '{if ($1 > $2) print 1}'` + if [ $cpu_test -eq 1 ]; then + cns_archenv=$cns_dir + cns_found=1 + fi + fi + fi + fi + done + fi +fi +# +# if found set environment +# +if [ $cns_found -eq 1 ]; then + # + # set installation and source directory + # + export CNS_INST; CNS_INST=$CNS_SOLVE/$cns_archenv + export CNS_SOURCE; CNS_SOURCE=$CNS_INST/source + # + # path for CNSsolve utility programs + # + if [ -d $CNS_SOLVE/$cns_archenv/utils ]; then + export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/utils` + fi + # + # path for CNSsolve executable if installed + # + if [ -d $CNS_SOLVE/$cns_archenv/bin ]; then + export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/bin` + fi +fi +# +unset cns_vendor cns_cpu cns_os cns_major cns_minor cns_tmp_major cns_tmp_minor +unset cns_dir cns_dirs cns_found cns_archenv cns_diff cns_count cns_same +unset cpu_cpu cpu_ver cns_tmp_cpu cns_tmp_ver cpu_test osv_test +# |