Skip to content

Commit 1ff3d0b

Browse files
committed
a
1 parent 5d37cac commit 1ff3d0b

File tree

2 files changed

+53
-15
lines changed

2 files changed

+53
-15
lines changed

.github/workflows/reusable_basic.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
install_tbb: ['ON']
2727
disable_hwloc: ['OFF']
2828
link_hwloc_statically: ['OFF']
29+
cmake_ver: ['latest']
2930
include:
3031
- os: 'ubuntu-22.04'
3132
build_type: Release
@@ -36,6 +37,8 @@ jobs:
3637
install_tbb: 'ON'
3738
disable_hwloc: 'OFF'
3839
link_hwloc_statically: 'OFF'
40+
# check minimum supported cmake version
41+
cmake_ver: '3.14.0'
3942
- os: 'ubuntu-22.04'
4043
build_type: Release
4144
compiler: {c: gcc, cxx: g++}
@@ -45,6 +48,7 @@ jobs:
4548
install_tbb: 'ON'
4649
disable_hwloc: 'OFF'
4750
link_hwloc_statically: 'OFF'
51+
cmake_ver: 'latest'
4852
- os: 'ubuntu-24.04'
4953
build_type: Debug
5054
compiler: {c: gcc, cxx: g++}
@@ -54,6 +58,7 @@ jobs:
5458
install_tbb: 'ON'
5559
disable_hwloc: 'OFF'
5660
link_hwloc_statically: 'OFF'
61+
cmake_ver: 'latest'
5762
# test level_zero_provider='OFF' and cuda_provider='OFF'
5863
- os: 'ubuntu-22.04'
5964
build_type: Release
@@ -64,6 +69,7 @@ jobs:
6469
install_tbb: 'ON'
6570
disable_hwloc: 'OFF'
6671
link_hwloc_statically: 'OFF'
72+
cmake_ver: 'latest'
6773
# test icx compiler
6874
- os: 'ubuntu-22.04'
6975
build_type: Release
@@ -74,6 +80,7 @@ jobs:
7480
install_tbb: 'ON'
7581
disable_hwloc: 'OFF'
7682
link_hwloc_statically: 'OFF'
83+
cmake_ver: 'latest'
7784
# test lld linker
7885
- os: 'ubuntu-24.04'
7986
build_type: Release
@@ -85,7 +92,8 @@ jobs:
8592
disable_hwloc: 'OFF'
8693
link_hwloc_statically: 'OFF'
8794
llvm_linker: '-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld"'
88-
# test without installing TBB
95+
cmake_ver: 'latest'
96+
# test without installing TBB
8997
- os: 'ubuntu-22.04'
9098
build_type: Release
9199
compiler: {c: gcc, cxx: g++}
@@ -95,6 +103,7 @@ jobs:
95103
install_tbb: 'OFF'
96104
disable_hwloc: 'OFF'
97105
link_hwloc_statically: 'OFF'
106+
cmake_ver: 'latest'
98107
- os: 'ubuntu-22.04'
99108
build_type: Debug
100109
compiler: {c: gcc, cxx: g++}
@@ -104,6 +113,7 @@ jobs:
104113
install_tbb: 'ON'
105114
disable_hwloc: 'ON'
106115
link_hwloc_statically: 'OFF'
116+
cmake_ver: 'latest'
107117
- os: 'ubuntu-22.04'
108118
build_type: Release
109119
compiler: {c: gcc, cxx: g++}
@@ -113,6 +123,7 @@ jobs:
113123
install_tbb: 'ON'
114124
disable_hwloc: 'OFF'
115125
link_hwloc_statically: 'ON'
126+
cmake_ver: 'latest'
116127
runs-on: ${{matrix.os}}
117128

118129
steps:
@@ -124,7 +135,17 @@ jobs:
124135
- name: Install apt packages
125136
run: |
126137
sudo apt-get update
127-
sudo apt-get install -y clang cmake libnuma-dev lcov
138+
sudo apt-get install -y clang libnuma-dev lcov
139+
140+
- name: Install cmake (latest)
141+
if: matrix.cmake_ver == 'latest'
142+
run: |
143+
sudo apt-get install -y cmake
144+
145+
- name: Install cmake (minimum supported version)
146+
if: matrix.cmake_ver != 'latest'
147+
run: |
148+
sudo apt-get install -y cmake=3.14.0-0ubuntu1
128149
129150
- name: Install hwloc
130151
if: matrix.disable_hwloc == 'OFF'

CMakeLists.txt

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
message(STATUS "CMake version: ${CMAKE_VERSION}")
56
cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
7+
68
# needed when UMF is used as an external project
79
set(UMF_CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
810

@@ -403,16 +405,18 @@ if(UMF_BUILD_LEVEL_ZERO_PROVIDER AND (NOT UMF_LEVEL_ZERO_INCLUDE_DIR))
403405
GIT_REPOSITORY ${LEVEL_ZERO_LOADER_REPO}
404406
GIT_TAG ${LEVEL_ZERO_LOADER_TAG}
405407
EXCLUDE_FROM_ALL)
408+
# Only populate the repo - we don't need to build it
406409
FetchContent_MakeAvailable(level-zero-loader)
410+
#FetchContent_Populate(level-zero-loader)
407411

408412
set(LEVEL_ZERO_INCLUDE_DIRS
409413
${level-zero-loader_SOURCE_DIR}/include
410-
CACHE PATH "Path to Level Zero Headers")
411-
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
414+
CACHE PATH "Path to Level Zero headers")
415+
message(STATUS "LEVEL_ZERO_INCLUDE_DIRS = ${LEVEL_ZERO_INCLUDE_DIRS}")
412416
elseif(UMF_BUILD_LEVEL_ZERO_PROVIDER)
413417
# Only header is needed to build UMF
414418
set(LEVEL_ZERO_INCLUDE_DIRS ${UMF_LEVEL_ZERO_INCLUDE_DIR})
415-
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
419+
message(STATUS "LEVEL_ZERO_INCLUDE_DIRS = ${LEVEL_ZERO_INCLUDE_DIRS}")
416420
endif()
417421

418422
# Fetch CUDA only if needed i.e.: if building CUDA provider is ON and CUDA
@@ -422,13 +426,14 @@ if(UMF_BUILD_CUDA_PROVIDER AND (NOT UMF_CUDA_INCLUDE_DIR))
422426
"https://gitlab.com/nvidia/headers/cuda-individual/cudart.git")
423427
set(CUDA_TAG cuda-12.5.1)
424428

425-
message(STATUS "Fetching CUDA ${CUDA_TAG} from ${CUDA_REPO} ...")
429+
message(STATUS "Fetching CUDA (${CUDA_TAG}) from ${CUDA_REPO} ...")
426430

427431
FetchContent_Declare(
428432
cuda-headers
429433
GIT_REPOSITORY ${CUDA_REPO}
430434
GIT_TAG ${CUDA_TAG}
431435
EXCLUDE_FROM_ALL)
436+
# Only populate the repo - we don't need to build it
432437
FetchContent_MakeAvailable(cuda-headers)
433438

434439
set(CUDA_INCLUDE_DIRS
@@ -685,16 +690,28 @@ else()
685690
)
686691
endif()
687692

688-
if((UMF_BUILD_GPU_TESTS OR UMF_BUILD_GPU_EXAMPLES) AND UMF_BUILD_CUDA_PROVIDER)
689-
find_package(CUDA REQUIRED cuda)
690-
if(CUDA_LIBRARIES)
691-
set(UMF_CUDA_ENABLED TRUE)
692-
else()
693-
message(
694-
STATUS "Disabling tests and examples that use the CUDA provider "
695-
"because the CUDA libraries they require were not found.")
693+
if(UMF_BUILD_GPU_TESTS OR UMF_BUILD_GPU_EXAMPLES)
694+
if(UMF_BUILD_CUDA_PROVIDER)
695+
find_package(CUDA REQUIRED cuda)
696+
if(CUDA_LIBRARIES)
697+
set(UMF_CUDA_ENABLED TRUE)
698+
else()
699+
message(
700+
STATUS "Disabling tests and examples that use the CUDA Provider "
701+
"because the CUDA libraries they require were not found.")
702+
endif()
703+
endif()
704+
705+
if(UMF_BUILD_LEVEL_ZERO_PROVIDER)
706+
find_package(LEVEL_ZERO REQUIRED level-zero)
707+
if(LEVEL_ZERO_LIBRARIES)
708+
set(UMF_LEVEL_ZERO_ENABLED TRUE)
709+
else()
710+
message(
711+
STATUS "Disabling tests and examples that use the Level Zero Provider "
712+
"because the Level Zero libraries they require were not found.")
713+
endif()
696714
endif()
697-
# TODO do the same for ze_loader
698715
endif()
699716

700717
add_subdirectory(src)

0 commit comments

Comments
 (0)