Пример #1
0
Файл: gpg.py Проект: LLNL/spack
 def gpg():
     # TODO: Support loading up a GPG environment from a built gpg.
     gpg = Executable('gpg2')
     if not os.path.exists(GNUPGHOME):
         os.makedirs(GNUPGHOME)
         os.chmod(GNUPGHOME, 0o700)
     gpg.add_default_env('GNUPGHOME', GNUPGHOME)
     return gpg
Пример #2
0
 def gpg():
     # TODO: Support loading up a GPG environment from a built gpg.
     gpg = Executable('gpg2')
     if not os.path.exists(GNUPGHOME):
         os.makedirs(GNUPGHOME)
         os.chmod(GNUPGHOME, 0o700)
     gpg.add_default_env('GNUPGHOME', GNUPGHOME)
     return gpg
Пример #3
0
def get_filetype(path_name):
    """
    Return the output of file path_name as a string to identify file type.
    """
    file = Executable('file')
    file.add_default_env('LC_ALL', 'C')
    output = file('-b', '-h', '%s' % path_name, output=str, error=str)
    return output.strip()
Пример #4
0
def get_filetype(path_name):
    """
    Return the output of file path_name as a string to identify file type.
    """
    file = Executable('file')
    file.add_default_env('LC_ALL', 'C')
    output = file('-b', '-h', '%s' % path_name,
                  output=str, error=str)
    return output.strip()
Пример #5
0
    def install(self, spec, prefix):
        bash = Executable('bash')

        # Installer writes files in ~/intel set HOME so it goes to prefix
        bash.add_default_env('HOME', prefix)

        version = spec.versions.lowest()
        release = self._release(version)
        bash('./%s' % self._oneapi_file(version, release), '-s', '-a', '-s',
             '--action', 'install', '--eula', 'accept', '--components',
             self._components, '--install-dir', prefix)
Пример #6
0
    def install(self, spec, prefix, installer_path=None):
        """Shared install method for all oneapi packages."""

        # intel-oneapi-compilers overrides the installer_path when
        # installing fortran, which comes from a spack resource
        if installer_path is None:
            installer_path = basename(self.url_for_version(spec.version))

        if platform.system() == 'Linux':
            # Intel installer assumes and enforces that all components
            # are installed into a single prefix. Spack wants to
            # install each component in a separate prefix. The
            # installer mechanism is implemented by saving install
            # information in a directory called installercache for
            # future runs. The location of the installercache depends
            # on the userid. For root it is always in /var/intel. For
            # non-root it is in $HOME/intel.
            #
            # The method for preventing this install from interfering
            # with other install depends on the userid. For root, we
            # delete the installercache before and after install. For
            # non root we redefine the HOME environment variable.
            if getpass.getuser() == 'root':
                shutil.rmtree('/var/intel/installercache', ignore_errors=True)

            bash = Executable('bash')

            # Installer writes files in ~/intel set HOME so it goes to prefix
            bash.add_default_env('HOME', prefix)
            # Installer checks $XDG_RUNTIME_DIR/.bootstrapper_lock_file as well
            bash.add_default_env('XDG_RUNTIME_DIR',
                                 join_path(self.stage.path, 'runtime'))

            bash(installer_path, '-s', '-a', '-s', '--action', 'install',
                 '--eula', 'accept', '--install-dir', prefix)

            if getpass.getuser() == 'root':
                shutil.rmtree('/var/intel/installercache', ignore_errors=True)

        # Some installers have a bug and do not return an error code when failing
        if not isdir(join_path(prefix, self.component_dir)):
            raise RuntimeError('install failed')
Пример #7
0
    def install(self, spec, prefix, installer_path=None):
        """Shared install method for all oneapi packages."""

        # intel-oneapi-compilers overrides the installer_path when
        # installing fortran, which comes from a spack resource
        if installer_path is None:
            installer_path = basename(self.url_for_version(spec.version))

        if platform == 'linux':
            bash = Executable('bash')

            # Installer writes files in ~/intel set HOME so it goes to prefix
            bash.add_default_env('HOME', prefix)

            bash(installer_path, '-s', '-a', '-s', '--action', 'install',
                 '--eula', 'accept', '--install-dir', prefix)

        # Some installers have a bug and do not return an error code when failing
        if not isdir(join_path(prefix, self.component_dir)):
            raise RuntimeError('install failed')
Пример #8
0
    def install(self, spec, prefix):
        scram = Executable(spec['scram'].prefix.bin + '/scram')
        source_directory = self.stage.source_path
        cmssw_version = 'CMSSW.' + str(self.version)
        cmssw_u_version = cmssw_version.replace('.', '_')
        scram_version = 'V%s' % spec['scram'].version
        config_tag = '%s' % spec['cmssw-config'].version

        gcc = which(spack_f77)
        gcc_prefix = re.sub('/bin/.*$', '', self.compiler.f77)
        gcc_machine = gcc('-dumpmachine', output=str)
        gcc_ver = gcc('-dumpversion', output=str)

        with working_dir(self.stage.path):
            install_tree(source_directory, 'src')
            install_tree(spec['cmssw-config'].prefix.bin, 'config')
            with open('config/config_tag', 'w') as f:
                f.write(config_tag + '\n')
                f.close()
            uc = Executable('config/updateConfig.pl')
            uc('-p', 'CMSSW', '-v', '%s' % cmssw_u_version, '-s',
               '%s' % scram_version, '-t',
               '%s' % spec['cmssw-tool-conf'].prefix, '--keys',
               'SCRAM_COMPILER=gcc', '--keys',
               'PROJECT_GIT_HASH=' + cmssw_u_version, '--arch',
               '%s' % self.scram_arch)
            scram('project', '-d', os.path.realpath(self.stage.path), '-b',
                  'config/bootsrc.xml')

        project_dir = join_path(os.path.realpath(self.stage.path),
                                cmssw_u_version)
        with working_dir(project_dir, create=False):
            matches = []

            for f in glob('src/*/*/test/BuildFile*'):
                matches.append(f)
            for m in matches:
                if os.path.exists(m):
                    os.remove(m)

#            scram.add_default_env('LOCALTOP', project_dir)
#            scram.add_default_env('CMSSW_BASE', project_dir)
            scram.add_default_env('LD_LIBRARY_PATH',
                                  project_dir + '/lib/' + self.scram_arch)
            scram.add_default_env('LD_LIBRARY_PATH',
                                  self.spec['llvm'].prefix.lib)
            scram.add_default_env('LD_LIBRARY_PATH',
                                  self.spec['llvm'].prefix.lib64)
            scram('setup', 'self')
            scram('build', '-v', '-j8')
            shutil.rmtree('tmp')
        install_tree(project_dir,
                     prefix + '/' + cmssw_u_version,
                     symlinks=True)
        relrelink(prefix + '/' + cmssw_u_version + 'external')

        with working_dir(join_path(prefix, cmssw_u_version), create=False):
            #            os.environ[ 'LOCALTOP' ] = os.getcwd()
            #            os.environ[ 'RELEASETOP' ] = os.getcwd()
            #            os.environ[ 'CMSSW_RELEASE_BASE' ] = os.getcwd()
            #            os.environ[ 'CMSSW_BASE' ] = os.getcwd()
            scram('build', 'ProjectRename')