Skip to content

Commit c480959

Browse files
committed
Change linking to static for ICX Intel libraries
1 parent ac66827 commit c480959

File tree

5 files changed

+171
-9
lines changed

5 files changed

+171
-9
lines changed

.github/workflows/pr_push.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,75 @@ permissions:
1616
contents: read
1717

1818
jobs:
19+
CodeChecks:
20+
uses: ./.github/workflows/reusable_checks.yml
21+
DocsBuild:
22+
uses: ./.github/workflows/reusable_docs_build.yml
23+
FastBuild:
24+
name: Fast builds
25+
needs: [CodeChecks, DocsBuild]
26+
uses: ./.github/workflows/reusable_fast.yml
1927
Build:
2028
name: Basic builds
29+
needs: [FastBuild]
2130
uses: ./.github/workflows/reusable_basic.yml
31+
DevDax:
32+
needs: [FastBuild]
33+
uses: ./.github/workflows/reusable_dax.yml
34+
MultiNuma:
35+
needs: [FastBuild]
36+
uses: ./.github/workflows/reusable_multi_numa.yml
37+
L0:
38+
needs: [Build]
39+
uses: ./.github/workflows/reusable_gpu.yml
40+
with:
41+
name: "LEVEL_ZERO"
42+
shared_lib: "['ON']"
43+
CUDA:
44+
needs: [Build]
45+
uses: ./.github/workflows/reusable_gpu.yml
46+
with:
47+
name: "CUDA"
48+
shared_lib: "['ON']"
49+
Sanitizers:
50+
needs: [FastBuild]
51+
uses: ./.github/workflows/reusable_sanitizers.yml
52+
QEMU:
53+
needs: [FastBuild]
54+
uses: ./.github/workflows/reusable_qemu.yml
55+
with:
56+
short_run: true
57+
Benchmarks:
58+
needs: [Build]
59+
uses: ./.github/workflows/reusable_benchmarks.yml
60+
ProxyLib:
61+
needs: [Build]
62+
uses: ./.github/workflows/reusable_proxy_lib.yml
63+
Valgrind:
64+
needs: [Build]
65+
uses: ./.github/workflows/reusable_valgrind.yml
66+
Coverage:
67+
# total coverage (on upstream only)
68+
if: github.repository == 'oneapi-src/unified-memory-framework'
69+
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
70+
uses: ./.github/workflows/reusable_coverage.yml
71+
secrets: inherit
72+
with:
73+
trigger: "${{github.event_name}}"
74+
Coverage_partial:
75+
# partial coverage (on forks)
76+
if: github.repository != 'oneapi-src/unified-memory-framework'
77+
needs: [Build, QEMU, ProxyLib]
78+
uses: ./.github/workflows/reusable_coverage.yml
79+
CodeQL:
80+
needs: [Build]
81+
permissions:
82+
contents: read
83+
security-events: write
84+
uses: ./.github/workflows/reusable_codeql.yml
85+
Trivy:
86+
needs: [Build]
87+
permissions:
88+
contents: read
89+
security-events: write
90+
uses: ./.github/workflows/reusable_trivy.yml

.github/workflows/reusable_basic.yml

Lines changed: 89 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,101 @@ jobs:
1616
ubuntu-build:
1717
name: Ubuntu
1818
strategy:
19-
fail-fast: false
2019
matrix:
2120
os: ['ubuntu-20.04', 'ubuntu-22.04']
2221
build_type: [Debug, Release]
23-
shared_library: ['ON']
22+
compiler: [{c: gcc, cxx: g++}]
23+
shared_library: ['OFF']
2424
level_zero_provider: ['ON']
2525
cuda_provider: ['ON']
2626
install_tbb: ['ON']
2727
disable_hwloc: ['OFF']
2828
link_hwloc_statically: ['OFF']
29-
compiler: [{c: icx, cxx: icpx}]
29+
include:
30+
- os: 'ubuntu-20.04'
31+
build_type: Release
32+
compiler: {c: gcc-7, cxx: g++-7}
33+
shared_library: 'OFF'
34+
level_zero_provider: 'ON'
35+
cuda_provider: 'ON'
36+
install_tbb: 'ON'
37+
disable_hwloc: 'OFF'
38+
link_hwloc_statically: 'OFF'
39+
- os: 'ubuntu-22.04'
40+
build_type: Release
41+
compiler: {c: clang, cxx: clang++}
42+
shared_library: 'OFF'
43+
level_zero_provider: 'ON'
44+
cuda_provider: 'ON'
45+
install_tbb: 'ON'
46+
disable_hwloc: 'OFF'
47+
link_hwloc_statically: 'OFF'
48+
- os: 'ubuntu-22.04'
49+
build_type: Release
50+
compiler: {c: gcc, cxx: g++}
51+
shared_library: 'ON'
52+
level_zero_provider: 'ON'
53+
cuda_provider: 'ON'
54+
install_tbb: 'ON'
55+
disable_hwloc: 'OFF'
56+
link_hwloc_statically: 'OFF'
57+
- os: 'ubuntu-24.04'
58+
build_type: Debug
59+
compiler: {c: gcc, cxx: g++}
60+
shared_library: 'ON'
61+
level_zero_provider: 'ON'
62+
cuda_provider: 'ON'
63+
install_tbb: 'ON'
64+
disable_hwloc: 'OFF'
65+
link_hwloc_statically: 'OFF'
66+
# test level_zero_provider='OFF' and cuda_provider='OFF'
67+
- os: 'ubuntu-22.04'
68+
build_type: Release
69+
compiler: {c: gcc, cxx: g++}
70+
shared_library: 'OFF'
71+
level_zero_provider: 'OFF'
72+
cuda_provider: 'OFF'
73+
install_tbb: 'ON'
74+
disable_hwloc: 'OFF'
75+
link_hwloc_statically: 'OFF'
76+
# test icx compiler
77+
- os: 'ubuntu-22.04'
78+
build_type: Release
79+
compiler: {c: icx, cxx: icpx}
80+
shared_library: 'ON'
81+
level_zero_provider: 'ON'
82+
cuda_provider: 'ON'
83+
install_tbb: 'ON'
84+
disable_hwloc: 'OFF'
85+
link_hwloc_statically: 'OFF'
86+
# test without installing TBB
87+
- os: 'ubuntu-22.04'
88+
build_type: Release
89+
compiler: {c: gcc, cxx: g++}
90+
shared_library: 'ON'
91+
level_zero_provider: 'ON'
92+
cuda_provider: 'ON'
93+
install_tbb: 'OFF'
94+
disable_hwloc: 'OFF'
95+
link_hwloc_statically: 'OFF'
96+
- os: 'ubuntu-22.04'
97+
build_type: Debug
98+
compiler: {c: gcc, cxx: g++}
99+
shared_library: 'ON'
100+
level_zero_provider: 'ON'
101+
cuda_provider: 'ON'
102+
install_tbb: 'ON'
103+
disable_hwloc: 'ON'
104+
link_hwloc_statically: 'OFF'
105+
- os: 'ubuntu-22.04'
106+
build_type: Release
107+
compiler: {c: gcc, cxx: g++}
108+
shared_library: 'ON'
109+
level_zero_provider: 'ON'
110+
cuda_provider: 'ON'
111+
install_tbb: 'ON'
112+
disable_hwloc: 'OFF'
113+
link_hwloc_statically: 'ON'
30114
runs-on: ${{matrix.os}}
31115

32116
steps:
@@ -53,7 +137,7 @@ jobs:
53137
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
54138
sudo apt-get update
55139
sudo apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp
56-
140+
57141
- name: Install g++-7
58142
if: matrix.compiler.cxx == 'g++-7'
59143
run: sudo apt-get install -y ${{matrix.compiler.cxx}}
@@ -88,19 +172,17 @@ jobs:
88172
-DUMF_TESTS_FAIL_ON_SKIP=ON
89173
-DUMF_DISABLE_HWLOC=${{matrix.disable_hwloc}}
90174
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}}
91-
-DUMF_INSTALL_RPATH=${{env.BUILD_DIR}}/lib
92175
${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' && '-DUMF_USE_COVERAGE=ON' || '' }}
93176
94177
- name: Build UMF
95178
run: |
96179
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
97180
cmake --build ${{env.BUILD_DIR}} -j $(nproc)
98181
99-
# ${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
100182
- name: Run tests
101183
working-directory: ${{env.BUILD_DIR}}
102184
run: |
103-
ctest --output-on-failure # run all tests for better coverage
185+
LD_LIBRARY_PATH=${{env.BUILD_DIR}}/lib/ ctest --output-on-failure # run all tests for better coverage
104186
105187
- name: Check coverage
106188
if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}

.github/workflows/reusable_sanitizers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ jobs:
7777
ASAN_OPTIONS: allocator_may_return_null=1
7878
TSAN_OPTIONS: allocator_may_return_null=1
7979
run: |
80-
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
8180
ctest --output-on-failure
8281
8382
windows-build:

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ include(CMakePackageConfigHelpers)
3333
include(GNUInstallDirs)
3434
find_package(PkgConfig)
3535

36+
if(CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
37+
# Compiler dependencies needs to be in library path or to be linked
38+
# statically
39+
add_link_options(-static-intel)
40+
endif()
41+
3642
# Build Options
3743
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
3844
option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON)

test/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED YES)
77

8+
if(CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
9+
# Compiler dependencies needs to be in library path or to be linked
10+
# statically
11+
add_link_options(-static-intel)
12+
endif()
13+
814
include(FetchContent)
915
FetchContent_Declare(
1016
googletest
@@ -39,7 +45,7 @@ function(build_umf_test)
3945
set(TEST_NAME umf-${ARG_NAME})
4046
set(TEST_TARGET_NAME umf_test-${ARG_NAME})
4147

42-
set(LIB_DIRS ${LIB_DIRS} ${CMAKE_BINARY_DIR}/lib ${LIBHWLOC_LIBRARY_DIRS})
48+
set(LIB_DIRS ${LIB_DIRS} ${LIBHWLOC_LIBRARY_DIRS})
4349

4450
if(UMF_BUILD_CUDA_PROVIDER)
4551
set(INC_DIRS ${INC_DIRS} ${CUDA_INCLUDE_DIRS})

0 commit comments

Comments
 (0)