How to use the hpccm.config.g_cpu_arch function in hpccm

To help you get started, we’ve selected a few hpccm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NVIDIA / hpc-container-maker / test / helpers.py View on Github external
def wrapper(*args, **kwargs):
        hpccm.config.g_cpu_arch = cpu_arch.PPC64LE
        return function(*args, **kwargs)
github NVIDIA / hpc-container-maker / hpccm / building_blocks / mlnx_ofed.py View on Github external
'libibumad', 'libibumad-devel',
                                       'libmlx4-1', 'libmlx4-dev',
                                       'libmlx5-1', 'libmlx5-dev',
                                       'librdmacm-dev', 'librdmacm1']

        elif hpccm.config.g_linux_distro == linux_distro.CENTOS:
            if hpccm.config.g_linux_version >= StrictVersion('8.0'):
                self.__deppackages = ['libnl3', 'numactl-libs']
            else:
                self.__deppackages = ['libnl', 'libnl3', 'numactl-libs']

            if not self.__oslabel:
                if hpccm.config.g_linux_version >= StrictVersion('8.0'):
                    self.__oslabel = 'rhel8.0'
                else:
                    if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
                        self.__oslabel = 'rhel7.6alternate'
                    else:
                        self.__oslabel = 'rhel7.2'

            if not self.__packages:
                if LooseVersion(self.__version) >= LooseVersion('5.0'):
                    # Uses UPSTREAM libs
                    self.__packages = ['libibverbs', 'libibverbs-utils',
                                       'libibumad', 'librdmacm',
                                       'rdma-core', 'rdma-core-devel']
                else:
                    # Uses MLNX_OFED libs
                    self.__packages = ['libibverbs', 'libibverbs-devel',
                                       'libibverbs-utils',
                                       'libibmad', 'libibmad-devel',
                                       'libibumad', 'libibumad-devel',
github NVIDIA / hpc-container-maker / hpccm / building_blocks / intel_psxe.py View on Github external
self.__mpi = kwargs.get('mpi', True)
        self.__ospackages = kwargs.get('ospackages', [])
        self.__prefix = kwargs.get('prefix', '/opt/intel')
        self.__psxevars = kwargs.get('psxevars', True)
        self.__runtime_version = kwargs.get('runtime_version', '2020.1-12')
        self.__tarball = kwargs.get('tarball', None)
        self.__tbb = kwargs.get('tbb', True)
        self.__wd = '/var/tmp' # working directory

        self.toolchain = toolchain(CC='icc', CXX='icpc', F77='ifort',
                                   F90='ifort', FC='ifort')

        self.__bashrc = ''   # Filled in by __distro()
        self.__commands = [] # Filled in by __setup()

        if hpccm.config.g_cpu_arch != cpu_arch.X86_64: # pragma: no cover
            logging.warning('Using intel_psxe on a non-x86_64 processor')

        # Set the Linux distribution specific parameters
        self.__distro()

        # Construct the series of steps to execute
        self.__setup()

        # Fill in container instructions
        self.__instructions()
github NVIDIA / hpc-container-maker / hpccm / building_blocks / openblas.py View on Github external
def __make(self):
        """Based on the CPU architecture, set values accordingly.  A user
        specified value overrides any defaults."""

        if not self.__make_opts:
            if self.__toolchain.CC:
                self.__make_opts.append('CC={}'.format(self.__toolchain.CC))
            if self.__toolchain.FC:
                self.__make_opts.append('FC={}'.format(self.__toolchain.FC))

            if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
                self.__make_opts.extend(['TARGET=ARMV8', 'USE_OPENMP=1'])
            elif hpccm.config.g_cpu_arch == cpu_arch.PPC64LE:
                self.__make_opts.extend(['TARGET=POWER8', 'USE_OPENMP=1'])
            elif hpccm.config.g_cpu_arch == cpu_arch.X86_64:
                self.__make_opts.extend(['USE_OPENMP=1'])
            else: # pragma: no cover
                raise RuntimeError('Unknown CPU architecture')
github NVIDIA / hpc-container-maker / hpccm / building_blocks / ucx.py View on Github external
'--without-rdmacm'])

        # XPMEM
        if self.__xpmem:
            if isinstance(self.__xpmem, string_types):
                # Use specified path
                self.__configure_opts.append(
                    '--with-xpmem={}'.format(self.__xpmem))
            else:
                # Boolean, let UCX try to figure out where to find it
                self.__configure_opts.append('--with-xpmem')
        elif self.__xpmem == False:
            self.__configure_opts.append('--without-xpmem')

        # Workaround for format warning considered an error on Power
        if hpccm.config.g_cpu_arch == cpu_arch.PPC64LE:
            if not self.__toolchain.CFLAGS:
                self.__toolchain.CFLAGS = '-Wno-error=format'
github NVIDIA / hpc-container-maker / hpccm / building_blocks / libsim.py View on Github external
def __cpu_arch(self):
        """Based on the CPU architecture, set values accordingly.  A user
        specified value overrides any defaults."""

        if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
            # Bug in the VisIt build config
            self.__arch = 'linux-intel'
        elif hpccm.config.g_cpu_arch == cpu_arch.X86_64:
            self.__arch = 'linux-x86_64'
        else: # pragma: no cover
            raise RuntimeError('Unknown CPU architecture')
github NVIDIA / hpc-container-maker / hpccm / building_blocks / nv_hpc_sdk.py View on Github external
def __cpu_arch(self):
        """Based on the CPU architecture, set values accordingly.  A user
        specified value overrides any defaults."""

        if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
            self.__arch_directory = 'Linux_aarch64'
        elif hpccm.config.g_cpu_arch == cpu_arch.PPC64LE:
            self.__arch_directory = 'Linux_ppc64le'
        elif hpccm.config.g_cpu_arch == cpu_arch.X86_64:
            self.__arch_directory = 'Linux_x86_64'
        else: # pragma: no cover
            raise RuntimeError('Unknown CPU architecture')
github NVIDIA / hpc-container-maker / hpccm / building_blocks / cmake.py View on Github external
def __setup(self):
        """Construct the series of shell commands, i.e., fill in
           self.__commands"""
        if not self.__source and hpccm.config.g_cpu_arch == cpu_arch.X86_64:
            # Use the pre-compiled x86_64 binary
            self.__binary()
        else:
            # Build from source
            self.__build()
github NVIDIA / hpc-container-maker / hpccm / building_blocks / nsight_systems.py View on Github external
def __cpu_arch(self):
        """Based on the CPU architecture, set values accordingly.  A user
        specified value overrides any defaults."""

        if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
            self.__arch_repo_label = 'arm64'
            self.__arch_key_label = 'x86_64' # https://developer.nvidia.com/cuda-toolkit/arm
        elif hpccm.config.g_cpu_arch == cpu_arch.PPC64LE:
            self.__arch_repo_label = 'ppc64'
            if hpccm.config.g_linux_distro == linux_distro.UBUNTU:
                self.__arch_key_label = 'ppc64el'
            else:
                self.__arch_key_label = 'ppc64le'
        elif hpccm.config.g_cpu_arch == cpu_arch.X86_64:
            self.__arch_repo_label = 'x86_64'
            self.__arch_key_label = 'x86_64'
        else: # pragma: no cover
            raise RuntimeError('Unknown CPU architecture')
github NVIDIA / hpc-container-maker / hpccm / building_blocks / yum.py View on Github external
def __cpu_arch(self):
        """Based on the CPU architecture, set values accordingly.  A user
        specified value overrides any defaults."""

        if hpccm.config.g_cpu_arch == cpu_arch.X86_64:
            if not self.__download_args:
                self.__download_args = '-x \*i?86 --archlist=x86_64'