summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Reeve <6740307+streeve@users.noreply.github.com>2023-10-02 16:27:13 -0700
committerGitHub <noreply@github.com>2023-10-02 16:27:13 -0700
commitbb03a1768b317607204ae05e66485ce7f7398a6f (patch)
tree9a232f7d5a4a08da33fc239f3135baff3361ba7a
parent75ed26258ccbf84b9bc6dd11d8a9ccadbd54ff9e (diff)
downloadspack-bb03a1768b317607204ae05e66485ce7f7398a6f.tar.gz
spack-bb03a1768b317607204ae05e66485ce7f7398a6f.tar.bz2
spack-bb03a1768b317607204ae05e66485ce7f7398a6f.tar.xz
spack-bb03a1768b317607204ae05e66485ce7f7398a6f.zip
Add AdditiveFOAM package (#39295)
* Add AdditiveFOAM package * Add AdditiveFOAM build and install Co-authored-by: kjrstory <kjrstory@gmail.com> Co-authored-by: Knapp, Gerry <knappgl@ornl.gov> --------- Co-authored-by: kjrstory <kjrstory@gmail.com> Co-authored-by: Knapp, Gerry <knappgl@ornl.gov>
-rwxr-xr-xvar/spack/repos/builtin/packages/additivefoam/assets/Allwmake4
-rwxr-xr-xvar/spack/repos/builtin/packages/additivefoam/assets/applications/Allwmake5
-rw-r--r--var/spack/repos/builtin/packages/additivefoam/package.py59
3 files changed, 68 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/additivefoam/assets/Allwmake b/var/spack/repos/builtin/packages/additivefoam/assets/Allwmake
new file mode 100755
index 0000000000..e0aa5c6b87
--- /dev/null
+++ b/var/spack/repos/builtin/packages/additivefoam/assets/Allwmake
@@ -0,0 +1,4 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+
+applications/Allwmake $targetType $*
diff --git a/var/spack/repos/builtin/packages/additivefoam/assets/applications/Allwmake b/var/spack/repos/builtin/packages/additivefoam/assets/applications/Allwmake
new file mode 100755
index 0000000000..c0edc3142b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/additivefoam/assets/applications/Allwmake
@@ -0,0 +1,5 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+
+wmake libso solvers/additiveFoam/movingHeatSource
+wmake solvers/additiveFoam
diff --git a/var/spack/repos/builtin/packages/additivefoam/package.py b/var/spack/repos/builtin/packages/additivefoam/package.py
new file mode 100644
index 0000000000..3141c4b6ee
--- /dev/null
+++ b/var/spack/repos/builtin/packages/additivefoam/package.py
@@ -0,0 +1,59 @@
+# 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 os
+
+from spack.package import *
+from spack.pkg.builtin.openfoam import add_extra_files
+
+
+class Additivefoam(Package):
+ """AdditiveFOAM is a heat and mass transfer software for Additive Manufacturing (AM)"""
+
+ homepage = "https://github.com/ORNL/AdditiveFOAM"
+ git = "https://github.com/ORNL/AdditiveFOAM.git"
+ url = "https://github.com/ORNL/AdditiveFOAM/archive/1.0.0.tar.gz"
+
+ maintainers("streeve", "colemanjs", "gknapp1")
+
+ tags = ["ecp"]
+
+ version("main", branch="main")
+ version("1.0.0", sha256="abbdf1b0230cd2f26f526be76e973f508978611f404fe8ec4ecdd7d5df88724c")
+
+ depends_on("openfoam-org@10")
+
+ common = ["spack-derived-Allwmake"]
+ assets = ["applications/Allwmake", "Allwmake"]
+
+ build_script = "./spack-derived-Allwmake"
+
+ phases = ["configure", "build", "install"]
+
+ def patch(self):
+ add_extra_files(self, self.common, self.assets)
+
+ def configure(self, spec, prefix):
+ pass
+
+ def build(self, spec, prefix):
+ """Build with Allwmake script, wrapped to source environment first."""
+ args = []
+ if self.parallel: # Parallel build? - pass via environment
+ os.environ["WM_NCOMPPROCS"] = str(make_jobs)
+ builder = Executable(self.build_script)
+ builder(*args)
+
+ def install(self, spec, prefix):
+ """Install under the prefix directory"""
+
+ for f in ["README.md", "LICENSE"]:
+ if os.path.isfile(f):
+ install(f, join_path(self.prefix, f))
+
+ dirs = ["tutorials", "applications"]
+ for d in dirs:
+ if os.path.isdir(d):
+ install_tree(d, join_path(self.prefix, d), symlinks=True)