Skip to content

Merge fixes for v0.11.0 #1277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:

env:
BUILD_DIR : "${{github.workspace}}/build"
INSTALL_DIR: "${{github.workspace}}/build/install"

jobs:
fuzz-test:
Expand Down Expand Up @@ -95,14 +96,14 @@ jobs:
name: Windows ${{matrix.generator}} generator
strategy:
matrix:
os: ['windows-2019', 'windows-2022']
build_type: [Release]
build_type: [Debug, Release]
compiler: [{c: cl, cxx: cl}]
shared_library: ['ON', 'OFF']
static_hwloc: ['ON', 'OFF']
generator: ['Ninja', 'NMake Makefiles']
umfd_lib: ['ON', 'OFF']

runs-on: ${{matrix.os}}
runs-on: windows-latest

steps:
- name: Checkout
Expand All @@ -112,23 +113,23 @@ jobs:

- name: Set VCPKG_PATH with hwloc
if: matrix.static_hwloc == 'OFF'
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
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

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

- name: Initialize vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
env:
VCPKG_PATH: ${{env.VCPKG_PATH}}
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

- name: Install dependencies
run: vcpkg install
run: vcpkg install --triplet x64-windows

- name: Install Ninja
if: matrix.generator == 'Ninja'
Expand All @@ -141,6 +142,7 @@ jobs:
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
Expand All @@ -153,6 +155,7 @@ jobs:
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.umfd_lib == 'ON' && '-DUMF_USE_DEBUG_POSTFIX=ON' || '' }}

- name: Build UMF
shell: cmd
Expand All @@ -163,6 +166,25 @@ jobs:
working-directory: ${{env.BUILD_DIR}}
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test

- name: Get UMF version
run: |
$version = (git describe --tags --abbrev=0 | Select-String -Pattern '\d+\.\d+\.\d+').Matches.Value
echo "UMF_VERSION=$version" >> $env:GITHUB_ENV
shell: pwsh

- name: Test UMF installation and uninstallation
# The '--shared-library' parameter is added to the installation test when the UMF is built as a shared library
# The '--umfd-lib' parameter is added when the UMF is built with the umfd library
run: >
python3 ${{github.workspace}}/test/test_installation.py
--build-dir ${{env.BUILD_DIR}}
--install-dir ${{env.INSTALL_DIR}}
--build-type ${{matrix.build_type}}
--umf-version ${{env.UMF_VERSION}}
${{ matrix.shared_library == 'ON' && '--proxy --shared-library' || '' }}
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}
${{ matrix.static_hwloc == 'ON' && '--hwloc' || '' }}

icx:
name: ICX
env:
Expand Down Expand Up @@ -190,12 +212,12 @@ jobs:
- name: Initialize vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

- name: Install dependencies
run: vcpkg install
run: vcpkg install --triplet x64-windows

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/reusable_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ jobs:
shared_library: 'ON'
level_zero_provider: 'ON'
cuda_provider: 'ON'
umfd_lib: 'ON'
- os: 'windows-2022'
build_type: Release
compiler: {c: cl, cxx: cl}
Expand All @@ -259,12 +260,12 @@ jobs:
- name: Initialize vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

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

- name: Get UMF version
Expand All @@ -289,6 +290,7 @@ jobs:
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.level_zero_provider}}
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.cuda_provider}}
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_USE_DEBUG_POSTFIX=${{matrix.umfd_lib}}

- name: Build UMF
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
Expand All @@ -307,6 +309,7 @@ jobs:
${{matrix.shared_library == 'ON' && '--proxy' || '' }}
--umf-version ${{env.UMF_VERSION}}
${{ matrix.shared_library == 'ON' && '--shared-library' || ''}}
${{ matrix.umfd_lib == 'ON' && '--umfd-lib' || ''}}

- name: check /DEPENDENTLOADFLAG in umf.dll
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ jobs:
if: matrix.os == 'windows-latest'
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

- name: "[Win] Install dependencies"
if: matrix.os == 'windows-latest'
run: |
vcpkg install
vcpkg install --triplet x64-windows
python3 -m pip install -r third_party/requirements.txt

- name: "[Lin] Install apt packages"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ jobs:
- name: Initialize vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{github.workspace}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

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

- name: Configure "tag" UMF build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ jobs:
if: matrix.os == 'windows-latest'
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

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

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ jobs:
if: matrix.os == 'Windows'
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

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

# note: disable all providers except the one being tested
# '-DCMAKE_SUPPRESS_REGENERATION=ON' is the WA for the error: "CUSTOMBUILD : CMake error : Cannot restore timestamp"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ jobs:
- name: Initialize vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'

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

# TODO enable level zero provider
Expand Down
89 changes: 89 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ macro(umf_option)
option(${ARGV})
endmacro()

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

umf_option(UMF_USE_DEBUG_POSTFIX "Add a 'd' postfix to Windows debug libraries"
OFF)
umf_option(UMF_DEVELOPER_MODE "Enable additional developer checks" OFF)
umf_option(
UMF_FORMAT_CODE_STYLE
Expand Down Expand Up @@ -146,6 +150,8 @@ if(UMF_DEVELOPER_MODE)
UMF_DEVELOPER_MODE=1)
endif()

message(STATUS "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}")

if(NOT UMF_BUILD_LIBUMF_POOL_JEMALLOC)
set(UMF_POOL_JEMALLOC_ENABLED FALSE)
set(JEMALLOC_FOUND FALSE)
Expand Down Expand Up @@ -291,6 +297,7 @@ else()
set(HWLOC_ENABLE_TESTING OFF)
set(HWLOC_SKIP_LSTOPO ON)
set(HWLOC_SKIP_TOOLS ON)
set(HWLOC_SKIP_INCLUDES ON)

FetchContent_Declare(
hwloc_targ
Expand Down Expand Up @@ -434,6 +441,74 @@ elseif(UMF_BUILD_CUDA_PROVIDER)
message(STATUS "CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}")
endif()

# Build the umfd target in a separate directory with Debug configuration
if(WINDOWS AND UMF_USE_DEBUG_POSTFIX)
# The build_umfd target's configuration command requires to have
# CMAKE_PREFIX_PATH with semicolons escaped
string(JOIN "\;" UMFD_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
add_custom_target(
build_umfd ALL
COMMAND
${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S ${UMF_CMAKE_SOURCE_DIR}
-B ${CMAKE_BINARY_DIR}/umfd_build -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_DEBUG_POSTFIX=d
-DCMAKE_PREFIX_PATH="${UMFD_CMAKE_PREFIX_PATH}"
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DUMF_USE_DEBUG_POSTFIX=OFF
-DUMF_BUILD_SHARED_LIBRARY=${UMF_BUILD_SHARED_LIBRARY}
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${UMF_BUILD_LEVEL_ZERO_PROVIDER}
-DUMF_BUILD_CUDA_PROVIDER=${UMF_BUILD_CUDA_PROVIDER}
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=${UMF_BUILD_LIBUMF_POOL_JEMALLOC}
-DUMF_BUILD_TESTS=OFF -DUMF_BUILD_GPU_TESTS=OFF
-DUMF_BUILD_BENCHMARKS=OFF -DUMF_BUILD_BENCHMARKS_MT=OFF
-DUMF_BUILD_EXAMPLES=OFF -DUMF_BUILD_GPU_EXAMPLES=OFF
-DUMF_BUILD_FUZZTESTS=OFF -DUMF_DISABLE_HWLOC=${UMF_DISABLE_HWLOC}
-DUMF_LINK_HWLOC_STATICALLY=${UMF_LINK_HWLOC_STATICALLY}
-DUMF_HWLOC_NAME=${UMF_HWLOC_NAME}
-DUMF_INSTALL_RPATH=${UMF_INSTALL_RPATH} -DUMF_DEVELOPER_MODE=OFF
-DUMF_FORMAT_CODE_STYLE=OFF -DUMF_TESTS_FAIL_ON_SKIP=OFF
-DUMF_USE_ASAN=OFF -DUMF_USE_UBSAN=OFF -DUMF_USE_TSAN=OFF
-DUMF_USE_MSAN=OFF -DUMF_USE_VALGRIND=OFF -DUMF_USE_COVERAGE=OFF
-DUMF_PROXY_LIB_BASED_ON_POOL=${UMF_PROXY_LIB_BASED_ON_POOL}
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/umfd_build --target
umf --config Debug
COMMENT
"Configuring and building umfd.dll in a separate directory with Debug configuration"
)

# Copy built UMF libraries to the main binary directory and remove
# umfd_build
if(CMAKE_CONFIGURATION_TYPES)
# Multi-config generator (e.g., Visual Studio)
set(UMFD_DLL_SRC "${CMAKE_BINARY_DIR}/umfd_build/bin/Debug/umfd.dll")
set(UMFD_LIB_SRC "${CMAKE_BINARY_DIR}/umfd_build/lib/Debug/umfd.lib")
set(UMFD_DLL "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/umfd.dll")
set(UMFD_LIB "${CMAKE_BINARY_DIR}/lib/$<CONFIG>/umfd.lib")
else()
# Single-config generator (e.g., Ninja)
set(UMFD_DLL_SRC "${CMAKE_BINARY_DIR}/umfd_build/bin/umfd.dll")
set(UMFD_LIB_SRC "${CMAKE_BINARY_DIR}/umfd_build/lib/umfd.lib")
set(UMFD_DLL "${CMAKE_BINARY_DIR}/bin/umfd.dll")
set(UMFD_LIB "${CMAKE_BINARY_DIR}/lib/umfd.lib")
endif()

if(UMF_BUILD_SHARED_LIBRARY)
add_custom_command(
TARGET build_umfd
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${UMFD_DLL_SRC}
${UMFD_DLL}
COMMENT "Copying umfd.dll to the main binary directory")
endif()
add_custom_command(
TARGET build_umfd
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${UMFD_LIB_SRC}
${UMFD_LIB}
COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_BINARY_DIR}/umfd_build DEPENDS ${UMFD_DLL}
COMMENT "Copying umfd.lib to the main library directory")
endif()

# This build type check is not possible on Windows when CMAKE_BUILD_TYPE is not
# set, because in this case the build type is determined after a CMake
# configuration is done (at the build time)
Expand Down Expand Up @@ -826,6 +901,20 @@ endif()
# --------------------------------------------------------------------------- #
# Configure make install/uninstall and packages
# --------------------------------------------------------------------------- #
# Install the umfd library files as part of the umfd component
if(WINDOWS AND UMF_USE_DEBUG_POSTFIX)
if(UMF_BUILD_SHARED_LIBRARY)
install(
FILES ${UMFD_DLL}
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT umfd)
endif()
install(
FILES ${UMFD_LIB}
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT umfd)
endif()

install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.TXT
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}/")
install(
Expand Down
Loading
Loading