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
This commit is contained in:
parent
323d2d9aed
commit
33cb093870
2 changed files with 162 additions and 0 deletions
114
var/spack/repos/builtin/packages/molcas/install_driver.patch
Normal file
114
var/spack/repos/builtin/packages/molcas/install_driver.patch
Normal file
|
@ -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`
|
48
var/spack/repos/builtin/packages/molcas/package.py
Normal file
48
var/spack/repos/builtin/packages/molcas/package.py
Normal file
|
@ -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')
|
Loading…
Reference in a new issue