From 1b4dd90d18d48477b24b16c8fd0e1cb653673fed Mon Sep 17 00:00:00 2001 From: "Kozlowski, Marek" Date: Thu, 12 Feb 2026 12:29:14 +0000 Subject: [PATCH] Update docs and dependencies to `MSVC 2022` --- BUILD.md | 62 +++++++++++++++++++- CMakeLists.txt | 8 +-- cmake/vs2019_missing_redist_workaround.cmake | 56 ------------------ utils/logging/CMakeLists.txt | 1 + 4 files changed, 63 insertions(+), 64 deletions(-) delete mode 100644 cmake/vs2019_missing_redist_workaround.cmake diff --git a/BUILD.md b/BUILD.md index e31456bea..54c3bf52d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -2,6 +2,63 @@ ## Dependencies +### Windows Dependencies +Requirements: MSVC 2022 + +```powershell +Invoke-WebRequest -Uri 'https://zlib.net/zlib131.zip' -OutFile 'C:\TEMP\zlib.zip'; +Expand-Archive C:\TEMP\zlib.zip -DestinationPath C:\TEMP; +Move-Item C:\TEMP\zlib-1.3.1 C:\TEMP\zlib; +Remove-Item C:\TEMP\zlib.zip; + +Invoke-WebRequest -UserAgent 'Wget' -Uri 'https://downloads.sourceforge.net/project/libpng/libpng16/1.6.47/lpng1647.zip' -OutFile 'C:\TEMP\libpng.zip'; +Expand-Archive C:\TEMP\libpng.zip -DestinationPath C:\TEMP; +Move-Item C:\TEMP\lpng1647 C:\TEMP\libpng; +Remove-Item C:\TEMP\libpng.zip + +Invoke-WebRequest -UserAgent "Wget" -Uri 'https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.zip' -OutFile 'C:\TEMP\Boost.zip' -UseBasicParsing; +Add-Type -AssemblyName System.IO.Compression.FileSystem; +[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\TEMP\Boost.zip', 'C:\TEMP'); +Move-Item C:\TEMP\boost_1_79_0 C:\TEMP\Boost; +Remove-Item C:\TEMP\Boost.zip; + +Invoke-WebRequest -Uri 'https://github.com/oneapi-src/level-zero/archive/refs/tags/v1.28.0.zip' -OutFile 'C:\TEMP\level-zero.zip'; ` +Expand-Archive C:\TEMP\level-zero.zip -DestinationPath C:\TEMP; ` +Move-Item C:\TEMP\level-zero-1.28.0 C:\TEMP\level-zero; ` +Remove-Item C:\TEMP\level-zero.zip; + +$WORKSPACE = "C:\LZT_Workspace" +mkdir $WORKSPACE + +cmake -B C:\TEMP\build\zlib\ -S C:\TEMP\zlib -A x64 -D BUILD_SHARED_LIBS=YES -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE\zlib +cmake --build C:\TEMP\build\zlib\ --config Release --target install +cmake -B C:\TEMP\build\libpng\ -S C:\TEMP\libpng -A x64 -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE\libpng -DCMAKE_PREFIX_PATH:PATH=$WORKSPACE\zlib +cmake --build C:\TEMP\build\libpng\ --config Release --target install +cmake -B C:\TEMP\build\level-zero\ -S C:\TEMP\level-zero -A x64 -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE\level-zero +cmake --build C:\TEMP\build\level-zero\ --config Release --target install + +cd C:\TEMP\Boost +.\bootstrap.bat vc143 +.\b2.exe install ` + --prefix=$WORKSPACE\Boost ` + -j 16 ` + address-model=64 ` + --with-chrono ` + --with-log ` + --with-program_options ` + --with-serialization ` + --with-system ` + --with-date_time ` + --with-timer + +cd $WORKSPACE\level-zero-tests +mkdir build +cd build +cmake .. -DCMAKE_PREFIX_PATH="$WORKSPACE\zlib;$WORKSPACE\libpng;$WORKSPACE\level-zero;$WORKSPACE\Boost" +cmake --build . --config Release --parallel + +``` + ### Linux Dependencies Requires the `level-zero`, `level-zero-devel`, `libpng-dev`, `libboost-all-dev`, `libva-dev` packages to be installed. @@ -12,10 +69,10 @@ On SLES distributions only: Requires the `level-zero`, `level-zero-devel`, `libpng16-devel`, `libva-devel` packages to be installed. -In addition to the above, the Boost C++ Library needs to be installed. Example below with Boost 1.70 (i.e. https://www.boost.org/users/history/version_1_70_0.html) +In addition to the above, the Boost C++ Library needs to be installed. Example below with Boost 1.79 (i.e. https://www.boost.org/users/history/version_1_79_0.html) ```bash -git clone --recurse-submodules --branch boost-1.70.0 https://github.com/boostorg/boost.git +git clone --recurse-submodules --branch boost-1.79.0 https://github.com/boostorg/boost.git cd boost ./bootstrap.sh ./b2 install \ @@ -26,6 +83,7 @@ cd boost --with-program_options \ --with-serialization \ --with-system \ + --with-date_time \ --with-timer ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 0545a4c0d..34d696686 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(clang_tools) include(custom_functions) -include(vs2019_missing_redist_workaround) find_package(PNG REQUIRED) find_package(Git) @@ -45,14 +44,11 @@ enable_testing() set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) -# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/20638 -set(_Boost_LOG_SETUP_DEPENDENCIES log) -set(_Boost_LOG_DEPENDENCIES "") if(BUILD_ZE_PERF_TESTS_ONLY) # do not require boost when building perf tests only, will skip tests that use boost - find_package(Boost 1.65 COMPONENTS log program_options timer chrono system serialization) + find_package(Boost 1.79 COMPONENTS log log_setup program_options timer chrono system serialization) else() - find_package(Boost 1.65 REQUIRED COMPONENTS log program_options timer chrono system serialization) + find_package(Boost 1.79 REQUIRED COMPONENTS log log_setup program_options timer chrono system serialization) endif() message(STATUS "Boost_FOUND: ${Boost_FOUND}") diff --git a/cmake/vs2019_missing_redist_workaround.cmake b/cmake/vs2019_missing_redist_workaround.cmake deleted file mode 100644 index 58f452545..000000000 --- a/cmake/vs2019_missing_redist_workaround.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# CMake - Cross Platform Makefile Generator -# Copyright 2000-2019 Kitware, Inc. and Contributors -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the name of Kitware, Inc. nor the names of Contributors -# may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Visual Studio 2019 (v16) includes an additional VC runtime DLL that the -# InstallRequiredSystemLibraries module included with Visual Studio cmake does -# not find, so we have to append it to CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS. - -# Based on code from CMake/Modules/InstallRequiredSystemLibraries.cmake - -if(MSVC) - if(MSVC_TOOLSET_VERSION EQUAL 142) # VS 2019 - set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION}) - cmake_host_system_information(RESULT _vs_dir QUERY VS_16_DIR) # undocumented query - if(IS_DIRECTORY "${_vs_dir}") - file(GLOB _vs_redist_paths "${_vs_dir}/VC/Redist/MSVC/*") - endif() - unset(_vs_dir) - if(CMAKE_CL_64) - set(CMAKE_MSVC_ARCH x64) - else() - set(CMAKE_MSVC_ARCH x86) - endif() - find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths}) - unset(_vs_redist_paths) - set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT") - list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "${MSVC_CRT_DIR}/vcruntime140_1.dll") - endif() -endif() diff --git a/utils/logging/CMakeLists.txt b/utils/logging/CMakeLists.txt index 7ad1e02fe..67a731a9a 100644 --- a/utils/logging/CMakeLists.txt +++ b/utils/logging/CMakeLists.txt @@ -9,6 +9,7 @@ add_core_library(logging target_link_libraries(logging PUBLIC Boost::log + Boost::log_setup Boost::program_options )