summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTom Payerle <payerle@umd.edu>2020-09-15 10:54:26 -0400
committerGitHub <noreply@github.com>2020-09-15 09:54:26 -0500
commit6752a1c377e03e1c4138cf11c89170ce00c796e2 (patch)
treebfd6e877ced8fefdd01e62b01bff7b841adeacf3 /var
parent33e8dcad993968e47560bbc929a3ef4a38de0405 (diff)
downloadspack-6752a1c377e03e1c4138cf11c89170ce00c796e2.tar.gz
spack-6752a1c377e03e1c4138cf11c89170ce00c796e2.tar.bz2
spack-6752a1c377e03e1c4138cf11c89170ce00c796e2.tar.xz
spack-6752a1c377e03e1c4138cf11c89170ce00c796e2.zip
Qbox minor issues 18664 (#18665)
* qbox: install to correct directory structure * qbox: Have qb executable put in bin rather than src subdir * qbox: Fix python script shebangs to use python from path * qbox: Add dependencies on gnuplot, python2 for utilities * qbox: fix flake8 issue * qbox: Add $prefix/util to PATH
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/qbox/package.py18
-rw-r--r--var/spack/repos/builtin/packages/qbox/qbox-python-shebang-path.patch108
2 files changed, 121 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/qbox/package.py b/var/spack/repos/builtin/packages/qbox/package.py
index c857991bde..0233f62956 100644
--- a/var/spack/repos/builtin/packages/qbox/package.py
+++ b/var/spack/repos/builtin/packages/qbox/package.py
@@ -43,6 +43,11 @@ class Qbox(MakefilePackage):
depends_on('scalapack')
depends_on('fftw')
depends_on('xerces-c')
+ depends_on('python@:2.999', type='run')
+ depends_on('gnuplot', type='run')
+
+ # Change /usr/bin/python shebangs to /usr/bin/env python
+ patch('qbox-python-shebang-path.patch')
build_directory = 'src'
@@ -64,9 +69,12 @@ class Qbox(MakefilePackage):
))))
filter_file('$(TARGET)', 'spack', 'src/Makefile', string=True)
+ def setup_run_environment(self, env):
+ env.prepend_path('PATH', self.prefix.util)
+
def install(self, spec, prefix):
- mkdir(prefix.src)
- install('src/qb', prefix.src)
- install_tree('test', prefix)
- install_tree('xml', prefix)
- install_tree('util', prefix)
+ mkdir(prefix.bin)
+ install('src/qb', prefix.bin)
+ install_tree('test', prefix.test)
+ install_tree('xml', prefix.xml)
+ install_tree('util', prefix.util)
diff --git a/var/spack/repos/builtin/packages/qbox/qbox-python-shebang-path.patch b/var/spack/repos/builtin/packages/qbox/qbox-python-shebang-path.patch
new file mode 100644
index 0000000000..338a990680
--- /dev/null
+++ b/var/spack/repos/builtin/packages/qbox/qbox-python-shebang-path.patch
@@ -0,0 +1,108 @@
+diff -Nuar spack-src/util/qbox_angle.py spack-src.patched/util/qbox_angle.py
+--- spack-src/util/qbox_angle.py 2016-07-05 00:43:50.000000000 -0400
++++ spack-src.patched/util/qbox_angle.py 2020-09-11 17:48:34.381997541 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # qbox_angle.py
+ # extract angle defined by three atoms from Qbox output
+ # use: qbox_angle.py name1 name2 name3 file.r
+diff -Nuar spack-src/util/qbox_distance.py spack-src.patched/util/qbox_distance.py
+--- spack-src/util/qbox_distance.py 2016-07-05 00:43:50.000000000 -0400
++++ spack-src.patched/util/qbox_distance.py 2020-09-11 17:48:40.733188691 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # qbox_distance.py
+ # extract distance between two atoms from Qbox output
+ # use: qbox_distance.py name1 name2 file.r
+diff -Nuar spack-src/util/qbox_dos.py spack-src.patched/util/qbox_dos.py
+--- spack-src/util/qbox_dos.py 2014-01-10 15:39:02.000000000 -0500
++++ spack-src.patched/util/qbox_dos.py 2020-09-11 17:48:46.141351461 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # qbox_dos.py: extract electronic DOS from Qbox output
+ # generate DOS plot in gnuplot format
+ # use: qbox_dos.py [-last] emin emax width file.r
+diff -Nuar spack-src/util/qbox_eig.py spack-src.patched/util/qbox_eig.py
+--- spack-src/util/qbox_eig.py 2016-09-06 19:47:51.000000000 -0400
++++ spack-src.patched/util/qbox_eig.py 2020-09-11 17:49:00.811792982 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # qbox_eig.py: extract eigenvalues from Qbox output
+ # use: qbox_eig.py kpoint n ispin file.r
+ # extracts eigenvalue n at (ispin,kpoint)
+diff -Nuar spack-src/util/qbox_maxforce.py spack-src.patched/util/qbox_maxforce.py
+--- spack-src/util/qbox_maxforce.py 2016-09-06 19:47:51.000000000 -0400
++++ spack-src.patched/util/qbox_maxforce.py 2020-09-11 17:49:05.763942033 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # Copyright 2016 The Regents of the University of California
+ # This file is part of Qbox
+ #
+diff -Nuar spack-src/util/qbox_msd.py spack-src.patched/util/qbox_msd.py
+--- spack-src/util/qbox_msd.py 2014-04-24 16:30:49.000000000 -0400
++++ spack-src.patched/util/qbox_msd.py 2020-09-11 17:49:11.751122219 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # qbox_msd.py: compute mean-square displacement in an MD simulation
+ # generate plot of <r^2>(t) in gnuplot format
+ # use: qbox_msd.py species file.r [file.r ...]
+diff -Nuar spack-src/util/qbox_repair_h2o.py spack-src.patched/util/qbox_repair_h2o.py
+--- spack-src/util/qbox_repair_h2o.py 2013-12-05 15:28:06.000000000 -0500
++++ spack-src.patched/util/qbox_repair_h2o.py 2020-09-11 17:49:16.467264160 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # qbox_repair_h2o.py: repair broken h2o molecules in a Qbox sys file
+ # move hydrogen atoms across periodic boundaries to repair molecules
+ # use: qbox_repair_h2o.py file.sys
+diff -Nuar spack-src/util/qbox_torsion.py spack-src.patched/util/qbox_torsion.py
+--- spack-src/util/qbox_torsion.py 2017-03-10 14:46:12.000000000 -0500
++++ spack-src.patched/util/qbox_torsion.py 2020-09-11 17:49:21.469414705 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # qbox_torsion.py
+ # extract torsion angle defined by four atoms from Qbox output
+ # use: qbox_torsion.py name1 name2 name3 name4 file.r
+diff -Nuar spack-src/util/qbox_xyz.py spack-src.patched/util/qbox_xyz.py
+--- spack-src/util/qbox_xyz.py 2016-05-31 13:23:45.000000000 -0400
++++ spack-src.patched/util/qbox_xyz.py 2020-09-11 17:49:26.550567625 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # Copyright 2016 The Regents of the University of California
+ # This file is part of Qbox
+ #
+diff -Nuar spack-src/util/qso2qbox.py spack-src.patched/util/qso2qbox.py
+--- spack-src/util/qso2qbox.py 2016-05-31 13:23:45.000000000 -0400
++++ spack-src.patched/util/qso2qbox.py 2020-09-11 17:49:31.049703037 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # Convert <atomset> elements from quantum-simulation.org (QSO) format
+ # to Qbox input file
+ # use: qso2qbox.py [-last] {file|URL}
+diff -Nuar spack-src/util/qso2qe.py spack-src.patched/util/qso2qe.py
+--- spack-src/util/qso2qe.py 2016-05-31 13:23:45.000000000 -0400
++++ spack-src.patched/util/qso2qe.py 2020-09-11 17:49:36.099855027 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ # Convert from quantum-simulation.org format to QuantumEspresso input format
+ # use: env ECUT=ecut qso2qe.py [-last] {file|URL}
+
+diff -Nuar spack-src/util/qso.py spack-src.patched/util/qso.py
+--- spack-src/util/qso.py 2016-05-31 13:23:45.000000000 -0400
++++ spack-src.patched/util/qso.py 2020-09-11 17:49:42.412045000 -0400
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python
+ import xml.sax
+ # quantum-simulation.org (QSO) definitions
+ class Atom: