summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Rood <jon.rood@nrel.gov>2020-02-12 11:30:04 -0700
committerGitHub <noreply@github.com>2020-02-12 12:30:04 -0600
commit7e50cec5a42b5dc9b1ae6ef9cacb1b73e6f155f2 (patch)
tree2549beb529c03d768fd21b7fa843ab74508282a2
parentca66ab69017d75b2170bc95e96c438553f27337b (diff)
downloadspack-7e50cec5a42b5dc9b1ae6ef9cacb1b73e6f155f2.tar.gz
spack-7e50cec5a42b5dc9b1ae6ef9cacb1b73e6f155f2.tar.bz2
spack-7e50cec5a42b5dc9b1ae6ef9cacb1b73e6f155f2.tar.xz
spack-7e50cec5a42b5dc9b1ae6ef9cacb1b73e6f155f2.zip
Adding Intel LLVM compiler (#13618)
* Adding Intel LLVM compiler. * Fixing some minor issues. * Split build environment on run environment in intel-llvm.
-rw-r--r--var/spack/repos/builtin/packages/intel-llvm/package.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/intel-llvm/package.py b/var/spack/repos/builtin/packages/intel-llvm/package.py
new file mode 100644
index 0000000000..0be87d4a03
--- /dev/null
+++ b/var/spack/repos/builtin/packages/intel-llvm/package.py
@@ -0,0 +1,50 @@
+# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class IntelLlvm(CMakePackage):
+ """Intel's version of the LLVM compiler.
+ """
+
+ homepage = 'https://github.com/intel/llvm'
+ git = 'https://github.com/intel/llvm.git'
+
+ family = 'compiler'
+
+ version('sycl', branch='sycl')
+
+ depends_on('cmake@3.4.3:', type='build')
+
+ # It doesn't seem possible to use != in a conflicts statement
+ # conflicts('target != x86_64',
+ # msg='Intel LLVM compiler currently only works for x86')
+
+ def setup_build_environment(self, env):
+ env.append_flags('CXXFLAGS', self.compiler.cxx11_flag)
+
+ def setup_run_environment(self, env):
+ if '+clang' in self.spec:
+ env.set('CC', join_path(self.spec.prefix.bin, 'clang'))
+ env.set('CXX', join_path(self.spec.prefix.bin, 'clang++'))
+
+ root_cmakelists_dir = 'llvm'
+
+ def cmake_args(self):
+
+ cmake_args = []
+
+ cmake_args.extend([
+ '-DLLVM_TARGETS_TO_BUILD=X86',
+ '-DLLVM_EXTERNAL_PROJECTS=llvm-spirv;sycl',
+ '-DLLVM_ENABLE_PROJECTS=clang;llvm-spirv;sycl',
+ '-DLLVM_EXTERNAL_SYCL_SOURCE_DIR={0}'.format(
+ join_path(self.stage.source_path, 'sycl')),
+ '-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR={0}'.format(
+ join_path(self.stage.source_path, 'llvm-spirv')),
+ ])
+
+ return cmake_args