Skip to content

Commit 87df14c

Browse files
Merge pull request #1277 from lukaszstolarczuk/merge-fixes-for-v0.11.0
Merge fixes for v0.11.0
2 parents 74df40b + 9ce2e8d commit 87df14c

13 files changed

+254
-52
lines changed

.github/workflows/nightly.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212

1313
env:
1414
BUILD_DIR : "${{github.workspace}}/build"
15+
INSTALL_DIR: "${{github.workspace}}/build/install"
1516

1617
jobs:
1718
fuzz-test:
@@ -95,14 +96,14 @@ jobs:
9596
name: Windows ${{matrix.generator}} generator
9697
strategy:
9798
matrix:
98-
os: ['windows-2019', 'windows-2022']
99-
build_type: [Release]
99+
build_type: [Debug, Release]
100100
compiler: [{c: cl, cxx: cl}]
101101
shared_library: ['ON', 'OFF']
102102
static_hwloc: ['ON', 'OFF']
103103
generator: ['Ninja', 'NMake Makefiles']
104+
umfd_lib: ['ON', 'OFF']
104105

105-
runs-on: ${{matrix.os}}
106+
runs-on: windows-latest
106107

107108
steps:
108109
- name: Checkout
@@ -112,23 +113,23 @@ jobs:
112113

113114
- name: Set VCPKG_PATH with hwloc
114115
if: matrix.static_hwloc == 'OFF'
115-
run: echo "VCPKG_PATH='${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows'" >> $env:GITHUB_ENV
116+
run: echo "VCPKG_PATH=${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows" >> $env:GITHUB_ENV
116117

117118
- name: Set VCPKG_PATH without hwloc
118119
if: matrix.static_hwloc == 'ON'
119-
run: echo "VCPKG_PATH='${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows'" >> $env:GITHUB_ENV
120+
run: echo "VCPKG_PATH=${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows" >> $env:GITHUB_ENV
120121

121122
- name: Initialize vcpkg
122123
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
123124
env:
124125
VCPKG_PATH: ${{env.VCPKG_PATH}}
125126
with:
126-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
127+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
127128
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
128129
vcpkgJsonGlob: '**/vcpkg.json'
129130

130131
- name: Install dependencies
131-
run: vcpkg install
132+
run: vcpkg install --triplet x64-windows
132133

133134
- name: Install Ninja
134135
if: matrix.generator == 'Ninja'
@@ -141,6 +142,7 @@ jobs:
141142
run: >
142143
cmake
143144
-B ${{env.BUILD_DIR}}
145+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
144146
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
145147
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
146148
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
@@ -153,6 +155,7 @@ jobs:
153155
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
154156
-DUMF_BUILD_CUDA_PROVIDER=ON
155157
-DUMF_TESTS_FAIL_ON_SKIP=ON
158+
${{ matrix.umfd_lib == 'ON' && '-DUMF_USE_DEBUG_POSTFIX=ON' || '' }}
156159
157160
- name: Build UMF
158161
shell: cmd
@@ -163,6 +166,25 @@ jobs:
163166
working-directory: ${{env.BUILD_DIR}}
164167
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
165168

169+
- name: Get UMF version
170+
run: |
171+
$version = (git describe --tags --abbrev=0 | Select-String -Pattern '\d+\.\d+\.\d+').Matches.Value
172+
echo "UMF_VERSION=$version" >> $env:GITHUB_ENV
173+
shell: pwsh
174+
175+
- name: Test UMF installation and uninstallation
176+
# The '--shared-library' parameter is added to the installation test when the UMF is built as a shared library
177+
# The '--umfd-lib' parameter is added when the UMF is built with the umfd library
178+
run: >
179+
python3 ${{github.workspace}}/test/test_installation.py
180+
--build-dir ${{env.BUILD_DIR}}
181+
--install-dir ${{env.INSTALL_DIR}}
182+
--build-type ${{matrix.build_type}}
183+
--umf-version ${{env.UMF_VERSION}}
184+
${{ matrix.shared_library == 'ON' && '--proxy --shared-library' || '' }}
185+
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}
186+
${{ matrix.static_hwloc == 'ON' && '--hwloc' || '' }}
187+
166188
icx:
167189
name: ICX
168190
env:
@@ -190,12 +212,12 @@ jobs:
190212
- name: Initialize vcpkg
191213
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
192214
with:
193-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
215+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
194216
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
195217
vcpkgJsonGlob: '**/vcpkg.json'
196218

197219
- name: Install dependencies
198-
run: vcpkg install
220+
run: vcpkg install --triplet x64-windows
199221

200222
- name: Install Ninja
201223
uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5

.github/workflows/reusable_basic.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ jobs:
241241
shared_library: 'ON'
242242
level_zero_provider: 'ON'
243243
cuda_provider: 'ON'
244+
umfd_lib: 'ON'
244245
- os: 'windows-2022'
245246
build_type: Release
246247
compiler: {c: cl, cxx: cl}
@@ -259,12 +260,12 @@ jobs:
259260
- name: Initialize vcpkg
260261
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
261262
with:
262-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
263+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
263264
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
264265
vcpkgJsonGlob: '**/vcpkg.json'
265266

266267
- name: Install dependencies
267-
run: vcpkg install
268+
run: vcpkg install --triplet x64-windows
268269
shell: pwsh # Specifies PowerShell as the shell for running the script.
269270

270271
- name: Get UMF version
@@ -289,6 +290,7 @@ jobs:
289290
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
290291
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
291292
-DUMF_TESTS_FAIL_ON_SKIP=ON
293+
-DUMF_USE_DEBUG_POSTFIX=${{matrix.umfd_lib}}
292294
293295
- name: Build UMF
294296
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
@@ -307,6 +309,7 @@ jobs:
307309
${{matrix.shared_library == 'ON' && '--proxy' || '' }}
308310
--umf-version ${{env.UMF_VERSION}}
309311
${{ matrix.shared_library == 'ON' && '--shared-library' || ''}}
312+
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}
310313
311314
- name: check /DEPENDENTLOADFLAG in umf.dll
312315
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}

.github/workflows/reusable_codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ jobs:
4848
if: matrix.os == 'windows-latest'
4949
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
5050
with:
51-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
51+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
5252
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
5353
vcpkgJsonGlob: '**/vcpkg.json'
5454

5555
- name: "[Win] Install dependencies"
5656
if: matrix.os == 'windows-latest'
5757
run: |
58-
vcpkg install
58+
vcpkg install --triplet x64-windows
5959
python3 -m pip install -r third_party/requirements.txt
6060
6161
- name: "[Lin] Install apt packages"

.github/workflows/reusable_compatibility.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ jobs:
118118
- name: Initialize vcpkg
119119
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
120120
with:
121-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
121+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
122122
vcpkgDirectory: ${{github.workspace}}/vcpkg
123123
vcpkgJsonGlob: '**/vcpkg.json'
124124

125125
# NOTE we use vcpkg setup from "tag" version
126126
- name: Install dependencies
127127
working-directory: ${{github.workspace}}/tag_version
128-
run: vcpkg install
128+
run: vcpkg install --triplet x64-windows
129129
shell: pwsh # Specifies PowerShell as the shell for running the script.
130130

131131
- name: Configure "tag" UMF build

.github/workflows/reusable_fast.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ jobs:
6060
if: matrix.os == 'windows-latest'
6161
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
6262
with:
63-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
63+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
6464
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
6565
vcpkgJsonGlob: '**/vcpkg.json'
6666

6767
- name: Install dependencies (windows-latest)
6868
if: matrix.os == 'windows-latest'
69-
run: vcpkg install
69+
run: vcpkg install --triplet x64-windows
7070
shell: pwsh # Specifies PowerShell as the shell for running the script.
7171

7272
- name: Install dependencies

.github/workflows/reusable_gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ jobs:
6868
if: matrix.os == 'Windows'
6969
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
7070
with:
71-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
71+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
7272
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
7373
vcpkgJsonGlob: '**/vcpkg.json'
7474

7575
- name: "[Win] Install dependencies"
7676
if: matrix.os == 'Windows'
77-
run: vcpkg install
77+
run: vcpkg install --triplet x64-windows
7878

7979
# note: disable all providers except the one being tested
8080
# '-DCMAKE_SUPPRESS_REGENERATION=ON' is the WA for the error: "CUSTOMBUILD : CMake error : Cannot restore timestamp"

.github/workflows/reusable_sanitizers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ jobs:
106106
- name: Initialize vcpkg
107107
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
108108
with:
109-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
109+
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
110110
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
111111
vcpkgJsonGlob: '**/vcpkg.json'
112112

113113
- name: Install dependencies
114-
run: vcpkg install
114+
run: vcpkg install --triplet x64-windows
115115
shell: pwsh # Specifies PowerShell as the shell for running the script.
116116

117117
# TODO enable level zero provider

CMakeLists.txt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ macro(umf_option)
5858
option(${ARGV})
5959
endmacro()
6060

61+
# All CMake options have to be explicitly set in the build_umfd target's
62+
# configuration command
6163
umf_option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
6264
umf_option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON)
6365
umf_option(UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON)
@@ -89,6 +91,8 @@ set(UMF_INSTALL_RPATH
8991
"Set the runtime search path to the directory with dependencies (e.g. hwloc)"
9092
)
9193

94+
umf_option(UMF_USE_DEBUG_POSTFIX "Add a 'd' postfix to Windows debug libraries"
95+
OFF)
9296
umf_option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF)
9397
umf_option(
9498
UMF_FORMAT_CODE_STYLE
@@ -146,6 +150,8 @@ if(UMF_DEVELOPER_MODE)
146150
UMF_DEVELOPER_MODE=1)
147151
endif()
148152

153+
message(STATUS "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}")
154+
149155
if(NOT UMF_BUILD_LIBUMF_POOL_JEMALLOC)
150156
set(UMF_POOL_JEMALLOC_ENABLED FALSE)
151157
set(JEMALLOC_FOUND FALSE)
@@ -291,6 +297,7 @@ else()
291297
set(HWLOC_ENABLE_TESTING OFF)
292298
set(HWLOC_SKIP_LSTOPO ON)
293299
set(HWLOC_SKIP_TOOLS ON)
300+
set(HWLOC_SKIP_INCLUDES ON)
294301

295302
FetchContent_Declare(
296303
hwloc_targ
@@ -434,6 +441,74 @@ elseif(UMF_BUILD_CUDA_PROVIDER)
434441
message(STATUS "CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}")
435442
endif()
436443

444+
# Build the umfd target in a separate directory with Debug configuration
445+
if(WINDOWS AND UMF_USE_DEBUG_POSTFIX)
446+
# The build_umfd target's configuration command requires to have
447+
# CMAKE_PREFIX_PATH with semicolons escaped
448+
string(JOIN "\;" UMFD_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
449+
add_custom_target(
450+
build_umfd ALL
451+
COMMAND
452+
${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S ${UMF_CMAKE_SOURCE_DIR}
453+
-B ${CMAKE_BINARY_DIR}/umfd_build -DCMAKE_BUILD_TYPE=Debug
454+
-DCMAKE_DEBUG_POSTFIX=d
455+
-DCMAKE_PREFIX_PATH="${UMFD_CMAKE_PREFIX_PATH}"
456+
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
457+
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
458+
-DUMF_USE_DEBUG_POSTFIX=OFF
459+
-DUMF_BUILD_SHARED_LIBRARY=${UMF_BUILD_SHARED_LIBRARY}
460+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${UMF_BUILD_LEVEL_ZERO_PROVIDER}
461+
-DUMF_BUILD_CUDA_PROVIDER=${UMF_BUILD_CUDA_PROVIDER}
462+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=${UMF_BUILD_LIBUMF_POOL_JEMALLOC}
463+
-DUMF_BUILD_TESTS=OFF -DUMF_BUILD_GPU_TESTS=OFF
464+
-DUMF_BUILD_BENCHMARKS=OFF -DUMF_BUILD_BENCHMARKS_MT=OFF
465+
-DUMF_BUILD_EXAMPLES=OFF -DUMF_BUILD_GPU_EXAMPLES=OFF
466+
-DUMF_BUILD_FUZZTESTS=OFF -DUMF_DISABLE_HWLOC=${UMF_DISABLE_HWLOC}
467+
-DUMF_LINK_HWLOC_STATICALLY=${UMF_LINK_HWLOC_STATICALLY}
468+
-DUMF_HWLOC_NAME=${UMF_HWLOC_NAME}
469+
-DUMF_INSTALL_RPATH=${UMF_INSTALL_RPATH} -DUMF_DEVELOPER_MODE=OFF
470+
-DUMF_FORMAT_CODE_STYLE=OFF -DUMF_TESTS_FAIL_ON_SKIP=OFF
471+
-DUMF_USE_ASAN=OFF -DUMF_USE_UBSAN=OFF -DUMF_USE_TSAN=OFF
472+
-DUMF_USE_MSAN=OFF -DUMF_USE_VALGRIND=OFF -DUMF_USE_COVERAGE=OFF
473+
-DUMF_PROXY_LIB_BASED_ON_POOL=${UMF_PROXY_LIB_BASED_ON_POOL}
474+
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/umfd_build --target
475+
umf --config Debug
476+
COMMENT
477+
"Configuring and building umfd.dll in a separate directory with Debug configuration"
478+
)
479+
480+
# Copy built UMF libraries to the main binary directory and remove
481+
# umfd_build
482+
if(CMAKE_CONFIGURATION_TYPES)
483+
# Multi-config generator (e.g., Visual Studio)
484+
set(UMFD_DLL_SRC "${CMAKE_BINARY_DIR}/umfd_build/bin/Debug/umfd.dll")
485+
set(UMFD_LIB_SRC "${CMAKE_BINARY_DIR}/umfd_build/lib/Debug/umfd.lib")
486+
set(UMFD_DLL "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/umfd.dll")
487+
set(UMFD_LIB "${CMAKE_BINARY_DIR}/lib/$<CONFIG>/umfd.lib")
488+
else()
489+
# Single-config generator (e.g., Ninja)
490+
set(UMFD_DLL_SRC "${CMAKE_BINARY_DIR}/umfd_build/bin/umfd.dll")
491+
set(UMFD_LIB_SRC "${CMAKE_BINARY_DIR}/umfd_build/lib/umfd.lib")
492+
set(UMFD_DLL "${CMAKE_BINARY_DIR}/bin/umfd.dll")
493+
set(UMFD_LIB "${CMAKE_BINARY_DIR}/lib/umfd.lib")
494+
endif()
495+
496+
if(UMF_BUILD_SHARED_LIBRARY)
497+
add_custom_command(
498+
TARGET build_umfd
499+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${UMFD_DLL_SRC}
500+
${UMFD_DLL}
501+
COMMENT "Copying umfd.dll to the main binary directory")
502+
endif()
503+
add_custom_command(
504+
TARGET build_umfd
505+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${UMFD_LIB_SRC}
506+
${UMFD_LIB}
507+
COMMAND ${CMAKE_COMMAND} -E remove_directory
508+
${CMAKE_BINARY_DIR}/umfd_build DEPENDS ${UMFD_DLL}
509+
COMMENT "Copying umfd.lib to the main library directory")
510+
endif()
511+
437512
# This build type check is not possible on Windows when CMAKE_BUILD_TYPE is not
438513
# set, because in this case the build type is determined after a CMake
439514
# configuration is done (at the build time)
@@ -826,6 +901,20 @@ endif()
826901
# --------------------------------------------------------------------------- #
827902
# Configure make install/uninstall and packages
828903
# --------------------------------------------------------------------------- #
904+
# Install the umfd library files as part of the umfd component
905+
if(WINDOWS AND UMF_USE_DEBUG_POSTFIX)
906+
if(UMF_BUILD_SHARED_LIBRARY)
907+
install(
908+
FILES ${UMFD_DLL}
909+
DESTINATION ${CMAKE_INSTALL_BINDIR}
910+
COMPONENT umfd)
911+
endif()
912+
install(
913+
FILES ${UMFD_LIB}
914+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
915+
COMPONENT umfd)
916+
endif()
917+
829918
install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.TXT
830919
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}/")
831920
install(

0 commit comments

Comments
 (0)