示例#1
0
 def _build_all(self):
     from taucmdr.cf.platforms import TauMagic
     targets = set([(magic.architecture, magic.operating_system) for magic in TauMagic.all()])
     for target in targets:
         targ_arch, targ_os = target
         # Setuptools is a dirty, stateful animal.
         # Have to create a new subprocess to hack around setuptools' stateful implementation of sdist.
         subprocess.call(['python', 'setup.py', 'release', 
                          '--target-arch', str(targ_arch),
                          '--target-os', str(targ_os)])
     subprocess.call(['python', 'setup.py', 'release', '--web'])
示例#2
0
 def _build_all(self):
     from taucmdr.cf.platforms import TauMagic
     targets = {(magic.architecture, magic.operating_system)
                for magic in TauMagic.all()}
     for target in targets:
         targ_arch, targ_os = target
         # Setuptools is a dirty, stateful animal.
         # Have to create a new subprocess to hack around setuptools' stateful implementation of sdist.
         subprocess.call([
             'python', 'setup.py', 'release', '--target-arch',
             str(targ_arch), '--target-os',
             str(targ_os)
         ])
     subprocess.call(['python', 'setup.py', 'release', '--web'])
 def __init__(self, sources, target_arch, target_os, compilers):
     # PDT 3.22 can't be built with PGI compilers so substitute GNU compilers instead
     if compilers[CC].unwrap().info.family is PGI:
         try:
             gnu_compilers = GNU.installation()
         except ConfigurationError:
             raise SoftwarePackageError("GNU compilers (required to build PDT) could not be found.")
         compilers = compilers.modify(Host_CC=gnu_compilers[CC], Host_CXX=gnu_compilers[CXX])
     super(PdtInstallation, self).__init__('pdt', 'PDT', sources, target_arch, target_os, 
                                           compilers, REPOS, COMMANDS, None, None)
     self.tau_magic = TauMagic.find((self.target_arch, self.target_os))
     # PDT puts installation files (bin, lib, etc.) in a magically named subfolder
     self._bin_subdir = os.path.join(self.tau_magic.name, 'bin')
     self._lib_subdir = os.path.join(self.tau_magic.name, 'lib')
     # Work around brokenness in edg4x-rose installer
     self._retry_verify = True
示例#4
0
 def _parse_tau_makefile(self, args):
     # Parsing a TAU Makefile is a really hairy operation, so let's lift the limits
     # pylint: disable=too-many-statements,too-many-locals
     makefile = args.forced_makefile
     if not util.path_accessible(makefile):
         self.parser.error("Invalid TAU makefile: %s" % makefile)
     tau_arch_name = os.path.basename(
         os.path.dirname(os.path.dirname(makefile)))
     matches = [
         arch for arch in TauMagic.all() if arch.name == tau_arch_name
     ]
     if len(matches) == 1:
         tau_arch = matches[0]
     elif not matches:
         raise ConfigurationError(
             "TAU Makefile '%s' targets an unrecognized TAU architecture: %s"
             % (makefile, tau_arch_name))
     else:
         for arch in matches:
             if arch.architecture == HOST_ARCH and arch.operating_system == HOST_OS:
                 tau_arch = arch
                 break
         else:
             parts = [
                 "TAU Makefile '%s' targets an ambiguous TAU architecture: %s"
                 % (makefile, tau_arch_name), "It could be any of these:"
             ]
             parts.extend([
                 "  - %s on %s" %
                 (arch.operating_system.name, arch.architecture.name)
                 for arch in matches
             ])
             raise ConfigurationError("\n".join(parts))
     self.logger.info(
         "Parsing TAU Makefile '%s' to populate command line arguments:",
         makefile)
     args.host_arch = tau_arch.architecture.name
     self.logger.info("  --host-arch='%s'", args.host_arch)
     args.host_os = tau_arch.operating_system.name
     self.logger.info("  --host-os='%s'", args.host_os)
     args.tau_source = os.path.abspath(
         os.path.join(os.path.dirname(makefile), '..', '..'))
     self.logger.info("  --taucmdr='%s'", args.tau_source)
     with open(makefile, 'r') as fin:
         compiler_parts = ("FULL_CC", "FULL_CXX", "TAU_F90")
         package_parts = {
             "BFDINCLUDE":
             ("binutils_source",
              lambda x: os.path.dirname(shlex.split(x)[0].lstrip("-I"))),
             "UNWIND_INC": ("libunwind_source",
                            lambda x: os.path.dirname(x.lstrip("-I"))),
             "PAPIDIR": ("papi_source", os.path.abspath),
             "PDTDIR": ("pdt_source", os.path.abspath),
             "SCOREPDIR": ("scorep_source", os.path.abspath)
         }
         tau_r = ''
         for line in fin:
             if line.startswith('#'):
                 continue
             try:
                 key, val = [x.strip() for x in line.split('=', 1)]
             except ValueError:
                 continue
             if key == 'TAU_R':
                 tau_r = val.split()[0]
             elif key in compiler_parts:
                 path = util.which(val.strip().split()[0].replace(
                     '$(TAU_R)', tau_r))
                 if not path:
                     self.logger.warning(
                         "Failed to parse %s in TAU Makefile '%s'", key,
                         makefile)
                     continue
                 matching_info = Knowledgebase.find_compiler(
                     os.path.basename(path))
                 if matching_info:
                     if len(matching_info) > 1:
                         self.logger.warning(
                             "Ambiguous compiler '%s' in TAU Makefile '%s'",
                             path, makefile)
                     comp = InstalledCompiler(path, matching_info[0])
                     attr = comp.info.role.keyword
                     setattr(args, attr, comp.absolute_path)
                     self.logger.info("  --%s='%s'",
                                      attr.lower().replace("_", "-"),
                                      comp.absolute_path)
                     while comp.wrapped:
                         comp = comp.wrapped
                         attr = comp.info.role.keyword
                         setattr(args, attr, comp.absolute_path)
                         self.logger.info("  --%s='%s'",
                                          attr.lower().replace("_", "-"),
                                          comp.absolute_path)
             elif key in package_parts:
                 attr, operator = package_parts[key]
                 path = val.strip()
                 if not path:
                     path = None
                 else:
                     path = operator(path)
                     if not os.path.exists(path):
                         self.logger.warning(
                             "'%s' referenced by TAU Makefile '%s' doesn't exist",
                             path, makefile)
                         continue
                 setattr(args, attr, path)
                 self.logger.info("  --%s='%s'",
                                  attr.replace("_source", ""), path)
 def test_tau_magic_detect(self):
     self.assertTrue(TauMagic.detect())
示例#6
0
 def _parse_tau_makefile(self, args):
     # Parsing a TAU Makefile is a really hairy operation, so let's lift the limits
     # pylint: disable=too-many-statements,too-many-locals
     makefile = args.forced_makefile
     if not util.path_accessible(makefile):
         self.parser.error("Invalid TAU makefile: %s" % makefile)
     tau_arch_name = os.path.basename(os.path.dirname(os.path.dirname(makefile)))
     matches = [arch for arch in TauMagic.all() if arch.name == tau_arch_name]
     if len(matches) == 1:
         tau_arch = matches[0]
     elif len(matches) == 0:
         raise ConfigurationError("TAU Makefile '%s' targets an unrecognized TAU architecture: %s" % 
                                  (makefile, tau_arch_name))
     else:
         for arch in matches:
             if arch.architecture == HOST_ARCH and arch.operating_system == HOST_OS:
                 tau_arch = arch
                 break
         else:
             parts = ["TAU Makefile '%s' targets an ambiguous TAU architecture: %s" % (makefile, tau_arch_name),
                      "It could be any of these:"]
             parts.extend(["  - %s on %s" % (arch.operating_system.name, arch.architecture.name) 
                           for arch in matches])
             raise ConfigurationError("\n".join(parts))
     self.logger.info("Parsing TAU Makefile '%s' to populate command line arguments:", makefile)
     args.host_arch = tau_arch.architecture.name
     self.logger.info("  --host-arch='%s'", args.host_arch)
     args.host_os = tau_arch.operating_system.name
     self.logger.info("  --host-os='%s'", args.host_os)
     args.tau_source = os.path.abspath(os.path.join(os.path.dirname(makefile), '..', '..'))
     self.logger.info("  --taucmdr='%s'", args.tau_source)
     with open(makefile, 'r') as fin:
         compiler_parts = ("FULL_CC", "FULL_CXX", "TAU_F90")
         package_parts = {"BFDINCLUDE": ("binutils_source", lambda x: os.path.dirname(x.lstrip("-I"))), 
                          "UNWIND_INC": ("libunwind_source", lambda x: os.path.dirname(x.lstrip("-I"))),
                          "PAPIDIR": ("papi_source", os.path.abspath),
                          "PDTDIR": ("pdt_source", os.path.abspath),
                          "SCOREPDIR": ("scorep_source", os.path.abspath)}
         tau_r = ''
         for line in fin:
             if line.startswith('#'):
                 continue
             try:
                 key, val = [x.strip() for x in line.split('=', 1)]
             except ValueError:
                 continue
             if key == 'TAU_R':
                 tau_r = val.split()[0]
             elif key in compiler_parts:
                 path = util.which(val.strip().split()[0].replace('$(TAU_R)', tau_r))
                 if not path:
                     self.logger.warning("Failed to parse %s in TAU Makefile '%s'", key, makefile)
                     continue
                 matching_info = Knowledgebase.find_compiler(os.path.basename(path))
                 if matching_info:
                     if len(matching_info) > 1:
                         self.logger.warning("Ambiguous compiler '%s' in TAU Makefile '%s'", path, makefile)
                     comp = InstalledCompiler(path, matching_info[0])
                     attr = comp.info.role.keyword
                     setattr(args, attr, comp.absolute_path)
                     self.logger.info("  --%s='%s'", attr.lower().replace("_", "-"), comp.absolute_path)
                     while comp.wrapped:
                         comp = comp.wrapped
                         attr = comp.info.role.keyword
                         setattr(args, attr, comp.absolute_path)
                         self.logger.info("  --%s='%s'", attr.lower().replace("_", "-"), comp.absolute_path)
             elif key in package_parts:
                 attr, operator = package_parts[key]
                 path = val.strip()
                 if not path:
                     path = None
                 else:
                     path = operator(path)
                     if not os.path.exists(path):
                         self.logger.warning("'%s' referenced by TAU Makefile '%s' doesn't exist", path, makefile)
                         continue
                 setattr(args, attr, path)
                 self.logger.info("  --%s='%s'", attr.replace("_source", ""), path)