summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorketsubouchi <kenta.tsubouchi@hac-inc.co.jp>2021-01-12 18:00:30 +0900
committerGitHub <noreply@github.com>2021-01-12 10:00:30 +0100
commit506da6891ad56278e7af23ef244e0c0d862585fd (patch)
tree35f592939c63dd46128451ac34e857cfb44fd6ad
parentc6f13cb20f7b42efeefd07f317a578a614509dca (diff)
downloadspack-506da6891ad56278e7af23ef244e0c0d862585fd.tar.gz
spack-506da6891ad56278e7af23ef244e0c0d862585fd.tar.bz2
spack-506da6891ad56278e7af23ef244e0c0d862585fd.tar.xz
spack-506da6891ad56278e7af23ef244e0c0d862585fd.zip
dsqss: new package at v2.0.3 (#20723)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/dsqss/ctest.patch24
-rw-r--r--var/spack/repos/builtin/packages/dsqss/package.py47
2 files changed, 71 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/dsqss/ctest.patch b/var/spack/repos/builtin/packages/dsqss/ctest.patch
new file mode 100644
index 0000000000..1920d6290d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/dsqss/ctest.patch
@@ -0,0 +1,24 @@
+diff -u -r -N a/test/dla/CMakeLists.txt b/test/dla/CMakeLists.txt
+--- a/test/dla/CMakeLists.txt 2020-10-23 17:48:19.000000000 +0900
++++ b/test/dla/CMakeLists.txt 2020-10-23 17:49:46.000000000 +0900
+@@ -2,7 +2,7 @@
+ configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+ file(GLOB jsons "*.json")
+ set(BUILD_TOOL_DIR ${CMAKE_BINARY_DIR}/tool)
+-set(PYTHONPATH "${BUILD_TOOL_DIR}:${pythonpath_build}")
++set(PYTHONPATH "${BUILD_TOOL_DIR}:${pythonpath_build}:$ENV{PYTHONPATH}")
+ foreach(json ${jsons})
+ configure_file(${json} ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+ file(RELATIVE_PATH jsonfilename ${CMAKE_CURRENT_SOURCE_DIR} ${json})
+diff -u -r -N a/test/pmwa/CMakeLists.txt b/test/pmwa/CMakeLists.txt
+--- a/test/pmwa/CMakeLists.txt 2020-10-28 14:22:18.000000000 +0900
++++ b/test/pmwa/CMakeLists.txt 2020-10-28 14:22:57.000000000 +0900
+@@ -10,7 +10,7 @@
+ file(RELATIVE_PATH jsonfilename ${CMAKE_CURRENT_SOURCE_DIR} ${json})
+
+ add_test(NAME "pmwa/${jsonfilename}"
+- COMMAND env PYTHONPATH=${pythonpath_build} ${PYTHON_EXECUTABLE} test.py ${CMAKE_BINARY_DIR}/src/pmwa ${CMAKE_CURRENT_BINARY_DIR}/${jsonfilename}
++ COMMAND env PYTHONPATH=${pythonpath_build}:$ENV{PYTHONPATH} ${PYTHON_EXECUTABLE} test.py ${CMAKE_BINARY_DIR}/src/pmwa ${CMAKE_CURRENT_BINARY_DIR}/${jsonfilename}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
+ )
+ endforeach(json)
diff --git a/var/spack/repos/builtin/packages/dsqss/package.py b/var/spack/repos/builtin/packages/dsqss/package.py
new file mode 100644
index 0000000000..c4cd6e6f5d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/dsqss/package.py
@@ -0,0 +1,47 @@
+# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack import *
+import sys
+
+
+class Dsqss(CMakePackage):
+ """DSQSS is a program package for solving quantum many-body
+ problems defined on lattices. It is based on the quantum Monte
+ Carlo method in Feynman's path integral representation. """
+
+ homepage = "https://www.pasums.issp.u-tokyo.ac.jp/dsqss/en/"
+ url = "https://github.com/issp-center-dev/dsqss/releases/download/v2.0.3/dsqss-v2.0.3.tar.gz"
+
+ version('2.0.3', sha256='11255dd1f1317fb4ac2d6ae95535f027d627d03f5470717cd277dd9ab94496e0')
+
+ variant("mpi", default=True, description="build mpi support")
+
+ depends_on('mpi', when='+mpi')
+ depends_on('python', type=('build', 'run'))
+ depends_on('py-numpy', type=('build', 'run'))
+ depends_on('py-scipy', type=('build', 'run'))
+ depends_on('py-toml', type=('build', 'run'))
+
+ patch('ctest.patch')
+
+ extends('python')
+
+ # Built-in tests are stored as JSON files.
+ # The archive contains "resource fork" files such as "._dimer_1.json".
+ # In Linux, the test system tried to test "._dimer_1.json" and failed.
+ @run_before('cmake')
+ def rm_macos(self):
+ if sys.platform != 'darwin':
+ for mfile in find('test', '._*.json', recursive=True):
+ force_remove(mfile)
+
+ def cmake_args(self):
+ args = [
+ self.define_from_variant('ENABLE_MPI', 'mpi')
+ ]
+
+ return args