summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzenln <alen.kansakar@gmail.com>2017-08-07 17:41:51 -0500
committerAdam J. Stewart <ajstewart426@gmail.com>2017-08-07 17:41:51 -0500
commit33cb093870a88badae0bfd54d302baf901f4a12f (patch)
tree050faf5fd2e1f6dcf099c92188170a86de3817aa
parent323d2d9aed299b78fea67aa6d8d98889464cebe9 (diff)
downloadspack-33cb093870a88badae0bfd54d302baf901f4a12f.tar.gz
spack-33cb093870a88badae0bfd54d302baf901f4a12f.tar.bz2
spack-33cb093870a88badae0bfd54d302baf901f4a12f.tar.xz
spack-33cb093870a88badae0bfd54d302baf901f4a12f.zip
Add a new package for molcas (#5008)
* Molcas 8.2: Adding molcas spec file * Molcas 8.2: Putting in patch file for molcas driver not to be installed in spack stage directory * Molcas making changes * Making changes in ordering
-rw-r--r--var/spack/repos/builtin/packages/molcas/install_driver.patch114
-rw-r--r--var/spack/repos/builtin/packages/molcas/package.py48
2 files changed, 162 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/molcas/install_driver.patch b/var/spack/repos/builtin/packages/molcas/install_driver.patch
new file mode 100644
index 0000000000..717e776aee
--- /dev/null
+++ b/var/spack/repos/builtin/packages/molcas/install_driver.patch
@@ -0,0 +1,114 @@
+--- molcas82/sbin/install_driver.sh 2017-02-14 04:35:06.000000000 -0600
++++ molcas82/sbin/install_driver.sh 2017-08-04 15:08:17.872417692 -0500
+@@ -1,110 +1,3 @@
+ #!/bin/sh
+
+-echo `pwd` > $HOME/.Molcas/molcas 2> /dev/null
+-
+-# current driver version
+-if [ -z "$1" ] ; then
+- driver_file="sbin/molcas.driver"
+-else
+- driver_file="$1"
+-fi
+-current_version=`sed -e 's/.*Molcas driver shell script version // ; tx ; d ; :x s/\.//' $driver_file`
+-
+-MOLCASDRIVER=""
+-
+-# check location of driver script in your PATH
+-installed=0
+-
+-orig_IFS=$IFS
+-IFS=':'
+-for x in $PATH; do
+- if [ -f "$x/molcas" ]; then
+- l=`sed -e 's/.*Molcas driver shell script version // ; tx ; d ; :x s/\.//' "$x/molcas"`
+- if [ "$l" -lt "$current_version" ]; then
+- echo "*** Warning! An old version of the molcas driver script was found at: $x"
+- rm -f "$x/molcas" > /dev/null 2>&1
+- if [ "$?" != 0 ]; then
+- echo "*** $x/molcas is read only!"
+- echo "*** You have to remove this file manually"
+- echo ""
+- else
+- echo " and removed..."
+- MOLCASDRIVER="$x"
+- fi
+- else
+- echo "Molcas driver has been found at: $x"
+- MOLCASDRIVER="$x"
+- installed=1
+- fi
+- break
+- fi
+-done
+-
+-# latest version already installed, exit
+-if [ $installed = 1 ] ; then
+- exit 0
+-fi
+-
+-# try to find proper location for molcas driver
+-if [ -z "$MOLCASDRIVER" ]; then
+- # no existing version found, use default PATH
+- if [ -z "$PATH" ]; then
+- E_PATH="$HOME/bin"
+- else
+- E_PATH="$HOME/bin:$PATH"
+- fi
+-else
+- # a previous version was found, create it there
+- E_PATH="$MOLCASDRIVER"
+-fi
+-
+-# find first writable directory
+-dir_found=0
+-for x in $E_PATH ; do
+- if [ "$x" = "." ] ; then continue ; fi
+- # detect if directory is writable (-w would not work, since it does not handle mount permissions)
+- cp "$driver_file" "$x/this_is_not_molcas" > /dev/null 2>&1
+- if [ "$?" = 0 ] ; then
+- rm -f "$x/this_is_not_molcas" > /dev/null 2>&1
+- MOLCASDRIVER="$x"
+- dir_found=1
+- break
+- fi
+-done
+-
+-# create a default molcas driver
+-if [ $dir_found = 0 ] ; then
+- echo "*** Warning! Could not find a proper directory to install the molcas driver"
+- echo ""
+- echo "*** Check that there is a directory in your PATH with write access"
+- echo "*** (for example $HOME/bin) and restart the installation"
+- echo ""
+- echo "*** You have to put the molcas driver in any directory in your PATH"
+-else
+- echo "molcas driver will be installed in $MOLCASDRIVER"
+- echo "Is this OK?"
+- while true; do
+- read answer
+- case "${answer}_" in
+- [Yy]*|_ )
+- cp "$driver_file" "$MOLCASDRIVER/molcas"
+- chmod +x "$MOLCASDRIVER/molcas"
+- # check again the driver was installed
+- l=`sed -e 's/.*Molcas driver shell script version // ; tx ; d ; :x s/\.//' "$x/molcas"`
+- if [ "$l" -eq "$current_version" -a -x "$MOLCASDRIVER/molcas" ] ; then
+- echo "Driver installation successful"
+- else
+- echo "*** Driver installation failed!"
+- echo ""
+- echo "*** You have to put the molcas driver in any directory in your PATH"
+- fi
+- break ;;
+- [Nn]* )
+- echo "*** Driver installation canceled!"
+- echo ""
+- echo "*** You have to put the molcas driver in any directory in your PATH"
+- break ;;
+- * ) echo "Please answer yes or no"
+- esac
+- done
+-fi
++echo `Driver Will be in the sbin folder`
diff --git a/var/spack/repos/builtin/packages/molcas/package.py b/var/spack/repos/builtin/packages/molcas/package.py
new file mode 100644
index 0000000000..c5d92b9c50
--- /dev/null
+++ b/var/spack/repos/builtin/packages/molcas/package.py
@@ -0,0 +1,48 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+import os
+
+
+class Molcas(CMakePackage):
+ """Molcas is an ab initio quantum chemistry software package
+ developed by scientists to be used by scientists.
+ Please set the path to licence file with the following command
+ export MOLCAS_LICENSE=/path/to/molcas/license/"""
+
+ homepage = "http://www.molcas.org/"
+ url = "file://{0}/molcas8.2.tar.gz".format(os.getcwd())
+
+ version('8.2', '25b5fb8e1338b458a3eaea0b3d3b5e58')
+
+ # Licensing
+ license_required = True
+ license_vars = ['MOLCAS_LICENSE']
+
+ depends_on('openmpi')
+ depends_on('openblas')
+ depends_on('hdf5')
+
+ patch('install_driver.patch')