name: "Install ospray sb Dependency" description: "Install ospray sb Dependency using cache when possible" inputs: version: description: "Version of ospray to build" required: true cpu: description: "CPU architecture to build for" required: false default: "x86_64" global_cache_index: description: "Global cache index" required: true runs: using: "composite" steps: - name: Check required inputs shell: bash run: | [[ "${{ inputs.version }}" ]] || { echo "version input is empty" ; exit 1; } [[ "${{ inputs.global_cache_index }}" ]] || { echo "global_cache_index input is empty" ; exit 1; } - name: Cache ospray id: cache-ospray uses: actions/cache/restore@v5 with: path: dependencies/ospray_install key: ospray-sb-${{inputs.version}}-${{runner.os}}-${{inputs.cpu}}-${{inputs.global_cache_index}}-1 # Dependents: vtk - name: Checkout ospray if: steps.cache-ospray.outputs.cache-hit != 'true' uses: actions/checkout@v6 with: repository: RenderKit/ospray path: "./dependencies/ospray" ref: ${{inputs.version}} # https://github.com/ospray/ospray/pull/550 - name: Patch ospray rkcommon superbuild if: steps.cache-ospray.outputs.cache-hit != 'true' working-directory: ${{github.workspace}}/dependencies/ospray shell: bash run: patch -p1 < $GITHUB_ACTION_PATH/0001-Fix-INSTALL_RPATH-in-rkcommon-superbuild.patch # https://github.com/RenderKit/embree/issues/486 - name: Patch ospray embree superbuild if: steps.cache-ospray.outputs.cache-hit != 'true' working-directory: ${{github.workspace}}/dependencies/ospray shell: bash run: patch -p1 < $GITHUB_ACTION_PATH/0001-fix-embree-for-modern-clang.patch - name: Setup ospray if: steps.cache-ospray.outputs.cache-hit != 'true' working-directory: ${{github.workspace}}/dependencies shell: bash run: | mkdir ospray_build mkdir ospray_install - name: Set TBB_ROOT working-directory: ${{github.workspace}}/dependencies/ shell: bash run: echo "TBB_ROOT=$(pwd)/install" >> $GITHUB_ENV - name: Configure ospray if: steps.cache-ospray.outputs.cache-hit != 'true' working-directory: ${{github.workspace}}/dependencies/ospray_build shell: bash run: > cmake ../ospray/scripts/superbuild/ -DBUILD_EMBREE_FROM_SOURCE=${{ runner.os == 'Windows' && 'OFF' || 'ON' }} -DBUILD_GLFW=OFF -DBUILD_OIDN=ON -DBUILD_OIDN_FROM_SOURCE=ON -DBUILD_OSPRAY_APPS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../ospray_install -DDOWNLOAD_ISPC=ON -DDOWNLOAD_TBB=OFF -DINSTALL_DEPENDENCIES=ON -DINSTALL_IN_SEPARATE_DIRECTORIES=OFF ${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0' || null }} ${{ runner.os == 'Windows' && '-Ax64 -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL' || null }} - name: Build ospray if: steps.cache-ospray.outputs.cache-hit != 'true' working-directory: ${{github.workspace}}/dependencies/ospray_build shell: bash run: cmake --build . --parallel 2 --config Release - name: Copy to install working-directory: ${{github.workspace}}/dependencies/ospray_install shell: bash run: cp -r ./* ../install/ - name: Save cache if: steps.cache-ospray.outputs.cache-hit != 'true' uses: actions/cache/save@v5 with: key: ${{ steps.cache-ospray.outputs.cache-primary-key }} path: dependencies/ospray_install