55
66from spack import *
77import os
8- import subprocess
98
109
1110class Molpro (Package ):
1211 """Molpro is an ab initio program for electronic structure calculations."""
1312
1413 homepage = "http://www.molpro.net"
15- url = "fake_url. tar.gz"
14+ url = 'file://%s/molpro-2019.2. tar.gz' % os . getcwd ()
1615
17- version ('2015.1' ,
18- '13da76da1a150fb513a8b0a5da5ddce8' ,
19- url = 'file://%s/molpro-2016-12-05.tar.gz' % os .getcwd ())
16+ version ('2019.2' , sha256 = '168fb70b219166af5e463be4d1a459d6f3f9991cde5774b0a3c84d2a13f9cfd7' )
17+ version ('2015.1' , sha256 = 'a51df73acd54911fcc2d468ffa66676fb83117bb4e463eefe22dcaba4645c477' )
2018
2119 variant ('mpi' , default = True , description = 'Build with MPI support' )
2220
2321 depends_on ('blas' )
2422 depends_on ('lapack' )
23+ depends_on ('python@:3' , when = '@2019:' )
24+
2525 depends_on ('mpi' , when = '+mpi' )
26+ depends_on ('eigen' , when = '@2019:' )
2627
2728 # For a successful installation of Molpro either the environment variable
2829 # $MOLPRO_KEY or the file $HOME/.molpro/token has to exist. The content
@@ -44,17 +45,21 @@ def install(self, spec, prefix):
4445 if '+mpi' in spec :
4546 options .append ('FC=%s' % spec ['mpi' ].mpifc )
4647 options .append ('CXX=%s' % spec ['mpi' ].mpicxx )
47- if '%intel' in spec :
48- options .append ('--enable-mpp=%s/intel64/include' %
49- spec ['mpi' ].prefix )
48+ if self .version < Version ('2019' ):
49+ if '%intel' in spec :
50+ options .append ('--enable-mpp=%s/intel64/include' %
51+ spec ['mpi' ].prefix )
52+ elif '%gcc' :
53+ options .append ('--enable-mpp=%s' %
54+ spec ['mpi' ].prefix .include )
55+ options .append ('F90FLAGS=-ffree-line-length-none' )
5056 else :
51- options .append ('F90FLAGS=-ffree-line-length-none' )
52- options .append ('--enable-mpp=%s' % spec ['mpi' ].prefix .include )
57+ options .append ('--without-ga' )
5358 configure (* options )
5459
55- # Molpro wants to use mpirun_rsh during the installation.
60+ # Molpro wants to use a variation of mpirun during the installation.
5661 # We need to change the LAUNCHER in CONFIG to something not MPI
57- # dependent to avoid problems with SLURM .
62+ # dependent to avoid problems with Slurm .
5863 filter_file (r'^LAUNCHER=.*' , 'LAUNCHER=%x' , 'CONFIG' )
5964 make ()
6065
@@ -65,5 +70,11 @@ def install(self, spec, prefix):
6570 make ('install' )
6671
6772 def setup_environment (self , spack_env , run_env ):
73+ if self .version < Version ('2019' ):
74+ dir_base_name = 'molprop'
75+ else :
76+ dir_base_name = 'molpro'
77+ directory = '{0}_{1}_linux_x86_64_i8' .format (dir_base_name ,
78+ self .version .up_to (2 ).underscored )
6879 run_env .prepend_path ('PATH' , join_path (self .prefix ,
69- 'molprop_2015_1_linux_x86_64_i8' , 'bin' ))
80+ directory , 'bin' ))
0 commit comments