Updated turbomole package file.
This PR updates the turbomole package file but does not introduce any new funtionality. The updtes are: - use spack interface for subprocess.PIPE and subprocess.Popen - clean up based on flake8 - remove some extra whitespace
This commit is contained in:
parent
4a6ec6377d
commit
fffc2d2765
1 changed files with 46 additions and 30 deletions
|
@ -26,6 +26,7 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class Turbomole(Package):
|
class Turbomole(Package):
|
||||||
"""TURBOMOLE: Program Package for ab initio Electronic Structure
|
"""TURBOMOLE: Program Package for ab initio Electronic Structure
|
||||||
Calculations. NB: Requires a license to download."""
|
Calculations. NB: Requires a license to download."""
|
||||||
|
@ -56,15 +57,14 @@ class Turbomole(Package):
|
||||||
|
|
||||||
def do_fetch(self, mirror_only=True):
|
def do_fetch(self, mirror_only=True):
|
||||||
if '+mpi' in self.spec and '+smp' in self.spec:
|
if '+mpi' in self.spec and '+smp' in self.spec:
|
||||||
raise InstallError('Can not have both SMP and MPI enabled in the same build.')
|
raise InstallError('Can not have both SMP and MPI enabled in the '
|
||||||
|
'same build.')
|
||||||
super(Turbomole, self).do_fetch(mirror_only)
|
super(Turbomole, self).do_fetch(mirror_only)
|
||||||
|
|
||||||
def get_tm_arch(self):
|
def get_tm_arch(self):
|
||||||
# For python-2.7 we could use `tm_arch = subprocess.check_output()`
|
|
||||||
# Use the following for compatibility with python 2.6
|
|
||||||
if 'TURBOMOLE' in os.getcwd():
|
if 'TURBOMOLE' in os.getcwd():
|
||||||
tm_arch = subprocess.Popen(['sh', 'scripts/sysname'],
|
tm_sysname = Executable('./scripts/sysname')
|
||||||
stdout=subprocess.PIPE).communicate()[0]
|
tm_arch = tm_sysname(output=str)
|
||||||
return tm_arch.rstrip('\n')
|
return tm_arch.rstrip('\n')
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
@ -81,8 +81,7 @@ def install(self, spec, prefix):
|
||||||
|
|
||||||
tar('-x', '-z', '-f', 'thermocalc.tar.gz')
|
tar('-x', '-z', '-f', 'thermocalc.tar.gz')
|
||||||
with working_dir('thermocalc'):
|
with working_dir('thermocalc'):
|
||||||
cmd = 'sh install <<<y'
|
subprocess.call('./install<<<y', shell=True)
|
||||||
subprocess.call(cmd, shell=True)
|
|
||||||
|
|
||||||
install_tree('basen', join_path(dst, 'basen'))
|
install_tree('basen', join_path(dst, 'basen'))
|
||||||
install_tree('cabasen', join_path(dst, 'cabasen'))
|
install_tree('cabasen', join_path(dst, 'cabasen'))
|
||||||
|
@ -108,13 +107,19 @@ def install(self, spec, prefix):
|
||||||
install('TURBOMOLE_702_LinuxPC', dst)
|
install('TURBOMOLE_702_LinuxPC', dst)
|
||||||
|
|
||||||
if '+mpi' in spec:
|
if '+mpi' in spec:
|
||||||
install_tree('bin/%s_mpi' % tm_arch, join_path(dst, 'bin', '%s_mpi' % tm_arch))
|
install_tree('bin/%s_mpi' % tm_arch,
|
||||||
install_tree('libso/%s_mpi' % tm_arch, join_path(dst, 'libso', '%s_mpi' % tm_arch))
|
join_path(dst, 'bin', '%s_mpi' % tm_arch))
|
||||||
install_tree('mpirun_scripts/%s_mpi' % tm_arch, join_path(dst, 'mpirun_scripts', '%s_mpi' % tm_arch))
|
install_tree('libso/%s_mpi' % tm_arch,
|
||||||
|
join_path(dst, 'libso', '%s_mpi' % tm_arch))
|
||||||
|
install_tree('mpirun_scripts/%s_mpi' % tm_arch,
|
||||||
|
join_path(dst, 'mpirun_scripts', '%s_mpi' % tm_arch))
|
||||||
elif '+smp' in spec:
|
elif '+smp' in spec:
|
||||||
install_tree('bin/%s_smp' % tm_arch, join_path(dst, 'bin', '%s_smp' % tm_arch))
|
install_tree('bin/%s_smp' % tm_arch,
|
||||||
install_tree('libso/%s_smp' % tm_arch, join_path(dst, 'libso', '%s_smp' % tm_arch))
|
join_path(dst, 'bin', '%s_smp' % tm_arch))
|
||||||
install_tree('mpirun_scripts/%s_smp' % tm_arch, join_path(dst, 'mpirun_scripts', '%s_smp' % tm_arch))
|
install_tree('libso/%s_smp' % tm_arch,
|
||||||
|
join_path(dst, 'libso', '%s_smp' % tm_arch))
|
||||||
|
install_tree('mpirun_scripts/%s_smp' % tm_arch,
|
||||||
|
join_path(dst, 'mpirun_scripts', '%s_smp' % tm_arch))
|
||||||
else:
|
else:
|
||||||
install_tree('bin/%s' % tm_arch, join_path(dst, 'bin', tm_arch))
|
install_tree('bin/%s' % tm_arch, join_path(dst, 'bin', tm_arch))
|
||||||
if '+mpi' in spec or '+smp' in spec:
|
if '+mpi' in spec or '+smp' in spec:
|
||||||
|
@ -134,15 +139,26 @@ def setup_environment(self, spack_env, run_env):
|
||||||
tm_arch = self.get_tm_arch()
|
tm_arch = self.get_tm_arch()
|
||||||
|
|
||||||
run_env.set('TURBODIR', join_path(self.prefix, 'TURBOMOLE'))
|
run_env.set('TURBODIR', join_path(self.prefix, 'TURBOMOLE'))
|
||||||
run_env.set('MOLE_CONTROL', join_path(self.prefix, 'TURBOMOLE', molecontrol_version))
|
run_env.set('MOLE_CONTROL',
|
||||||
|
join_path(self.prefix, 'TURBOMOLE', molecontrol_version))
|
||||||
|
|
||||||
run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'thermocalc'))
|
run_env.prepend_path('PATH',
|
||||||
run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'scripts'))
|
join_path(self.prefix, 'TURBOMOLE', 'thermocalc'))
|
||||||
|
run_env.prepend_path('PATH',
|
||||||
|
join_path(self.prefix, 'TURBOMOLE', 'scripts'))
|
||||||
if '+mpi' in self.spec:
|
if '+mpi' in self.spec:
|
||||||
run_env.set('PARA_ARCH', 'MPI')
|
run_env.set('PARA_ARCH', 'MPI')
|
||||||
run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'bin', '%s_mpi' % tm_arch))
|
run_env.prepend_path('PATH',
|
||||||
|
join_path(self.prefix,
|
||||||
|
'TURBOMOLE', 'bin', '%s_mpi'
|
||||||
|
% tm_arch))
|
||||||
elif '+smp' in self.spec:
|
elif '+smp' in self.spec:
|
||||||
run_env.set('PARA_ARCH', 'SMP')
|
run_env.set('PARA_ARCH', 'SMP')
|
||||||
run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'bin', '%s_smp' % tm_arch))
|
run_env.prepend_path('PATH',
|
||||||
|
join_path(self.prefix,
|
||||||
|
'TURBOMOLE', 'bin', '%s_smp'
|
||||||
|
% tm_arch))
|
||||||
else:
|
else:
|
||||||
run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'bin', tm_arch))
|
run_env.prepend_path('PATH',
|
||||||
|
join_path(self.prefix,
|
||||||
|
'TURBOMOLE', 'bin', tm_arch))
|
||||||
|
|
Loading…
Reference in a new issue