Update ecp st tau pdt (#8192)

* Updated MPI and TAU versions in the TAU package
* Updated PDT versions
* Added support for Python (+python), default to `False`
* Cleaned up binutils, python, mpi usage.
* Updated binutils install to add additional header files to the include/extra directory.
* Resolving review problems with TAU and binutils packages.
  The binutils package was updated to include support for installing
  the ELF headers as a +headers variant.  The TAU package was updated
  to use all known Spack dependencies.
This commit is contained in:
sameershende 2019-01-23 22:40:58 -06:00 committed by Todd Gamblin
parent 9252f7f957
commit 7d12ff6e16
2 changed files with 134 additions and 33 deletions

View File

@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import * from spack import *
import glob
class Binutils(AutotoolsPackage): class Binutils(AutotoolsPackage):
@ -28,6 +29,7 @@ class Binutils(AutotoolsPackage):
variant('gold', default=True, description="build the gold linker") variant('gold', default=True, description="build the gold linker")
variant('libiberty', default=False, description='Also install libiberty.') variant('libiberty', default=False, description='Also install libiberty.')
variant('nls', default=True, description='Enable Native Language Support') variant('nls', default=True, description='Enable Native Language Support')
variant('headers', default=False, description='Install extra headers (e.g. ELF)')
patch('cr16.patch', when='@:2.29.1') patch('cr16.patch', when='@:2.29.1')
patch('update_symbol-2.26.patch', when='@2.26') patch('update_symbol-2.26.patch', when='@2.26')
@ -75,3 +77,17 @@ def configure_args(self):
configure_args.append('--program-prefix=g') configure_args.append('--program-prefix=g')
return configure_args return configure_args
@run_after('install')
def install_headers(self):
# some packages (like TAU) need the ELF headers, so install them
# as a subdirectory in include/extras
if '+headers' in self.spec:
extradir = join_path(self.prefix.include, 'extra')
mkdirp(extradir)
# grab the full binutils set of headers
install_tree('include', extradir)
# also grab the headers from the bfd directory
for current_file in glob.glob(join_path(self.build_directory,
'bfd', '*.h')):
install(current_file, extradir)

View File

@ -5,7 +5,9 @@
from spack import * from spack import *
import os import os
import fnmatch
import glob import glob
import platform
from llnl.util.filesystem import join_path from llnl.util.filesystem import join_path
@ -16,39 +18,68 @@ class Tau(Package):
""" """
homepage = "http://www.cs.uoregon.edu/research/tau" homepage = "http://www.cs.uoregon.edu/research/tau"
url = "https://www.cs.uoregon.edu/research/tau/tau_releases/tau-2.25.tar.gz" url = "https://www.cs.uoregon.edu/research/tau/tau_releases/tau-2.28.tar.gz"
git = "https://github.com/UO-OACISS/tau2"
version('develop', branch='master')
version('2.28', '68c6f13ae748d12c921456e494006796ca2b0efebdeef76ee7c898c81592883e')
version('2.27.2p1', 'b9cc42ee8afdcfefe5104ab0a8f23a23')
version('2.27.2', 'b264ab0df78112f9a529e59a5f4dc191')
version('2.27.1', '4f98ff67ae5ab1ff2712f694bdec1fa9') version('2.27.1', '4f98ff67ae5ab1ff2712f694bdec1fa9')
version('2.27', '76602d35fc96f546b5b9dcaf09158651') version('2.27', '76602d35fc96f546b5b9dcaf09158651')
version('2.26.3', '4ec14e85b8f3560b58628512c7b49e17') version('2.26.3', '4ec14e85b8f3560b58628512c7b49e17')
version('2.26.2', '8a5908c35dac9406c9220b8098c70c1c')
version('2.26.1', 'cc13df9d6ad19bca9a8e55a9e7d0341e')
version('2.26', '2af91f02ad26d5bf0954146c56a8cdfa')
version('2.25', '46cd48fa3f3c4ce0197017b3158a2b43') version('2.25', '46cd48fa3f3c4ce0197017b3158a2b43')
version('2.24.1', '6635ece6d1f08215b02f5d0b3c1e971b') version('2.24.1', '6635ece6d1f08215b02f5d0b3c1e971b')
version('2.24', '57ce33539c187f2e5ec68f0367c76db4') version('2.24', '57ce33539c187f2e5ec68f0367c76db4')
version('2.23.1', '6593b47ae1e7a838e632652f0426fe72') version('2.23.1', '6593b47ae1e7a838e632652f0426fe72')
# TODO : shmem variant missing
variant('download', default=False,
description='Downloads and builds various dependencies')
variant('scorep', default=False, description='Activates SCOREP support') variant('scorep', default=False, description='Activates SCOREP support')
variant('openmp', default=True, description='Use OpenMP threads') variant('openmp', default=False, description='Use OpenMP threads')
variant('mpi', default=True, variant('pthreads', default=True, description='Use POSIX threads')
description='Specify use of TAU MPI wrapper library') variant('mpi', default=False, description='Specify use of TAU MPI wrapper library')
variant('phase', default=True, description='Generate phase based profiles') variant('phase', default=False, description='Generate phase based profiles')
variant('comm', default=True, variant('papi', default=True, description='Activates Performance API')
description=' Generate profiles with MPI communicator info') variant('binutils', default=True, description='Activates support of BFD GNU Binutils')
variant('libunwind', default=True, description='Activates support of libunwind')
variant('otf2', default=True, description='Activates support of Open Trace Format (OTF)')
variant('pdt', default=True, description='Use PDT for source code instrumentation')
variant('comm', default=False, description=' Generate profiles with MPI communicator info')
variant('python', default=False, description='Activates Python support')
variant('likwid', default=False, description='Activates LIKWID support')
variant('ompt', default=False, description='Activates OMPT instrumentation')
variant('opari', default=False, description='Activates Opari2 instrumentation')
variant('shmem', default=False, description='Activates SHMEM support')
variant('gasnet', default=False, description='Activates GASNET support')
variant('cuda', default=False, description='Activates CUDA support')
# TODO : Try to build direct OTF2 support? Some parts of the OTF support # Support cross compiling.
# TODO : library in TAU are non-conformant, # This is a _reasonable_ subset of the full set of TAU
# TODO : and fail at compile-time. Further, SCOREP is compiled with OTF2 # architectures supported:
# support. variant('craycnl', default=False, description='Build for Cray compute nodes')
depends_on('pdt') # Required for TAU instrumentation variant('bgq', default=False, description='Build for IBM BlueGene/Q compute nodes')
variant('ppc64le', default=False, description='Build for IBM Power LE nodes')
depends_on('pdt', when='+pdt') # Required for TAU instrumentation
depends_on('scorep', when='+scorep') depends_on('scorep', when='+scorep')
depends_on('binutils', when='~download') depends_on('otf2@2.1:', when='+otf2')
depends_on('likwid', when='+likwid')
depends_on('papi', when='+papi')
# TAU requires the ELF header support, libiberty and demangle.
depends_on('binutils+libiberty+headers~nls', when='+binutils')
depends_on('python@2.7:', when='+python')
depends_on('libunwind', when='+libunwind')
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
depends_on('cuda', when='+cuda')
depends_on('gasnet', when='+gasnet')
filter_compiler_wrappers('tau_cc.sh', 'Makefile.tau', relative_root='bin')
def set_compiler_options(self): def set_compiler_options(self):
useropt = ["-O2", self.rpath_args] useropt = ["-O2 -g", self.rpath_args]
########## ##########
# Selecting a compiler with TAU configure is quite tricky: # Selecting a compiler with TAU configure is quite tricky:
@ -65,10 +96,13 @@ def set_compiler_options(self):
# PATH # PATH
compiler_path = os.path.dirname(self.compiler.cc) compiler_path = os.path.dirname(self.compiler.cc)
os.environ['PATH'] = ':'.join([compiler_path, os.environ['PATH']]) os.environ['PATH'] = ':'.join([compiler_path, os.environ['PATH']])
compiler_options = ['-c++=%s' % self.compiler.cxx_names[0],
'-cc=%s' % self.compiler.cc_names[0]] compiler_options = ['-c++=%s' % self.compiler.cxx,
'-cc=%s' % self.compiler.cc]
if self.compiler.fc: if self.compiler.fc:
compiler_options.append('-fortran=%s' % self.compiler.fc_names[0]) compiler_options.append('-fortran=%s' % self.compiler.fc_names[0])
########## ##########
# Construct the string of custom compiler flags and append it to # Construct the string of custom compiler flags and append it to
@ -88,31 +122,82 @@ def install(self, spec, prefix):
# written script (nothing related to autotools). As such it has # written script (nothing related to autotools). As such it has
# a few #peculiarities# that make this build quite hackish. # a few #peculiarities# that make this build quite hackish.
options = ["-prefix=%s" % prefix, options = ["-prefix=%s" % prefix,
"-iowrapper", "-iowrapper"]
"-pdt=%s" % spec['pdt'].prefix]
# If download is active, download and build suggested dependencies if '+pdt' in spec:
if '+download' in spec: options.append("-pdt=%s" % spec['pdt'].prefix)
options.extend(['-bfd=download',
'-unwind=download',
'-asmdex=download'])
else:
options.extend(["-bfd=%s" % spec['binutils'].prefix])
# TODO : unwind and asmdex are still missing
if '+scorep' in spec: if '+scorep' in spec:
options.append("-scorep=%s" % spec['scorep'].prefix) options.append("-scorep=%s" % spec['scorep'].prefix)
if '+pthreads' in spec:
options.append('-pthread')
if '+likwid' in spec:
options.append("-likwid=%s" % spec['likwid'].prefix)
if '+papi' in spec:
options.append("-papi=%s" % spec['papi'].prefix)
if '+openmp' in spec: if '+openmp' in spec:
options.append('-openmp') options.append('-openmp')
if '+opari' in spec:
options.append('-opari')
if '+binutils' in spec:
options.append("-bfd=%s" % spec['binutils'].prefix)
if '+libunwind' in spec:
options.append("-unwind=%s" % spec['libunwind'].prefix)
if '+otf2' in spec:
options.append("-otf=%s" % spec['otf2'].prefix)
if '+mpi' in spec: if '+mpi' in spec:
options.append('-mpi') options.append('-mpi')
if '+comm' in spec:
options.append('-PROFILECOMMUNICATORS')
if '+shmem' in spec:
options.append('-shmem')
if '+gasnet' in spec:
options.append('-gasnet=%s' % spec['gasnet'].prefix)
if '+cuda' in spec:
options.append("-cuda=%s" % spec['cuda'].prefix)
if '+phase' in spec: if '+phase' in spec:
options.append('-PROFILEPHASE') options.append('-PROFILEPHASE')
if '+comm' in spec: if '+python' in spec:
options.append('-PROFILECOMMUNICATORS') options.append('-python')
# find Python.h (i.e. include/python2.7/Python.h)
include_path = spec['python'].prefix.include
found = False
for root, dirs, files in os.walk(spec['python'].prefix.include):
for filename in fnmatch.filter(files, 'Python.h'):
include_path = root
break
found = True
if found:
break
options.append("-pythoninc=%s" % include_path)
# find libpython*.* (i.e. lib/python2.7/libpython2.7.so)
lib_path = spec['python'].prefix.lib
found = False
file_to_find = 'libpython*.so'
if (platform.system() == "Darwin"):
file_to_find = 'libpython*.dylib'
for root, dirs, files in os.walk(spec['python'].prefix.lib):
for filename in fnmatch.filter(files, file_to_find):
lib_path = root
break
found = True
if found:
break
options.append("-pythonlib=%s" % lib_path)
compiler_specific_options = self.set_compiler_options() compiler_specific_options = self.set_compiler_options()
options.extend(compiler_specific_options) options.extend(compiler_specific_options)
@ -126,7 +211,7 @@ def install(self, spec, prefix):
def link_tau_arch_dirs(self): def link_tau_arch_dirs(self):
for subdir in os.listdir(self.prefix): for subdir in os.listdir(self.prefix):
for d in ('bin', 'lib'): for d in ('bin', 'lib'):
src = join_path(self.prefix, subdir, d) src = join_path(self.prefix, subdir, d)
dest = join_path(self.prefix, d) dest = join_path(self.prefix, d)
if os.path.isdir(src) and not os.path.exists(dest): if os.path.isdir(src) and not os.path.exists(dest):
os.symlink(join_path(subdir, d), dest) os.symlink(join_path(subdir, d), dest)