diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/dsqss/package.py | 25 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/dsqss/spackpip.patch | 30 |
2 files changed, 55 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/dsqss/package.py b/var/spack/repos/builtin/packages/dsqss/package.py index c4cd6e6f5d..60e23b2ce2 100644 --- a/var/spack/repos/builtin/packages/dsqss/package.py +++ b/var/spack/repos/builtin/packages/dsqss/package.py @@ -26,6 +26,11 @@ class Dsqss(CMakePackage): depends_on('py-scipy', type=('build', 'run')) depends_on('py-toml', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-pip', type='build') + depends_on('py-wheel', type='build') + + patch('spackpip.patch') patch('ctest.patch') extends('python') @@ -45,3 +50,23 @@ class Dsqss(CMakePackage): ] return args + + def test(self): + test01 = find(self.prefix.share, '01_spindimer')[0] + copy(join_path(test01, 'std.toml'), '.') + # prepare + pythonexe = self.spec['python'].command.path + opts = [self.spec.prefix.bin.dla_pre, 'std.toml'] + self.run_test(pythonexe, options=opts) + # (mpi) run + opts = [] + if self.spec.satisfies('+mpi'): + exe_name = self.spec['mpi'].prefix.bin.mpirun + opts.extend(['-n', '1']) + opts.append(join_path(self.prefix.bin, 'dla')) + else: + exe_name = 'dla' + opts.append('param.in') + expected = ['R ene = -3.74300000e-01 2.96344394e-03'] + self.run_test(exe_name, options=opts) + self.run_test('cat', options=['sample.log'], expected=expected) diff --git a/var/spack/repos/builtin/packages/dsqss/spackpip.patch b/var/spack/repos/builtin/packages/dsqss/spackpip.patch new file mode 100644 index 0000000000..5e8f4d9dc3 --- /dev/null +++ b/var/spack/repos/builtin/packages/dsqss/spackpip.patch @@ -0,0 +1,30 @@ +--- a/tool/cmake/install.sh.in 2021-03-01 15:31:40.510128100 +0900 ++++ b/tool/cmake/install.sh.in 2021-03-01 15:33:07.203367716 +0900 +@@ -1,16 +1,9 @@ +-export PYTHONPATH=@DSQSS_PYTHONPATH@ ++export PYTHONPATH=$PYTHONPATH:@DSQSS_PYTHONPATH@ + + cd @CMAKE_CURRENT_BINARY_DIR@ + +-if ! @PYTHON_EXECUTABLE@ -m pip --version >/dev/null 2>/dev/null ;then +- set -e +- wget https://bootstrap.pypa.io/get-pip.py -O get-pip.py +- PIP_USER=0 @PYTHON_EXECUTABLE@ get-pip.py --prefix=@CMAKE_INSTALL_PREFIX@ +-fi + + set -e +-PIP_USER=0 @PYTHON_EXECUTABLE@ -m pip install -U pip --prefix=@CMAKE_INSTALL_PREFIX@ +-PIP_USER=0 @PYTHON_EXECUTABLE@ -m pip install wheel --prefix=@CMAKE_INSTALL_PREFIX@ --no-warn-script-location + DSQSS_VERSION=$(@PYTHON_EXECUTABLE@ setup.py --version) + @PYTHON_EXECUTABLE@ setup.py bdist_wheel --universal + mkdir -p temp +--- a/tool/setup.py 2021-03-01 15:34:16.242136754 +0900 ++++ b/tool/setup.py 2021-03-01 15:34:36.381650889 +0900 +@@ -26,7 +26,6 @@ + license="GPLv3", + packages=["dsqss", 'dsqss.lattice_factory'], + python_requires=">=2.7", +- install_requires=["numpy", "scipy", "toml"], + entry_points={ + "console_scripts": [ + "dla_hamgen = dsqss.std_model:main", |