Skip to content
Merged
106 changes: 106 additions & 0 deletions easybuild/easyconfigs/d/dpcpp/dpcpp-6.0.0-GCCcore-13.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Copyright:: Codeplay Software Ltd.
# Authors:: Rafal Bielski <rafal.bielski@codeplay.com>
# License:: GPLv2.0

easyblock = 'CMakeNinja'

name = 'dpcpp'
version = '6.0.0'

homepage = 'https://github.com/intel/llvm'
description = '''The DPC++ is a LLVM-based compiler project that implements
compiler and runtime support for the SYCL language. This build includes SYCL
backends for Intel and NVIDIA devices.'''
docurls = [
'https://github.com/intel/llvm/releases/tag/v%(version)s',
'https://intel.github.io/llvm/',
'https://developer.codeplay.com/products/oneapi/nvidia/latest/guides/'
]

toolchain = {'name': 'GCCcore', 'version': '13.3.0'}

source_urls = ['https://github.com/intel/llvm/archive/refs/tags/']
sources = ['v%(version)s.tar.gz']

# Patch disabling unified-runtime tracing and its dependency on a specific
# version of CUDA CUPTI library which would reduce portability, as well as
# fixing an issue with finding libcuda.so
patches = ['dpcpp-6.0.0-cmake-cuda-deps.patch']

checksums = [
{'v6.0.0.tar.gz': 'f7a30b3075e2690b207063bb66504ebcb466ddf10604f6467b5a1785eb022ce8'},
{'dpcpp-6.0.0-cmake-cuda-deps.patch': '6a57345b1d10a815fc1aec8ac42217f32ef3055565738602fde324a425b00cf4'},
]

builddependencies = [
('CMake', '3.29.3'),
('Ninja', '1.12.1'),
('Python', '3.12.3'),
# CUDA >= 11.7 is recommended for the NVIDIA GPU backend in DPC++.
# Since CUDA is backwards compatible, any higher version will work
# at runtime with this build. DPC++ can also be used without CUDA
# to compile for other backends, hence no runtime dependency on CUDA.
('CUDA', '11.7.0', '', SYSTEM),
]
dependencies = [
('binutils', '2.42'),
('hwloc', '2.10.0'),
]

configure_without_installdir = True
configure_cmd = ' '.join([
# Use the configure script provided in the source
'python %(start_dir)s/buildbot/configure.py',
'-o %(builddir)s/build -t Release --cmake-gen Ninja',
'--cmake-opt="-DCMAKE_INSTALL_PREFIX=%(installdir)s"',
# Include OpenMP libraries in the build
'--llvm-external-projects "openmp"',
# Enable the SYCL CUDA backend
'--cuda --cmake-opt="-DCUDA_TOOLKIT_ROOT_DIR=$EBROOTCUDA"',
# Disable tracing which would otherwise introduce a dependency on a specific
# version of CUDA (CUPTI) and reduce portability
'--cmake-opt="-DSYCL_ENABLE_XPTI_TRACING=OFF"',
# Ensure build steps using the freshly-built compiler pick up libstdc++
# from the GCCcore module and not from system
'&& mkdir -p %(builddir)s/build/bin',
'&& echo "--gcc-toolchain=$EBROOTGCCCORE" > %(builddir)s/build/bin/clang++.cfg',
'&& echo "--gcc-toolchain=$EBROOTGCCCORE" > %(builddir)s/build/bin/clang.cfg',
])

build_cmd_targets = 'deploy-sycl-toolchain omp'
build_dir = '%(builddir)s/build'
buildopts = '-C ' + build_dir + ' ' + build_cmd_targets
test_cmd = 'ninja' # not needed after easybuild-easyblocks#3771
runtest = '-C ' + build_dir

install_target_subdir = '%(builddir)s/build/install'
installopts = '-C ' + build_dir

# Ensure DPC++ picks up libstdc++ from the GCCcore module and not from system
postinstallcmds = [
'echo "--gcc-toolchain=$EBROOTGCCCORE" > %(installdir)s/bin/clang++.cfg',
'echo "--gcc-toolchain=$EBROOTGCCCORE" > %(installdir)s/bin/clang.cfg'
]

# OpenMP libs install in lib/<target-triple>
modextrapaths = {
'LIBRARY_PATH': 'lib/%(arch)s-unknown-linux-gnu',
'LD_LIBRARY_PATH': 'lib/%(arch)s-unknown-linux-gnu',
}

sanity_check_paths = {
'files': ['bin/clang', 'bin/clang++', 'bin/sycl-ls',
'include/sycl/sycl.hpp', 'lib/libsycl.so', 'lib/libur_loader.so',
'lib/libur_adapter_cuda.so', 'lib/libur_adapter_level_zero.so',
'lib/libur_adapter_opencl.so', 'lib/libze_loader.so',
'lib/libOpenCL.so', 'lib/%(arch)s-unknown-linux-gnu/libomp.so'],
'dirs': ['bin', 'include', 'lib']
}
sanity_check_commands = [
'clang --version', 'clang++ --version', 'sycl-ls',
'echo "#include <sycl/sycl.hpp>" | clang++ -x c++ -fsycl ' +
'-fsycl-targets=spir64,spir64_x86_64,intel_gpu_pvc,nvidia_gpu_sm_60 ' +
'-nocudalib -o /dev/null -c -'
]

moduleclass = 'compiler'
26 changes: 26 additions & 0 deletions easybuild/easyconfigs/d/dpcpp/dpcpp-6.0.0-cmake-cuda-deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Patch disabling unified-runtime tracing and its dependency on a specific
version of CUDA CUPTI library which would reduce portability, as well as
fixing an issue with finding libcuda.so
author: Rafal Bielski (Codeplay Software Ltd)
diff -ruN llvm-6.0.0.orig/sycl/cmake/modules/FetchUnifiedRuntime.cmake llvm-6.0.0/sycl/cmake/modules/FetchUnifiedRuntime.cmake
--- llvm-6.0.0.orig/sycl/cmake/modules/FetchUnifiedRuntime.cmake 2025-03-03 16:23:34.086679669 +0000
+++ llvm-6.0.0/sycl/cmake/modules/FetchUnifiedRuntime.cmake 2025-03-03 16:20:58.822687086 +0000
@@ -31,13 +31,17 @@
set(UR_BUILD_TESTS OFF CACHE BOOL "Build unit tests." FORCE)
set(UR_BUILD_XPTI_LIBS OFF)
set(UR_ENABLE_SYMBOLIZER ON CACHE BOOL "Enable symbolizer for sanitizer layer.")
-set(UR_ENABLE_TRACING ON)
+set(UR_ENABLE_TRACING OFF)

if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
set(UR_BUILD_ADAPTER_L0 ON)
endif()
if("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
set(UR_BUILD_ADAPTER_CUDA ON)
+ find_package(CUDA 10.1 REQUIRED)
+ unset(CUDA_cupti_LIBRARY CACHE)
+ set(_FindCUDA_testing TRUE)
+ find_library(CUDA_CUDA_LIBRARY NAMES cuda HINTS ${CUDA_TOOLKIT_ROOT_DIR} PATH_SUFFIXES compat stubs lib/stubs lib64/stubs)
endif()
if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
set(UR_BUILD_ADAPTER_HIP ON)