hpccm.config

source module hpccm.config

Functions

source get_cpu_architecture()

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.

source get_format()

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, and x86_64. arm and arm64v8 are aliases for aarch64, and amd64 and x86 are aliases for x86_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, and ubuntu26. ubuntu is an alias for ubuntu16, centos is an alias for centos7, and rhel is an alias for rhel7.

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.