Massive conversion from Package to CMakePackage (#4975)
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
from spack import *
|
||||
|
||||
|
||||
class LlvmOpenmpOmpt(Package):
|
||||
class LlvmOpenmpOmpt(CMakePackage):
|
||||
"""The OpenMP subproject provides an OpenMP runtime for use with the
|
||||
OpenMP implementation in Clang. This branch includes experimental
|
||||
changes for OMPT, the OpenMP Tools interface"""
|
||||
@@ -42,25 +42,26 @@ class LlvmOpenmpOmpt(Package):
|
||||
git='https://github.com/OpenMPToolsInterface/LLVM-openmp.git',
|
||||
commit='982a08bcf3df9fb5afc04ac3bada47f19cc4e3d3')
|
||||
|
||||
depends_on('cmake', type='build')
|
||||
depends_on('cmake@2.8:', type='build')
|
||||
depends_on('llvm')
|
||||
depends_on('ninja', type='build')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
def cmake_args(self):
|
||||
return [
|
||||
'-G', 'Ninja',
|
||||
'-DCMAKE_C_COMPILER=clang',
|
||||
'-DCMAKE_CXX_COMPILER=clang++',
|
||||
'-DCMAKE_BUILD_TYPE=Release',
|
||||
'-DLIBOMP_OMPT_SUPPORT=on',
|
||||
'-DLIBOMP_OMPT_BLAME=on',
|
||||
'-DLIBOMP_OMPT_TRACE=on'
|
||||
]
|
||||
|
||||
with working_dir('spack-build', create=True):
|
||||
cmake_args = std_cmake_args[:]
|
||||
cmake_args.extend([
|
||||
'-G', 'Ninja',
|
||||
'-DCMAKE_C_COMPILER=clang',
|
||||
'-DCMAKE_CXX_COMPILER=clang++',
|
||||
'-DCMAKE_BUILD_TYPE=Release',
|
||||
'-DLIBOMP_OMPT_SUPPORT=on',
|
||||
'-DLIBOMP_OMPT_BLAME=on',
|
||||
'-DLIBOMP_OMPT_TRACE=on'
|
||||
])
|
||||
|
||||
cmake('..', *cmake_args)
|
||||
ninja = Executable('ninja')
|
||||
# TODO: Add better ninja support to CMakePackage
|
||||
def build(self, spec, prefix):
|
||||
with working_dir(self.build_directory):
|
||||
ninja()
|
||||
|
||||
def install(self, spec, prefix):
|
||||
with working_dir(self.build_directory):
|
||||
ninja('install')
|
||||
|
Reference in New Issue
Block a user