hpccm.config
source module hpccm.config
Functions
-
get_cpu_architecture — Return the architecture string for the currently configured CPU architecture, e.g.,
aarch64orx86_64. -
get_cpu_optimization_flags — Return the CPU optimization flags for the target and compiler combination.
-
get_format — Return the container format string for the currently configured format, e.g.,
bash,docker, orsingularity. -
set_container_format — Set the container format
-
set_cpu_architecture — Set the CPU architecture
-
set_cpu_target — Set the CPU optimization target
-
set_linux_distro — Set the Linux distribution and version
-
set_singularity_version — Set the Singularity definition file format version
-
set_working_directory — Set the working directory to use for staging inside the container
-
set_singularity_tmp_fallback — Enable or disable the automatic %setup fallback for /tmp and /var/tmp destinations on Singularity >= 3.6.
-
test_cpu_feature_flag — Return True or False depending on whether the CPU supports the given feature flag
Return the architecture string for the currently configured CPU
architecture, e.g., aarch64 or x86_64.
Raises
-
RuntimeError
source get_cpu_optimization_flags(compiler, version='9999')
Return the CPU optimization flags for the target and compiler combination.
Parameters
-
compiler — A compiler family string recognized by archspec.
-
version — The version of the compiler. The default version is
9999, i.e., assume the compiler supports the latest optimization flags.
Return the container format string for the currently configured
format, e.g., bash, docker, or singularity.
Raises
-
RuntimeError
source set_container_format(ctype)
Set the container format
Parameters
-
ctype : string — 'docker' to specify the Dockerfile format, or 'singularity' to specify the Singularity definition file format
Raises
-
RuntimeError — invalid container type argument
source set_cpu_architecture(arch)
Set the CPU architecture
In most cases, the baseimage primitive should be relied upon to
set the CPU architecture. Only use this function if you really
know what you are doing.
Parameters
-
arch : string — Value values are
aarch64, andx86_64.armandarm64v8are aliases foraarch64, andamd64andx86are aliases forx86_64.
source set_cpu_target(target)
Set the CPU optimization target
Parameters
-
target : string — A CPU microarchitecture string recognized by archspec.
source set_linux_distro(distro)
Set the Linux distribution and version
In most cases, the baseimage primitive should be relied upon to
set the Linux distribution. Only use this function if you really
know what you are doing.
Parameters
-
distro : string — Valid values are
centos7,centos8,rhel7,rhel8,rockylinux8,rockylinux9,rockylinux10,ubuntu16,ubuntu18,ubuntu20,ubuntu22,ubuntu24, andubuntu26.ubuntuis an alias forubuntu16,centosis an alias forcentos7, andrhelis an alias forrhel7.
source set_singularity_version(ver)
Set the Singularity definition file format version
The Singularity definition file format was extended in version 3.2 to enable multi-stage builds. However, these changes are not backwards compatible.
Parameters
-
ver : string — Singularity definition file format version.
source set_working_directory(wd)
Set the working directory to use for staging inside the container
Parameters
-
wd : string — working directory path
source set_singularity_tmp_fallback(enable=True)
Enable or disable the automatic %setup fallback for /tmp and /var/tmp destinations on Singularity >= 3.6.
Parameters
-
enable : bool — True to enable the fallback (default), False to disable.
source test_cpu_feature_flag(flag)
Return True or False depending on whether the CPU supports the given feature flag
Parameters
-
flag — A CPU feature flag, e.g.,
avx.