Skip to content

.github/workflows/windows.yml: use static msvc rt #14

.github/workflows/windows.yml: use static msvc rt

.github/workflows/windows.yml: use static msvc rt #14

Workflow file for this run

name: Build (Windows)
on:
push:
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-2022
defaults:
run:
shell: cmd
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Create depend folder
run: mkdir depend
- name: Setup ROCm CMake modules
run: |
cd depend
git clone https://github.com/ROCm/rocm-cmake --depth 1
cd rocm-cmake
cmake -S . -B build
cmake --install build --prefix ../install
- name: Setup Half library
run: |
cd depend
git clone https://github.com/ROCm/half --depth 1
cd half
cmake -S . -B build -D CMAKE_PREFIX_PATH="%cd%/../install"
cmake --install build --prefix ../install
- name: Setup json library
run: |
cd depend
git clone https://github.com/nlohmann/json
cd json
:: follows https://github.com/AmusementClub/AMDMIGraphX/blob/develop/requirements.txt
git checkout v3.8.0
cmake -S . -B build -D BUILD_TESTING=OFF -Wno-dev
cmake --install build --prefix ../install
- name: Setup SQLite3 library
run: vcpkg install sqlite3[core]:x64-windows-static
- name: Setup MessagePack library
run: |
cd depend
git clone https://github.com/msgpack/msgpack-c
cd msgpack-c
:: follows https://github.com/AmusementClub/AMDMIGraphX/blob/develop/requirements.txt
git checkout cpp-3.3.0
:: patch for cmake msvc rt flag
python -c "f=open('CMakeLists.txt');lines=f.readlines();lines[0]='cmake_minimum_required(VERSION 3.15)\n';f.close();f=open('CMakeLists.txt','w');f.writelines(lines);f.close()"
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D MSGPACK_BUILD_TESTS=OFF -D MSGPACK_BUILD_EXAMPLES=OFF -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -Wno-dev
cmake --build build --verbose
cmake --install build --prefix ../install
xcopy include\ ..\install\include\ /s /f /y
- name: Setup Protobuf library
run: |
cd depend
git clone https://github.com/google/protobuf
cd protobuf
:: follows onnx's recommended version
git checkout v3.21.12
cmake -S . -B build_rel -G Ninja -D CMAKE_BUILD_TYPE=Release -D protobuf_BUILD_TESTS=OFF -D protobuf_MSVC_STATIC_RUNTIME=ON -Wno-dev
cmake --build build_rel --verbose
cmake --install build_rel --prefix ../install
- name: Setup rocMLIR library
run: |
cd depend
git clone https://github.com/ROCm/rocMLIR
cd rocMLIR
:: follows https://github.com/AmusementClub/AMDMIGraphX/blob/develop/requirements.txt
git checkout 8f51edbff77499fbd4d14e38b3efda1d210f6f6e
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_PREFIX_PATH="%cd%/../install" -D BUILD_FAT_LIBROCKCOMPILER=ON -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -Wno-dev
cmake --build build
cmake --install build --prefix ../install
- name: Cache HIP SDK
id: cache-hip
uses: actions/cache@v4
with:
path: C:\Program Files\AMD\ROCM
key: ${{ runner.os }}-rocm-6.1.2
- name: Setup HIP
if: steps.cache-hip.outputs.cache-hit != 'true'
shell: pwsh
run: |
curl -s -o hip_installer.exe -L https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe
Start-Process hip_installer.exe -ArgumentList '-install' -NoNewWindow -Wait
- name: Setup MIGraphX
run: cmake -S . -B build -G Ninja -LA -Wno-dev
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_C_COMPILER="C:/Program Files/AMD/ROCm/6.1/bin/clang.exe"
-D CMAKE_CXX_COMPILER="C:/Program Files/AMD/ROCm/6.1/bin/clang++.exe"
-D CMAKE_PREFIX_PATH="%cd%/depend/install;C:/vcpkg/packages/sqlite3_x64-windows-static"
-D BUILD_TESTING=OFF
-D HIP_DIR="C:/Program Files/AMD/ROCm/6.1/lib/cmake/hip"
-D HIP_PLATFORM=amd
-D GPU_TARGETS="gfx1030;gfx1100;gfx1101;gfx1102"
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- name: Build MIGraphX
run: cmake --build build --verbose
- name: Install MIGraphX
run: cmake --install build --prefix migraphx-windows
- name: Show
run: ls -R migraphx-windows
- name: Upload
uses: actions/upload-artifact@v4
with:
name: migraphx-windows
retention-days: 1
path: migraphx-windows