Skip to content

Generalized VMLP for arbitrary matrix sizes. #203

Generalized VMLP for arbitrary matrix sizes.

Generalized VMLP for arbitrary matrix sizes. #203

Workflow file for this run

name: Build using vcpkg
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, windows-2019, windows-2022, macos-latest ]
linking: [ dynamic, static ]
exclude:
# dynamic linking fails for SDL2_image and python3 compilation on macOS as of 2022-08-30.
- os: macos-latest
linking: dynamic
# Windows always worked without a problem with both dynamic and static linking, no need to test.
- os: windows-2019
linking: static
- os: windows-2022
linking: static
runs-on: ${{ matrix.os }}
name: "${{ github.workflow }}: ${{ matrix.os }} (${{ matrix.linking }})"
env:
VCPKG_ROOT: ${{ github.workspace }}/third_party/vcpkg
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/third_party/vcpkg/bincache
steps:
- name: Set up vcpkg environment variables
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo "VCPKG_COPY_TRIPLET=x64-linux" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_TRIPLET=x64-linux-${{matrix.linking}}-release-only" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "Windows" ]; then
echo "VCPKG_COPY_TRIPLET=x64-windows" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_TRIPLET=x64-windows-${{matrix.linking}}-release-only" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "macOS" ] && [ "$(uname -m)" = "x86_64" ]; then
echo "VCPKG_COPY_TRIPLET=x64-osx" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_TRIPLET=x64-osx-${{matrix.linking}}-release-only" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "VCPKG_COPY_TRIPLET=arm64-osx" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_TRIPLET=arm64-osx-${{matrix.linking}}-release-only" >> $GITHUB_ENV
else
echo "$RUNNER_OS is not supported."
exit 1
fi
- uses: actions/checkout@v2
with:
submodules: true
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.29.0
- name: Install Vulkan SDK
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
distro_code_name="$(lsb_release -c | grep -oP "\:\s+\K\S+")"
os_arch="$(uname -m)"
if ! curl -s -I "https://packages.lunarg.com/vulkan/dists/${distro_code_name}/" | grep "2 404" > /dev/null; then
echo "Installing Vulkan SDK from a PPA..."
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${distro_code_name}.list \
https://packages.lunarg.com/vulkan/lunarg-vulkan-${distro_code_name}.list
sudo apt update
sudo apt install vulkan-sdk
else
echo "Unpacking Vulkan SDK from an archive file..."
curl --silent --show-error --fail -O https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.tar.gz
mkdir -p VulkanSDK
tar -xf vulkan-sdk.tar.gz -C VulkanSDK
# Fix pkgconfig file.
shaderc_pkgconfig_file="VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig/shaderc.pc"
if [ -f $shaderc_pkgconfig_file ]; then
prefix_path=$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch")
sed -i '3s;.*;prefix=\"'$prefix_path'\";' "$shaderc_pkgconfig_file"
sed -i '5s;.*;libdir=${prefix}/lib;' "$shaderc_pkgconfig_file"
echo "PKG_CONFIG_PATH=\"$(realpath "VulkanSDK/$(ls VulkanSDK)/$os_arch/lib/pkgconfig")\"" >> $GITHUB_ENV
fi
fi
# Also install the dependencies for building ports like GLEW here.
sudo apt install -y libgl-dev libxmu-dev libxi-dev libx11-dev libxft-dev libxext-dev libxrandr-dev \
libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev autoconf-archive
elif [ "$RUNNER_OS" == "Windows" ]; then
# Chocolatey is broken as of 2023-07-07
#choco install vulkan-sdk
curl -O https://sdk.lunarg.com/sdk/download/1.3.250.1/windows/VulkanSDK-1.3.250.1-Installer.exe
./VulkanSDK-1.3.250.1-Installer.exe --accept-licenses --default-answer --confirm-command install
elif [ "$RUNNER_OS" == "macOS" ]; then
vulkansdk_filename=$(curl -sIkL https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg | sed -r '/filename=/!d;s/.*filename=(.*)$/\1/')
VULKAN_SDK_VERSION=$(echo $vulkansdk_filename | sed -r 's/^.*vulkansdk-macos-(.*)\.dmg.*$/\1/')
curl -O https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg
sudo hdiutil attach vulkan-sdk.dmg
# The directory was changed from '/Volumes/VulkanSDK' to, e.g., 'vulkansdk-macos-1.3.261.0'.
vulkan_dir=$(find /Volumes -maxdepth 1 -name '[Vv]ulkan*' -not -path "/Volumes/VMware*" || true)
sudo "${vulkan_dir}/InstallVulkan.app/Contents/MacOS/InstallVulkan" \
--root ~/VulkanSDK/$VULKAN_SDK_VERSION --accept-licenses --default-answer --confirm-command install
cd ~/VulkanSDK/$VULKAN_SDK_VERSION
sudo ./install_vulkan.py || true
sudo hdiutil unmount "${vulkan_dir}"
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update
#rm /usr/local/bin/2to3 || true
#rm /usr/local/bin/idle3 || true
#rm /usr/local/bin/pydoc3 || true
#rm /usr/local/bin/python3 || true
#rm /usr/local/bin/python3-config || true
brew install --force --overwrite llvm libomp pkg-config autoconf automake autoconf-archive
else
echo "$RUNNER_OS is not supported."
exit 1
fi
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitURL: 'https://github.com/microsoft/vcpkg.git'
vcpkgGitCommitId: '1de2026f28ead93ff1773e6e680387643e914ea1'
vcpkgDirectory: ${{env.VCPKG_ROOT}}
doNotCacheOnWorkflowFailure: true
- name: Create custom vcpkg triplet
shell: bash
run: |
cp "${{env.VCPKG_ROOT}}/triplets/${{env.VCPKG_COPY_TRIPLET}}.cmake" "${{env.VCPKG_ROOT}}/triplets/community/${{env.VCPKG_DEFAULT_TRIPLET}}.cmake"
echo "set(VCPKG_BUILD_TYPE release)" >> "${{env.VCPKG_ROOT}}/triplets/community/${{env.VCPKG_DEFAULT_TRIPLET}}.cmake"
sed -i -e 's/.*VCPKG_LIBRARY_LINKAGE.*/set(VCPKG_LIBRARY_LINKAGE ${{matrix.linking}})/g' "${{env.VCPKG_ROOT}}/triplets/community/${{env.VCPKG_DEFAULT_TRIPLET}}.cmake"
if [ "$RUNNER_OS" == "Linux" ] && [ "${{matrix.linking}}" == "dynamic" ]; then
echo "set(VCPKG_FIXUP_ELF_RPATH ON)" >> "${{env.VCPKG_ROOT}}/triplets/community/${{env.VCPKG_DEFAULT_TRIPLET}}.cmake"
fi
- name: Build (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "macOS" ]; then
./build.sh --vcpkg --do-not-run --vcpkg-triplet ${{env.VCPKG_DEFAULT_TRIPLET}}
#elif [ "$RUNNER_OS" == "Windows" ]; then
# ./build-msvc.bat --do-not-run --vcpkg-triplet ${{env.VCPKG_DEFAULT_TRIPLET}}
fi
- name: Build (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
for /D %%F in (C:\VulkanSDK\*) do (
set VULKAN_SDK=%%F
goto vulkan_finished
)
:vulkan_finished
./build-msvc.bat --do-not-run --vcpkg-triplet ${{env.VCPKG_DEFAULT_TRIPLET}}