From 2c768faf1a3d4d8f412d77dc78a7436406475600 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Tue, 13 Apr 2021 11:15:22 +0200
Subject: [PATCH] [ogs] Installed without sif.

Available in the PATH per default.
---
 ogscm/building_blocks/ogs.py |  8 ++++++--
 ogscm/recipes/ogs.py         | 15 +--------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/ogscm/building_blocks/ogs.py b/ogscm/building_blocks/ogs.py
index 99751ab..ffcc749 100644
--- a/ogscm/building_blocks/ogs.py
+++ b/ogscm/building_blocks/ogs.py
@@ -48,10 +48,14 @@ class ogs(bb_base, hpccm.templates.CMakeBuild, hpccm.templates.rm):
         self.__commit = kwargs.get("commit")
         self.__git_version = kwargs.get("git_version")
         self.__conan = kwargs.get("conan", False)
+        self.__shell_args = ""
 
         if self.__repo == "local":
             self.__skip_clone = True
             self.__remove_source = False
+            self.__shell_args = "--mount=type=bind,target={}/src,rw".format(
+                self.__prefix
+            )
 
         # Filled in by __setup():
         self.__commands = []
@@ -72,7 +76,7 @@ class ogs(bb_base, hpccm.templates.CMakeBuild, hpccm.templates.rm):
         self += packages(ospackages=self.__ospackages)
         self += shell(
             commands=self.__commands,
-            _arguments="--mount=type=bind,target=/scif/apps/ogs/src,rw",
+            _arguments=self.__shell_args,
         )
         self += runscript(commands=["ogs"])
 
@@ -154,7 +158,7 @@ class ogs(bb_base, hpccm.templates.CMakeBuild, hpccm.templates.rm):
         if self.__repo == "local":
             self.__labels["version"] = self.__git_version
         else:
-            self.__labels["version"] = "{0}@{1} ({2})".format(
+            self.__labels["version"] = "'{0}@{1} ({2})'".format(
                 self.__repo, self.__branch, self.__commit
             )
         self.__labels["cmake_args"] = "'" + " ".join(self.__cmake_args) + "'"
diff --git a/ogscm/recipes/ogs.py b/ogscm/recipes/ogs.py
index be97f27..e53ac2a 100644
--- a/ogscm/recipes/ogs.py
+++ b/ogscm/recipes/ogs.py
@@ -16,7 +16,6 @@ from hpccm.building_blocks import (
     mkl,
     packages,
     pip,
-    scif,
 )
 from ogscm.building_blocks.pm_conan import pm_conan
 
@@ -229,11 +228,6 @@ if local_args.ogs != "off" and not args.runtime_only:
 # Optionally set out_dir
 out_dir += folder
 
-if repo == "local":
-    scif_file = f"{out_dir}/ogs.scif"  # TODO
-else:
-    scif_file = f"{out_dir}/ogs.scif"
-
 # Implement recipe
 Stage0 += comment(f"--- Begin {filename} ---")
 
@@ -497,23 +491,16 @@ if local_args.ogs != "off" and local_args.ogs != "clean":
     if repo == "local":
         print(f"chdir to {local_args.ogs}")
         os.chdir(local_args.ogs)
-        mount_args += f" --mount=type=bind,target=/scif/apps/ogs/src,rw"
 
-    ogs_app = scif(_arguments=mount_args, name="ogs", file=scif_file)
-    ogs_app += ogs(
+    Stage0 += ogs(
         repo=repo,
         branch=branch,
         commit=commit_hash,
         conan=(True if local_args.pm == "conan" else False),
         git_version=git_version,
         toolchain=toolchain,
-        prefix="/scif/apps/ogs",
         cmake_args=cmake_args,
         parallel=local_args.parallel,
         remove_build=True,
         remove_source=True,
     )
-    # Install scif in all stages
-    Stage0 += pip(packages=["scif"], pip="pip3")
-    Stage1 += pip(packages=["scif"], pip="pip3")
-    Stage0 += ogs_app
-- 
GitLab