summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkinagaki-fj <77097631+kinagaki-fj@users.noreply.github.com>2024-02-19 22:16:39 +0900
committerGitHub <noreply@github.com>2024-02-19 14:16:39 +0100
commit0d89083cb5c55fa5052557882a57c68cd60f8992 (patch)
treef738f41f96099dc53095b3ef610e78d0ba374e44
parent23e586fd859b6b991c9b722bd2f335a7335bf0d0 (diff)
downloadspack-0d89083cb5c55fa5052557882a57c68cd60f8992.tar.gz
spack-0d89083cb5c55fa5052557882a57c68cd60f8992.tar.bz2
spack-0d89083cb5c55fa5052557882a57c68cd60f8992.tar.xz
spack-0d89083cb5c55fa5052557882a57c68cd60f8992.zip
omm-bundle: add new package (#42304)
-rw-r--r--var/spack/repos/builtin/packages/omm-bundle/fjmpi_pspBasicTool.patch15
-rw-r--r--var/spack/repos/builtin/packages/omm-bundle/package.py54
2 files changed, 69 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/omm-bundle/fjmpi_pspBasicTool.patch b/var/spack/repos/builtin/packages/omm-bundle/fjmpi_pspBasicTool.patch
new file mode 100644
index 0000000000..700069b418
--- /dev/null
+++ b/var/spack/repos/builtin/packages/omm-bundle/fjmpi_pspBasicTool.patch
@@ -0,0 +1,15 @@
+--- a/pspBLAS/src/pspUtility/pspBasicTool.F90 2023-11-01 10:34:05.000000000 +0900
++++ b/pspBLAS/src/pspUtility/pspBasicTool.F90 2023-11-01 10:34:39.000000000 +0900
+@@ -15,9 +15,9 @@ MODULE pspBasicTool
+ use pspVariable
+ ! This module contains routines for indexing, generating, copying, transforming (sparse) data
+
+-#ifdef HAVE_MPI
+- include 'mpif.h'
+-#endif
++!#ifdef HAVE_MPI
++! include 'mpif.h'
++!#endif
+
+ private
+
diff --git a/var/spack/repos/builtin/packages/omm-bundle/package.py b/var/spack/repos/builtin/packages/omm-bundle/package.py
new file mode 100644
index 0000000000..e16209c0c9
--- /dev/null
+++ b/var/spack/repos/builtin/packages/omm-bundle/package.py
@@ -0,0 +1,54 @@
+# Copyright 2013-2023 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)
+
+import shutil
+
+from spack.package import *
+
+
+class OmmBundle(MakefilePackage):
+ """Omm-bundle is a library implementing the orbital minimization method for
+ solving the Kohn-Sham equation as a generalized eigenvalue problem and
+ a bundle of four separate libraries: pspBLAS, MatrixSwitch, libOMM, tomato."""
+
+ homepage = "https://esl.cecam.org/"
+ git = "https://gitlab.com/ElectronicStructureLibrary/omm/omm-bundle.git"
+
+ version("master", branch="master")
+ version("1.0.0", tag="v1.0.0", commit="8b644267284695ff1a40b78d098bda6464a7b821")
+
+ depends_on("mpi")
+ depends_on("blas")
+ depends_on("lapack")
+ depends_on("scalapack")
+ depends_on("dbcsr")
+
+ # Avoid duplicate include error in mpi.h in Fujitsu compiler
+ patch("fjmpi_pspBasicTool.patch", when="@: %fj")
+
+ def edit(self, spec, prefix):
+ # edit make.inc
+ shutil.copy("make.inc.example", "make.inc")
+ makeinc = FileFilter("make.inc")
+ makeinc.filter("FORTRAN =.*", "FORTRAN = {0}".format(spec["mpi"].mpifc))
+ linalg_libs = (
+ self.spec["lapack"].libs + self.spec["blas"].libs + self.spec["scalapack"].libs
+ )
+ makeinc.filter("LINALG_LIBS =.*", "LINALG_LIBS = {0}".format(linalg_libs.ld_flags))
+ makeinc.filter("#FPPFLAGS ", "FPPFLAGS ")
+ makeinc.filter("#DBCSR =.*", "DBCSR = {0}".format(spec["dbcsr"].prefix))
+ makeinc.filter("#DBCSRINC ", "DBCSRINC ")
+ makeinc.filter("#DBCSRLIB =.*", "DBCSRLIB = -L$(DBCSR)/lib64 -ldbcsr")
+
+ # fix Makefile of tomato to avoid error(cp: cannot stat '*.mod': No such file or directory)
+ tomato_makefile = FileFilter("tomato/src/Makefile.manual")
+ tomato_makefile.filter(" cp *.mod $(BUILDPATH)/include; \\\n", "")
+
+ def build(self, spec, prefix):
+ make("-f", "Makefile.manual", "all", parallel=False)
+
+ def install(self, spec, prefix):
+ for d in ["pspBLAS", "MatrixSwitch", "libOMM", "tomato"]:
+ install_tree("build_" + d, prefix + "/build_" + d)