From 937f68c3598e1f07f8154126bebc28e25263ab89 Mon Sep 17 00:00:00 2001 From: Andrey Prokopenko Date: Fri, 22 Dec 2017 01:32:10 -0500 Subject: [PATCH] clang,flang: update CC, CXX environment in installation module (#6737) --- var/spack/repos/builtin/packages/flang/package.py | 5 +++++ var/spack/repos/builtin/packages/llvm/package.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/flang/package.py b/var/spack/repos/builtin/packages/flang/package.py index fb84e9841d..1b9d746087 100644 --- a/var/spack/repos/builtin/packages/flang/package.py +++ b/var/spack/repos/builtin/packages/flang/package.py @@ -80,3 +80,8 @@ def post_install(self): out.close() chmod = which('chmod') chmod('+x', flang) + + def setup_environment(self, spack_env, run_env): + run_env.set('FC', join_path(self.spec.prefix.bin, 'flang')) + run_env.set('F77', join_path(self.spec.prefix.bin, 'flang')) + run_env.set('F90', join_path(self.spec.prefix.bin, 'flang')) diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 48f767aa17..64045c2684 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -365,6 +365,10 @@ class Llvm(CMakePackage): def setup_environment(self, spack_env, run_env): spack_env.append_flags('CXXFLAGS', self.compiler.cxx11_flag) + if '+clang' in self.spec: + run_env.set('CC', join_path(self.spec.prefix.bin, 'clang')) + run_env.set('CXX', join_path(self.spec.prefix.bin, 'clang++')) + def cmake_args(self): spec = self.spec