Skip to content
Snippets Groups Projects
Commit 27e1e27a authored by Ashwin Kumar Karnad's avatar Ashwin Kumar Karnad
Browse files

remove the old methods to reduce confusion

parent 087933bd
No related branches found
No related tags found
2 merge requests!19Move linux-debian11 into main,!1Resolve "First draft for user interface for top level install command"
......@@ -84,89 +84,6 @@ class builder:
else:
self.prepare_env()
def build_toolchains(
mpsd_spack_ver=None,
toolchain_list=None,
toolchain_base_dir="/opt_mpsd/",
skip_build_cache=False,
skip_dir_check=False,
):
mpsd_os = os.environ["MPSD_OS"]
mpsd_microarch = os.environ["MPSD_MICROARCH"]
current_branch = (
subprocess.run(
["git", "rev-parse", "--abbrev-ref", "HEAD"], stdout=subprocess.PIPE
)
.stdout.decode()
.strip()
)
current_commit_hash = subprocess.run(
["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE
)
current_dir = os.getcwd()
# Checks
## Check that some mpsd_spack_ver is passed.
if mpsd_spack_ver is None:
raise ValueError(
"Error: MPSD_SPACK_VER not passed. Please pass the MPSD Software stack version."
)
## Check if toolchains directory exists
spack_env_path = os.path.join(toolchain_base_dir, mpsd_os, mpsd_spack_ver)
toolchains_path = os.path.join(spack_env_path, mpsd_microarch)
if not os.path.exists(toolchains_path):
os.makedirs(toolchains_path)
else:
if not skip_dir_check:
raise ValueError(
f"Error: Toolchains directory {toolchains_path} already exists. \n\
Please remove it and try again."
)
### Clone spack-env repo at spack_env_path
with os.chdir(spack_env_path + "/spack-environments"):
subprocess.run(
"git clone git@gitlab.gwdg.de:mpsd-cs/spack-environments.git .",
shell=True,
check=True,
)
subprocess.run(f"git checkout {mpsd_spack_ver}", shell=True, check=True)
## Check if TOOLCHAIN_LIST is valid
available_toolchains = os.listdir("toolchains")
if skip_build_cache:
flags = "-b"
else:
flags = ""
if toolchain_list is None:
toolchains = available_toolchains
else:
toolchains = toolchain_list.split(",")
# if not set(toolchains)<=set(available_toolchains):
for toolchain in toolchains:
if toolchain not in available_toolchains:
raise ValueError(
f"Error: Toolchain '{toolchain}' not found in toolchains directory. \n\
Please check the toolchain argument and try again."
)
# Build toolchains
log_file = (
f"build_toolchains_{mpsd_spack_ver}_{time.strftime('%Y%m%d-%H%M%S')}.log"
)
print(f"Building at {toolchains_path}...")
for toolchain in toolchains:
with os_chdir(toolchains_path):
print(f">>>> Building {toolchain}...")
subprocess.run(
f" bash {spack_env_path}/spack-environments/spack_setup.sh {flags} {toolchain}|tee -a {log_file} 2>&1",
shell=True,
check=True,
)
# copy the octopus configs to the toolchain directory
# subprocess.run(f"cp -r {current_dir}/octopus
def prepare_env(self):
if not os.path.exists(self.toolchain_base_dir):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment