Skip to content

Commit

Permalink
Attempt to add static libraries to all windows dependencies for stati…
Browse files Browse the repository at this point in the history
…c builds

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
  • Loading branch information
swahtz committed Aug 28, 2024
1 parent 0623fb9 commit 39b5ecc
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 108 deletions.
212 changes: 106 additions & 106 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@

# name: Build
name: Build

# on:
# push:
# branches:
# - 'master'
# - 'feature/**'
# - 'pr/**'
# paths-ignore:
# - 'CHANGES'
# - 'CODEOWNERS'
# - 'doc/**'
# - 'openvdb_maya/**'
# - 'openvdb_houdini/**'
# - 'openvdb_ax/**'
# - 'nanovdb/**'
# - 'pendingchanges/**'
# - '**.md'
# pull_request:
# branches:
# - '**'
# paths-ignore:
# - 'CHANGES'
# - 'CODEOWNERS'
# - 'doc/**'
# - 'openvdb_maya/**'
# - 'openvdb_houdini/**'
# - 'openvdb_ax/**'
# - 'nanovdb/**'
# - 'pendingchanges/**'
# - '**.md'
# schedule:
# # run this workflow every day at 7am UTC except Monday
# - cron: '0 7 * * 0,2-6'
# # run this workflow Monday 7am UTC
# # warning: This pattern is checked in various places below
# - cron: '0 7 * * 1'
# workflow_dispatch:
# inputs:
# type:
# description: 'The type of CI to run (all, linux, win, mac)'
# required: true
# default: 'all'
on:
push:
branches:
- 'master'
- 'feature/**'
- 'pr/**'
paths-ignore:
- 'CHANGES'
- 'CODEOWNERS'
- 'doc/**'
- 'openvdb_maya/**'
- 'openvdb_houdini/**'
- 'openvdb_ax/**'
- 'nanovdb/**'
- 'pendingchanges/**'
- '**.md'
pull_request:
branches:
- '**'
paths-ignore:
- 'CHANGES'
- 'CODEOWNERS'
- 'doc/**'
- 'openvdb_maya/**'
- 'openvdb_houdini/**'
- 'openvdb_ax/**'
- 'nanovdb/**'
- 'pendingchanges/**'
- '**.md'
schedule:
# run this workflow every day at 7am UTC except Monday
- cron: '0 7 * * 0,2-6'
# run this workflow Monday 7am UTC
# warning: This pattern is checked in various places below
- cron: '0 7 * * 1'
workflow_dispatch:
inputs:
type:
description: 'The type of CI to run (all, linux, win, mac)'
required: true
default: 'all'

# # Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
# concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: true
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# defaults:
# run:
# shell: bash
defaults:
run:
shell: bash

# jobs:
jobs:
# linux-vfx:
# # VFX platform jobs. These are run on the appropriate CentOS images from
# # the provided ASWF docker containers
Expand Down Expand Up @@ -124,62 +124,62 @@
# if: matrix.config.build == 'Release'
# run: ccache --evict-older-than 1d

# windows:
# # Windows CI. Tests static and dynamic builds with MT and MD respectively.
# if: |
# github.event_name != 'workflow_dispatch' ||
# github.event.inputs.type == 'all' ||
# github.event.inputs.type == 'win'
# runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
# name: windows-vc:${{ matrix.config.vc }}-type:${{ matrix.config.build }}
# env:
# VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vc }}
# strategy:
# matrix:
# config:
# # static build of blosc from vcpkg does not build internal sources.
# # USE_STATIC_DEPENDENCIES is required for IlmBase/OpenEXR defines and
# # Boost as both shared and static libs are installed.
# # USE_EXPLICIT_INSTANTIATION is disabled for debug static libraries
# # due to disk space constraints
# # @note Commented out the static debug build due to linker OOM LNK1102
# - { vc: 'x64-windows-static', components: 'core,bin,view,render,test', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
# #- { vc: 'x64-windows-static', components: 'core,bin,view,render,test', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON -DUSE_EXPLICIT_INSTANTIATION=OFF' }
# - { vc: 'x64-windows', components: 'core,bin,view,render,python,test', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
# - { vc: 'x64-windows', components: 'core,bin,view,render,python,test', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
# #- { vc: 'x64-windows', build: 'Release', cmake: '-G \"MinGW Makefiles\" -DOPENVDB_CORE_STATIC=OFF' }
# fail-fast: false
# steps:
# - uses: actions/checkout@v3
# - name: path
# shell: pwsh
# run: |
# # note: system path must be modified in a previous step to it's use
# echo "$Env:VCPKG_INSTALLATION_ROOT\installed\${{ matrix.config.vc }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# echo "${{github.workspace}}\build\openvdb\openvdb\${{ matrix.config.build }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# - name: install
# run: ./ci/install_windows.sh
# - name: build
# run: >
# ./ci/build.sh -v
# --config=${{ matrix.config.build }}
# --components=${{ matrix.config.components }}
# --cargs=\'
# ${{ matrix.config.cmake }}
# -DMSVC_COMPRESS_PDB=ON
# -DUSE_EXR=ON
# -DUSE_PNG=ON
# -DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
# -DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
# \'
# - name: size
# # Print the build directy size (monitor if we're hitting runner limits)
# run: du -h build
# - name: test
# # Always run tests on weekly builds but skip Debug on commits as they take a while.
# # https://github.hscsec.cnmunity/t/distinct-job-for-each-schedule/17811/2
# if: contains(github.event.schedule, '0 7 * * 1') || matrix.config.build == 'Release'
# run: cd build && ctest -V -C ${{ matrix.config.build }}
windows:
# Windows CI. Tests static and dynamic builds with MT and MD respectively.
if: |
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'win'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
name: windows-vc:${{ matrix.config.vc }}-type:${{ matrix.config.build }}
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vc }}
strategy:
matrix:
config:
# static build of blosc from vcpkg does not build internal sources.
# USE_STATIC_DEPENDENCIES is required for IlmBase/OpenEXR defines and
# Boost as both shared and static libs are installed.
# USE_EXPLICIT_INSTANTIATION is disabled for debug static libraries
# due to disk space constraints
# @note Commented out the static debug build due to linker OOM LNK1102
- { vc: 'x64-windows-static', components: 'core,bin,view,render,test', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
#- { vc: 'x64-windows-static', components: 'core,bin,view,render,test', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON -DUSE_EXPLICIT_INSTANTIATION=OFF' }
# - { vc: 'x64-windows', components: 'core,bin,view,render,python,test', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
# - { vc: 'x64-windows', components: 'core,bin,view,render,python,test', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
#- { vc: 'x64-windows', build: 'Release', cmake: '-G \"MinGW Makefiles\" -DOPENVDB_CORE_STATIC=OFF' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: path
shell: pwsh
run: |
# note: system path must be modified in a previous step to it's use
echo "$Env:VCPKG_INSTALLATION_ROOT\installed\${{ matrix.config.vc }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{github.workspace}}\build\openvdb\openvdb\${{ matrix.config.build }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: install
run: ./ci/install_windows.sh
- name: build
run: >
./ci/build.sh -v
--config=${{ matrix.config.build }}
--components=${{ matrix.config.components }}
--cargs=\'
${{ matrix.config.cmake }}
-DMSVC_COMPRESS_PDB=ON
-DUSE_EXR=ON
-DUSE_PNG=ON
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
\'
- name: size
# Print the build directy size (monitor if we're hitting runner limits)
run: du -h build
- name: test
# Always run tests on weekly builds but skip Debug on commits as they take a while.
# https://github.hscsec.cnmunity/t/distinct-job-for-each-schedule/17811/2
if: contains(github.event.schedule, '0 7 * * 1') || matrix.config.build == 'Release'
run: cd build && ctest -V -C ${{ matrix.config.build }}

# macos:
# if: |
Expand Down
10 changes: 8 additions & 2 deletions ci/install_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ VCPKG_INSTALL_CMD="vcpkg install
boost-interprocess
boost-algorithm
pybind11
lz4
--clean-after-build"
lz4"

# if VCPKG_DEFAULT_TRIPLET ends with -static, then add ':x64-windows-static' to all the dependencies
if [[ $VCPKG_DEFAULT_TRIPLET == *"-static" ]]; then
VCPKG_INSTALL_CMD="$VCPKG_INSTALL_CMD:x64-windows-static"
fi

VCPKG_INSTALL_CMD="$VCPKG_INSTALL_CMD --clean-after-build"

# Update vcpkg
vcpkg update
Expand Down

0 comments on commit 39b5ecc

Please sign in to comment.