Update llvm, adjust dependency specs and conflicts (#14561)

This PR adds a new version of llvm and fixes the dependency specs.

- This package depends on libtinfo in all cases so change the ncurses
  dependency to reflect that
- if +lldb is in the spec but +python is not then do not build the lldb
  python support
- build lldb python support only if +python is in the spec with +lldb
- install the llvm python bindings if +python is in the spec
- install the clang python bindings if +clang and +python are in the spec
- Fixes for conflicts with ~clang
- Fix typo in conflict of compiler-rt and flang
This commit is contained in:
Glenn Johnson 2020-02-05 20:37:08 -06:00 committed by GitHub
parent 1a0c31703a
commit 1f6f812696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ class Llvm(CMakePackage):
family = 'compiler' # Used by lmod
version('master', branch='master')
version('9.0.1', sha256='be7b034641a5fda51ffca7f5d840b1a768737779f75f7c4fd18fe2d37820289a')
version('9.0.0', sha256='7807fac25330e24e9955ca46cd855dd34bbc9cc4fdba8322366206654d1036f2')
version('8.0.0', sha256='d81238b4a69e93e29f74ce56f8107cbfcf0c7d7b40510b7879e98cc031e25167')
version('7.1.0', sha256='71c93979f20e01f1a1cc839a247945f556fa5e63abf2084e8468b238080fd839')
@ -102,8 +103,10 @@ class Llvm(CMakePackage):
# openmp dependencies
depends_on('perl-data-dumper', type=('build'))
# ncurses dependency
depends_on('ncurses+termlib')
# lldb dependencies
depends_on('ncurses', when='+lldb')
depends_on('swig', when='+lldb')
depends_on('libedit', when='+lldb')
depends_on('py-six', when='@5.0.0: +lldb +python')
@ -115,8 +118,11 @@ class Llvm(CMakePackage):
depends_on('gmp', when='@:3.6.999 +polly')
depends_on('isl', when='@:3.6.999 +polly')
conflicts('+clang_extra', when='~clang')
conflicts('+lldb', when='~clang')
conflicts('+clang_extra', when='~clang')
conflicts('+lldb', when='~clang')
conflicts('+libcxx', when='~clang')
conflicts('+internal_unwind', when='~clang')
conflicts('+compiler-rt', when='~clang')
# LLVM 4 and 5 does not build with GCC 8
conflicts('%gcc@8:', when='@:5')
@ -194,6 +200,9 @@ def cmake_args(self):
if '+python' in spec and '+lldb' in spec and spec.satisfies('@5.0.0:'):
cmake_args.append('-DLLDB_USE_SYSTEM_SIX:Bool=TRUE')
if '~python' in spec and '+lldb' in spec:
cmake_args.append('-DLLDB_DISABLE_PYTHON:Bool=TRUE')
if '+gold' in spec:
cmake_args.append('-DLLVM_BINUTILS_INCDIR=' +
spec['binutils'].prefix.include)
@ -282,10 +291,11 @@ def pre_install(self):
@run_after('install')
def post_install(self):
if '+clang' in self.spec and '+python' in self.spec:
install_tree(
'tools/clang/bindings/python/clang',
join_path(site_packages_dir, 'clang'))
if '+python' in self.spec:
install_tree('llvm/bindings/python', site_packages_dir)
if '+clang' in self.spec:
install_tree('clang/bindings/python', site_packages_dir)
with working_dir(self.build_directory):
install_tree('bin', join_path(self.prefix, 'libexec', 'llvm'))