Gpu gain example #248
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build OpenFX libs and examples | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: '${{ matrix.name_prefix }} <config=${{ matrix.buildtype }}>' | |
# Avoid duplicated checks when a pull_request is opened from a local branch. | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name_prefix: Linux CentOS 7 VFX CY2021 | |
release_prefix: linux-vfx2021 | |
ostype: linux | |
aswfdockerbuild: true | |
os: ubuntu-latest | |
container: aswf/ci-base:2021 | |
vfx-cy: 2021 | |
has_cmake_presets: false | |
buildtype: Release | |
conan_version: 2.1.0 | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang | |
cuda: false | |
- name_prefix: Linux CentOS 7 VFX CY2022 | |
release_prefix: linux-vfx2022 | |
ostype: linux | |
aswfdockerbuild: true | |
os: ubuntu-latest | |
container: aswf/ci-base:2022 | |
vfx-cy: 2022 | |
has_cmake_presets: false | |
buildtype: Release | |
conan_version: 2.1.0 | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang | |
cuda: false | |
- name_prefix: Linux Rocky 8 VFX CY2023 | |
release_prefix: linux-vfx2023 | |
ostype: linux | |
aswfdockerbuild: true | |
os: ubuntu-latest | |
container: aswf/ci-base:2023 | |
vfx-cy: 2023 | |
has_cmake_presets: false | |
buildtype: Release | |
conan_version: 2.1.0 | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang | |
cuda: false | |
- name_prefix: Linux Ubuntu | |
release_prefix: linux-ubuntu | |
ostype: linux | |
aswfdockerbuild: false | |
os: ubuntu-latest | |
container: null | |
has_cmake_presets: true | |
buildtype: Release | |
conan_version: 2.1.0 | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang | |
cuda: true | |
- name_prefix: MacOS | |
release_prefix: mac | |
ostype: mac | |
os: macos-latest | |
container: null # See the null value here | |
has_cmake_presets: true | |
buildtype: Release | |
conan_version: 2.1.0 | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang | |
cuda: false | |
- name_prefix: Windows | |
release_prefix: windows | |
ostype: windows | |
os: windows-latest | |
container: null | |
has_cmake_presets: true | |
buildtype: Release | |
conan_version: 2.1.0 | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang | |
cuda: true | |
- name_prefix: Windows no CUDA | |
release_prefix: windows-no-cuda | |
ostype: windows | |
os: windows-latest | |
container: null | |
has_cmake_presets: true | |
buildtype: Release | |
conan_version: 2.0.16 | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang | |
cuda: false | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: setup env vars | |
run: | | |
BUILDTYPE_LC=$(echo '${{ matrix.buildtype }}'|tr [:upper:] [:lower:]) | |
echo "BUILDTYPE_LC=$BUILDTYPE_LC" >> $GITHUB_ENV | |
echo "OSNAME=$(echo '${{ matrix.os }}'|sed 's/-.*//')" >> $GITHUB_ENV | |
echo "GIT_COMMIT_ID=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
# Conan on Windows always uses "conan-default" preset | |
if [[ ${{ matrix.os }} = windows-latest ]]; then | |
echo "CONAN_PRESET=conan-default" >> $GITHUB_ENV | |
echo "BUILD_DIR=build" >> $GITHUB_ENV | |
else | |
echo "CONAN_PRESET=conan-$BUILDTYPE_LC" >> $GITHUB_ENV | |
echo "BUILD_DIR=build/${{ matrix.buildtype }}" >> $GITHUB_ENV | |
fi | |
- name: update Python pip | |
run: | | |
python3 -mpip install --upgrade pip | |
- name: Install Conan | |
id: conan | |
uses: turtlebrowser/get-conan@main | |
with: | |
version: ${{ matrix.conan_version }} | |
- name: Set up conan | |
run: | | |
conan profile detect | |
- name: Install system dependencies if needed | |
uses: ConorMacBride/install-package@v1 | |
if: ${{ matrix.aswfdockerbuild == false }} | |
with: | |
apt: libgl-dev libgl1-mesa-dev | |
brew: | |
brew-cask: | |
- name: Install CUDA Toolkit | |
uses: Jimver/[email protected] | |
id: cuda-toolkit-linux | |
if: matrix.ostype == 'linux' && matrix.cuda == true | |
with: | |
cuda: '12.1.0' | |
method: 'network' | |
sub-packages: '["nvcc", "cudart"]' | |
linux-local-args: '["--toolkit"]' | |
- name: Install CUDA Toolkit | |
uses: Jimver/[email protected] | |
id: cuda-toolkit-win | |
if: matrix.ostype == 'windows' && matrix.cuda == true | |
with: | |
cuda: '12.1.0' | |
method: 'network' | |
sub-packages: '["nvcc", "cudart", "visual_studio_integration"]' | |
# - name: Install system dependencies (CentOS) | |
# run: | | |
# rpm install libglvnd-devel | |
- name: Install dependencies | |
run: | | |
conan install -s build_type=${{ matrix.buildtype }} -pr:b=default --build=missing . | |
- name: Configure project with cmake | |
run: | | |
[[ ${{ matrix.cuda }} = true ]] && CUDA=TRUE || CUDA=FALSE | |
if [[ ${{ matrix.has_cmake_presets }} = true ]]; then | |
# Sets up to build in e.g. build/Release | |
cmake --preset $CONAN_PRESET -DBUILD_EXAMPLE_PLUGINS=TRUE \ | |
-DPLUGIN_INSTALLDIR=$(pwd)/$BUILD_DIR/Install \ | |
-DOFX_SUPPORTS_OPENGLRENDER=TRUE \ | |
-DOFX_SUPPORTS_CUDARENDER=$CUDA . | |
else | |
# VFX ref platforms 2022 & earlier have only cmake 3.19. | |
# Older cmake (<3.23) does not support presets, so invoke with explicit args. | |
cmake -S . -B $BUILD_DIR -G "Unix Makefiles" \ | |
-DCMAKE_TOOLCHAIN_FILE=$(pwd)/$BUILD_DIR/generators/conan_toolchain.cmake \ | |
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DBUILD_EXAMPLE_PLUGINS=TRUE \ | |
-DPLUGIN_INSTALLDIR=$(pwd)/$BUILD_DIR/Install \ | |
-DOFX_SUPPORTS_OPENGLRENDER=TRUE \ | |
-DOFX_SUPPORTS_CUDARENDER=$CUDA | |
fi | |
- name: Build with cmake | |
run: | | |
if [[ ${{ matrix.ostype }} = windows ]]; then | |
cmake --build $BUILD_DIR --target install --config Release --parallel | |
else | |
cmake --build $BUILD_DIR --target install --parallel | |
fi | |
- name: Build with make | |
run: | | |
if [[ ${{ matrix.ostype }} = windows ]]; then | |
echo No Windows nmake build yet | |
else | |
(cd Examples; make -j) | |
# should build Support/Plugins too, but those need work | |
fi | |
- name: Copy includes into build folder for installation | |
run: | | |
cp -R include ${{ env.BUILD_DIR }}/include | |
cp -R Support/include ${{ env.BUILD_DIR }}/Support/include | |
cp -R HostSupport/include ${{ env.BUILD_DIR }}/HostSupport/include | |
- name: Archive libs, plugins, and header files to artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: openfx-${{ matrix.release_prefix }}-${{ env.BUILDTYPE_LC }}-${{ env.GIT_COMMIT_ID }} | |
path: | | |
${{ env.BUILD_DIR }}/include | |
!${{ env.BUILD_DIR }}/include/DocSrc | |
!${{ env.BUILD_DIR }}/include/*.png | |
!${{ env.BUILD_DIR }}/include/*.doxy | |
!${{ env.BUILD_DIR }}/include/*.dtd | |
${{ env.BUILD_DIR }}/Support/include | |
${{ env.BUILD_DIR }}/HostSupport/include | |
${{ env.BUILD_DIR }}/**/*.ofx | |
${{ env.BUILD_DIR }}/**/lib* | |
# - name: Archive all build artifacts (for debugging CI) | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: openfx-build-${{ matrix.release_prefix }}-${{ env.BUILDTYPE_LC }}-${{ env.GIT_COMMIT_ID }} | |
# path: | | |
# . |