From 95ff37309ac1c9eb6605a3a7c2d6eb9f34895245 Mon Sep 17 00:00:00 2001 From: Jim Galarowicz Date: Tue, 26 Sep 2017 13:15:37 -0700 Subject: [PATCH] Add ability to build llvm-openmp-ompt alone, with gnu compilers and use the resulting ompt interface in cbtf-krell and openspeedshop to gather openmp specific performance information. (#5288) * Update the krell institute products to use the latest features of spack for building on cluster platforms. * Address travis error messages and resubmit the pull request. * Update the contents of openspeedshop package.py so it passes the flake8 tests. * Fix flake8 error-whitespack issue in mrnet package.py file. * Add updates based on spack reviewer feedback. * More fixes based on comments from reviewers. Switch using extend to using append, remove additional setting of PATH and LD_LIBRARY_PATH that should not be required due to RPATH. * More review related changes. Update MPIOption.append lines and take out xercesc references. * Create a base options function for common openspeedshop base cmake options to reduce redundencies. * Add libxml2+python depends on to get around issues with the libxml2 package file. * Using boost over 1.60.0 causes compile errors. This is a known boost bug. Also, dyninst-9.2.0 is set to be the vesrion of dyninst to use with OSS, as of now. The newer version fails to build. * Fix bad syntax in specifying the boost version range. * Update the version numbers for the krell institute components and tools: cbtf and openspeedshop. * Do not build glib for qt3, it is not needed and causes build problems at this time anyway. * A fix was added for setting LD_LIBRARY_PATH in the qt3 build, but if LD_LIBRARY_PATH is not set the qt build fails. So so check and set LD_LIBRARY_PATH if not set, update if it is set. * Update the fix for qt3 build by setting LD_LIBRARY_PATH instead of checking for whether it is set or not per Adams comment that spack clears LD_LIBRARY_PATH. * A fix was added for setting LD_LIBRARY_PATH in the qt3 build, but if LD_LIBRARY_PATH is not set the qt build fails. So so check and set LD_LIBRARY_PATH if not set, update if it is set. * Trim comments to fit more concisely. * Fix tabs versus spaces and swap if and else clause check from a negative to a positive check. * Add ability to build llvm-openmp-ompt alone, with gnu compilers and use the resulting ompt interface in cbtf-krell and openspeedshop to gather openmp specific performance information. * Fix flake8 errors. * Fix flake8 errors - stage 2. * Fixes based on reviewer suggestions and comments. * Use build_type variant to set the build type and allow changing of the type. * Fix missing comma in cmake_arg list, found on another test machine. --- .../builtin/packages/cbtf-krell/package.py | 2 + .../packages/llvm-openmp-ompt/package.py | 42 ++++++++++++++++--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/cbtf-krell/package.py b/var/spack/repos/builtin/packages/cbtf-krell/package.py index fce4ae62e2..3b81105c68 100644 --- a/var/spack/repos/builtin/packages/cbtf-krell/package.py +++ b/var/spack/repos/builtin/packages/cbtf-krell/package.py @@ -89,6 +89,7 @@ class CbtfKrell(CMakePackage): depends_on("libmonitor+krellpatch") depends_on("libunwind") depends_on("papi") + depends_on("llvm-openmp-ompt@towards_tr4+standalone") # MPI Installations # These have not worked either for build or execution, commenting out for @@ -149,6 +150,7 @@ def cmake_args(self): '-DBOOST_DIR=%s' % spec['boost'].prefix, '-DMRNET_DIR=%s' % spec['mrnet'].prefix, '-DDYNINST_DIR=%s' % spec['dyninst'].prefix, + '-DLIBIOMP_DIR=%s' % spec['llvm-openmp-ompt'].prefix, '-DXERCESC_DIR=%s' % spec['xerces-c'].prefix] # Add any MPI implementations coming from variant settings diff --git a/var/spack/repos/builtin/packages/llvm-openmp-ompt/package.py b/var/spack/repos/builtin/packages/llvm-openmp-ompt/package.py index ee1c28fbee..4d660499fd 100644 --- a/var/spack/repos/builtin/packages/llvm-openmp-ompt/package.py +++ b/var/spack/repos/builtin/packages/llvm-openmp-ompt/package.py @@ -33,26 +33,56 @@ class LlvmOpenmpOmpt(CMakePackage): homepage = "https://github.com/OpenMPToolsInterface/LLVM-openmp" - # tr4-stable branch + # towards_tr4 branch + version('towards_tr4', branch='towards_tr4', + git='https://github.com/OpenMPToolsInterface/LLVM-openmp.git') + version('3.9.2b2', git='https://github.com/OpenMPToolsInterface/LLVM-openmp.git', commit='5cdca5dd3c0c336d42a335ca7cff622e270c9d47') + # align-to-tr-rebased branch version('3.9.2b', git='https://github.com/OpenMPToolsInterface/LLVM-openmp.git', commit='982a08bcf3df9fb5afc04ac3bada47f19cc4e3d3') + # variant for building llvm-openmp-ompt as a stand alone library + variant('standalone', default=False, + description="Build llvm openmpi ompt library as a \ + stand alone entity.") + + variant('build_type', default='Release', + description='CMake build type', + values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel')) + depends_on('cmake@2.8:', type='build') - depends_on('llvm') + depends_on('llvm', when='~standalone') depends_on('ninja@1.5:', type='build') generator = 'Ninja' def cmake_args(self): - return [ - '-DCMAKE_C_COMPILER=clang', - '-DCMAKE_CXX_COMPILER=clang++', + cmake_args = [ '-DLIBOMP_OMPT_SUPPORT=on', '-DLIBOMP_OMPT_BLAME=on', - '-DLIBOMP_OMPT_TRACE=on' + '-DLIBOMP_OMPT_TRACE=on', + '-DCMAKE_C_COMPILER=%s' % spack_cc, + '-DCMAKE_CXX_COMPILER=%s' % spack_cxx ] + + # Build llvm-openmp-ompt as a stand alone library + # CMAKE rpath variable prevents standalone error + # where this package wants the llvm tools path + if '+standalone' in self.spec: + cmake_args.extend( + ['-DLIBOMP_STANDALONE_BUILD=true', + '-DCMAKE_BUILD_WITH_INSTALL_RPATH=true', + '-DLIBOMP_USE_DEBUGGER=false']) + + # Build llvm-openmp-ompt using the toward_tr4 branch + # This requires the version to be 5.0 (50) + if '@towards_tr4' in self.spec: + cmake_args.extend( + ['-DLIBOMP_OMP_VERSION=50']) + + return cmake_args