Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix superbuild for new version of F3D and VTK #204

Merged
merged 11 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 30 additions & 26 deletions .github/actions/f3d-superbuild/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ inputs:
description: 'A label to enable raytracing'
required: false
default: 'raytracing'
egl_label:
description: 'A label to enable egl rendering'
required: false
default: 'no-egl'
cpu:
description: 'CPU architecture to build for'
required: false
Expand Down Expand Up @@ -84,14 +80,14 @@ runs:
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DENABLE_egl=${{ inputs.egl_label == 'egl' && 'ON' || 'OFF' }}
-DENABLE_ospray=${{ inputs.raytracing_label == 'raytracing' && 'ON' || 'OFF' }}
-DUSE_SYSTEM_python3=ON
-Df3d_GIT_TAG=${{ inputs.f3d_version }}
-Df3d_SOURCE_SELECTION=git
-Dospray_SOURCE_SELECTION=2.7.1
-Dvtk_GIT_TAG=${{ env.VTK_COMMIT_SHA }}
-Dvtk_SOURCE_SELECTION=git
${{ runner.os == 'Linux' && '-DENABLE_egl=ON -DENABLE_osmesa=ON' || null }}
${{ runner.os == 'Windows' && '-G Ninja' || null }}
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15' || null }}

Expand All @@ -106,27 +102,21 @@ runs:
shell: bash
run: cmake --build . --config Release || cmake --build . --config Release

# Run cmake to update f3d-version.cmake
# Rerun cpack as it can fail on macOS: https://github.com/actions/runner-images/issues/7522
- name: Package
working-directory: ${{github.workspace}}/build
shell: bash
run: |
cmake ./
ctest -R cpack -VV || ctest --rerun-failed -VV
ctest -R extract -VV || ctest --rerun-failed -VV
ctest -R cpack --no-tests=error --output-on-failure || ctest --rerun-failed -VV
ctest -R extract --no-tests=error --output-on-failure

- name: Clean install
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake -E remove_directory install

- name: Run Xvfb Linux
if: |
runner.os == 'Linux' &&
inputs.egl_label != 'egl'
shell: bash
run: Xvfb $DISPLAY -screen 0 1280x1024x24 &

- name: Install Mesa Windows extraction
if: runner.os == 'Windows'
uses: f3d-app/install-mesa-windows-action@v1
Expand All @@ -147,13 +137,11 @@ runs:
with:
path: ${{github.workspace}}\build\Testing\test-sdk\TestRendering_build

# Ubuntu 18.04 provided libEGL.so has rendering issues
- name: Set CI test exception for linux egl
if: |
runner.os == 'linux' &&
inputs.egl_label == 'egl'
# XXX: No test is not a failure here as MacOS bundle does not support SDK
- name: Test sdk
working-directory: ${{github.workspace}}/build
shell: bash
run: echo "F3D_CTEST_EXCEPTIONS=(TestOCCTColoring)|(TestSimpleColor)|(TestSplat)|(TestOSPRay)" >> $GITHUB_ENV
run: ctest -R sdk --output-on-failure

# on macOS CI, texture rendering has some issues,
# https://github.com/f3d-app/f3d/issues/792
Expand All @@ -174,19 +162,35 @@ runs:
shell: bash
run: echo "F3D_CTEST_EXCEPTIONS=(TestSimple)|(TestAlembic)|(TestDraco)|(TestOCCT)|(TestOCCTColoring)|(TestUSD)|(TestVDB)" >> $GITHUB_ENV

- name: Test package
# on linux CI, GLX test require a Xorg server
# Ubuntu 20.04 provided libEGL.so has rendering issues
- name: Set CI test exception for EGL rendering on Linux
if: runner.os == 'Linux'
shell: bash
run: echo "F3D_CTEST_EXCEPTIONS=(TestRenderingGLX)|(TestOCCTColoring)|(TestSimpleColor)|(TestSplat)|(TestOSPRay)" >> $GITHUB_ENV

- name: Test executable
working-directory: ${{github.workspace}}/build
shell: bash
run: |
ctest -R sdk -VV
ctest -R exec -E "${{ env.F3D_CTEST_EXCEPTIONS }}" -VV
run: ctest -R exec -E "${{ env.F3D_CTEST_EXCEPTIONS }}" --no-tests=error --output-on-failure

- name: Run Xvfb Linux
if: runner.os == 'Linux'
shell: bash
run: Xvfb $DISPLAY -screen 0 1280x1024x24 &

- name: Test executable with Xvfb
if: runner.os == 'Linux'
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -R exec --no-tests=error --output-on-failure

- name: Upload Tests Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
path: ./build/Testing/Temporary
name: f3d-superbuild-tests-artifact-${{runner.os}}-${{inputs.cpu}}-${{inputs.raytracing_label}}-${{inputs.egl_label}}
name: f3d-superbuild-tests-artifact-${{runner.os}}-${{inputs.cpu}}-${{inputs.raytracing_label}}

- name: Check sccache results
working-directory: ${{github.workspace}}
Expand All @@ -198,4 +202,4 @@ runs:
uses: actions/upload-artifact@v4
with:
path: ./build/F3D-*
name: F3D-${{runner.os}}-${{inputs.cpu}}-${{inputs.raytracing_label}}-${{inputs.egl_label == 'egl' && 'headless' || 'desktop'}}
name: F3D-${{runner.os}}-${{inputs.cpu}}-${{inputs.raytracing_label}}
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ jobs:
fail-fast: false
matrix:
raytracing_label: [raytracing, no-raytracing]
egl_label: [no-egl, egl]

runs-on: ubuntu-latest
container: ghcr.io/f3d-app/f3d-superbuild-ci
Expand All @@ -85,7 +84,6 @@ jobs:
with:
f3d_version: origin/master
raytracing_label: ${{matrix.raytracing_label}}
egl_label: ${{matrix.egl_label}}
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}

macos:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ jobs:
fail-fast: false
matrix:
raytracing_label: [raytracing, no-raytracing]
egl_label: [no-egl, egl]

runs-on: ubuntu-latest
container: ghcr.io/f3d-app/f3d-superbuild-ci
Expand All @@ -128,7 +127,6 @@ jobs:
with:
f3d_version: ${{ needs.check_nightly.outputs.f3d_sha}}
raytracing_label: ${{matrix.raytracing_label}}
egl_label: ${{matrix.egl_label}}
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}

- name: Delete previous nightly release assets
Expand All @@ -137,7 +135,7 @@ jobs:
token: ${{ secrets.SECRET_TOKEN }}
repository: f3d-app/f3d
tag: nightly
assets: "F3D-*-Linux-x86_64${{ matrix.egl_label == 'egl' && '-headless' || null }}${{ matrix.raytracing_label == 'raytracing' && '-raytracing' || null }}.*"
assets: "F3D-*-Linux-x86_64${{ matrix.raytracing_label == 'raytracing' && '-raytracing' || null }}.*"
fail-if-no-assets: false

- name: Publish nightly release
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
fail-fast: false
matrix:
raytracing_label: [raytracing, no-raytracing]
egl_label: [egl, no-egl]

runs-on: ubuntu-latest
container: ghcr.io/f3d-app/f3d-superbuild-ci
Expand All @@ -85,7 +84,6 @@ jobs:
with:
f3d_version: ${{github.event.inputs.f3d_version}}
raytracing_label: ${{matrix.raytracing_label}}
egl_label: ${{matrix.egl_label}}

- name: Publish assets
if: ${{ github.event.inputs.publish_assets == 'true' }}
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ function (superbuild_find_projects var)

if (NOT APPLE)
list(APPEND projects
egl)
egl
osmesa)
endif ()

endif ()

if (WIN32)
Expand Down
5 changes: 0 additions & 5 deletions projects/f3d.suffix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ else ()
list(APPEND package_suffix_items "${CMAKE_OSX_ARCHITECTURES}")
endif()

if (egl_enabled)
list(APPEND package_suffix_items
"headless")
endif()

if (ospray_enabled)
list(APPEND package_suffix_items
"raytracing")
Expand Down
1 change: 1 addition & 0 deletions projects/unix/egl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superbuild_add_project(egl MUST_USE_SYSTEM)
1 change: 1 addition & 0 deletions projects/unix/egl.system.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find_library(EGL_LIBRARY NAMES EGL egl REQUIRED)
7 changes: 1 addition & 6 deletions projects/unix/f3d.bundle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,5 @@ if (cpack_generator MATCHES "DEB")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${f3d_url})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Whisley <whisley.santos@gmail.com>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libbsd0, libxdmcp6, libglvnd0, libxcb1, libc6, libgcc1, libstdc++6, libopengl0, libx11-6")
if (egl_enabled)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libegl1")
else ()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libglx0")
endif ()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libbsd0, libxdmcp6, libglvnd0, libxcb1, libc6, libgcc1, libstdc++6, libopengl0, libx11-6, libegl1, libglx0, libosmesa6")
endif ()
1 change: 1 addition & 0 deletions projects/unix/osmesa.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
superbuild_add_project(osmesa MUST_USE_SYSTEM)
1 change: 1 addition & 0 deletions projects/unix/osmesa.system.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find_library(OSMESA_LIBRARY NAMES OSMesa osmesa REQUIRED)
22 changes: 11 additions & 11 deletions projects/vtk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ if (openvdb_enabled)
set(vtk_ioopenvdb_enabled YES)
endif ()

# XXX: Not listed as an optional dependencies
# as egl is a use system project
set(vtk_egl_enabled NO)
if (egl_enabled)
set(vtk_egl_enabled YES)
endif ()

set(vtk_use_x NO)
set(vtk_platform_dependencies)
if (UNIX)
if (NOT APPLE)
list(APPEND vtk_platform_dependencies egl)
if (NOT egl_enabled)
set(vtk_use_x YES)
endif ()
endif ()
if (UNIX AND NOT APPLE)
set(vtk_use_x YES)
endif ()

set(vtk_smp_type "Sequential")
Expand All @@ -37,11 +38,10 @@ superbuild_add_project(vtk
LICENSE_FILES
Copyright.txt
DEPENDS cxx11
DEPENDS_OPTIONAL tbb ospray exodus openvdb ${vtk_platform_dependencies}
DEPENDS_OPTIONAL tbb ospray exodus openvdb
CMAKE_ARGS
-DVTKOSPRAY_ENABLE_DENOISER:BOOL=${ospray_enabled}
-DVTK_BUILD_TESTING:BOOL=OFF
-DVTK_DEFAULT_RENDER_WINDOW_HEADLESS:BOOL=${egl_enabled}
-DVTK_ENABLE_LOGGING:BOOL=OFF
-DVTK_ENABLE_WRAPPING:BOOL=OFF
-DVTK_GROUP_ENABLE_Rendering:STRING=DEFAULT
Expand Down Expand Up @@ -71,7 +71,7 @@ superbuild_add_project(vtk
-DVTK_MODULE_ENABLE_VTK_RenderingRayTracing:STRING=${vtk_raytracing_enabled}
-DVTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2:STRING=YES
-DVTK_MODULE_ENABLE_VTK_TestingCore:STRING=YES
-DVTK_OPENGL_HAS_EGL:BOOL=${egl_enabled}
-DVTK_OPENGL_HAS_EGL:BOOL=${vtk_egl_enabled}
-DVTK_SMP_ENABLE_SEQUENTIAL:BOOL=${vtk_smp_enable_sequential}
-DVTK_SMP_ENABLE_STDTHREAD:BOOL=OFF
-DVTK_SMP_ENABLE_TBB:BOOL=${tbb_enabled}
Expand Down
20 changes: 19 additions & 1 deletion testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,28 @@ f3d_add_test(TestSimple cow.vtp)
f3d_add_test(TestSimpleColor dragon.vtu --colormap-file=viridis)
f3d_add_test(TestThumbnail dragon.vtu --config=thumbnail)

if (WIN32)
f3d_add_test(TestRenderingWGL dragon.vtu --rendering-backend=wgl)
endif ()

if (UNIX AND NOT APPLE)
# XXX: This test requires a Xorg server running
f3d_add_test(TestRenderingGLX dragon.vtu --rendering-backend=glx)
endif ()

if (NOT APPLE)
f3d_add_test(TestSplat small.splat)
endif ()

if (egl_enabled)
# XXX: Once Ubuntu 22.04 is used for CI, this test should use coloring
f3d_add_test(TestRenderingHeadlessEGL cow.vtp --rendering-backend=egl)
endif ()

if (osmesa_enabled)
f3d_add_test(TestRenderingHeadlessOSMESA dragon.vtu --rendering-backend=osmesa)
endif ()

if (alembic_enabled)
f3d_add_test(TestAlembic suzanne.abc)
endif ()
Expand All @@ -92,7 +110,7 @@ endif ()

if (occt_enabled)
# This test is needed because cell coloring does not work on macOS CI: https://github.com/f3d-app/f3d/issues/792
f3d_add_test(TestOCCT f3d.stp --scalar-coloring=0)
f3d_add_test(TestOCCT f3d.stp --scalar-coloring=false)
f3d_add_test(TestOCCTColoring f3d.stp)
endif ()

Expand Down
4 changes: 2 additions & 2 deletions testing/baselines/TestAlembic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestAssimp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestDraco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestOCCT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestOCCTColoring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testing/baselines/TestRenderingGLX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testing/baselines/TestRenderingHeadlessEGL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testing/baselines/TestRenderingHeadlessOSMESA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testing/baselines/TestRenderingWGL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestSimple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestSimpleColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestThumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestUSD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions testing/baselines/TestVDB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions testing/sdk/test_engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,4 @@ check_variable_defined(f3d_MODULE_RAYTRACING)

add_executable(test_engine main.cxx)
target_link_libraries(test_engine f3d::libf3d)

# make sure the libf3d API is compatible with C++11
set_target_properties(test_engine PROPERTIES CXX_STANDARD 11)
target_compile_definitions(test_engine PRIVATE F3D_DISABLE_CXX17_API)
set_target_properties(test_engine PROPERTIES CXX_STANDARD 17)
Loading