Skip to content

Commit

Permalink
Merge master into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Jun 11, 2024
2 parents add1010 + 6572b4f commit ca07cd8
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
include:
- os: ubuntu-latest
config: Release
container: ghcr.io/viennatools/vienna-builder:vtk
container: ghcr.io/viennatools/vienna-builder:suite
- os: ubuntu-latest
config: Debug
container: ghcr.io/viennatools/vienna-builder:vtk
container: ghcr.io/viennatools/vienna-builder:suite

runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
Expand All @@ -51,4 +51,4 @@ jobs:
run: cmake -DVIENNALS_BUILD_TESTS=ON -B build && cmake --build build --config ${{ matrix.config }}

- name: 🧪 Test
run: ctest -E "Benchmark|Performance" -C ${{ matrix.config }} --test-dir build
run: ctest --output-on-failure -E "Benchmark|Performance" -C ${{ matrix.config }} --test-dir build
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
check-coding-style:
runs-on: ubuntu-latest
container: ghcr.io/viennatools/vienna-builder:vtk-python
container: ghcr.io/viennatools/vienna-builder:suite-python

steps:
- name: 📥 Checkout
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
include:
- os: ubuntu-latest
container: ghcr.io/viennatools/vienna-builder:vtk-python
container: ghcr.io/viennatools/vienna-builder:suite-python
- os: windows-latest
- os: macos-latest

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
if: ${{ matrix.os != 'windows-latest' }}
run: |
python -m venv venv
./venv/bin/pip install .
CMAKE_ARGS=-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF ./venv/bin/pip install . # Alpine does not like LTO
./venv/bin/python -c "import viennals2d; print(viennals2d.__doc__)"
- name: 📦 Upload Artifact
Expand Down Expand Up @@ -95,21 +95,18 @@ jobs:
- name: 🛠️ Build VTK (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
# sed -i 's/\(DVIENNALS_BUILD_PYTHON=ON"\)/\1,"-DVIENNALS_PACKAGE_PYTHON=ON"/g' pyproject.toml
sed -i 's/\(DVIENNALS_BUILD_PYTHON=ON"\)/\1,"-DVIENNALS_PACKAGE_PYTHON=ON","-DVIENNALS_IS_CI=ON"/g' pyproject.toml
type pyproject.toml
- name: 🛠️ Build VTK (MacOs)
if: ${{ matrix.os == 'macos-latest' }}
run: |
# sed -i .bak 's/\(DVIENNALS_BUILD_PYTHON=ON"\)/\1,"-DVIENNALS_PACKAGE_PYTHON=ON"/g' pyproject.toml
sed -i .bak 's/\(DVIENNALS_BUILD_PYTHON=ON"\)/\1,"-DVIENNALS_PACKAGE_PYTHON=ON","-DVIENNALS_IS_CI=ON"/g' pyproject.toml
cat pyproject.toml
- name: 🛠️ Use VTK-Python Libs
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# sed -i 's/\(DVIENNALS_BUILD_PYTHON=ON"\)/\1,"-DVIENNALS_VTK_PYTHON_LIBS=ON"/g' pyproject.toml
sed -i 's/\(DVIENNALS_BUILD_PYTHON=ON"\)/\1,"-DVIENNALS_PACKAGE_PYTHON=ON","-DVIENNALS_IS_CI=ON"/g' pyproject.toml
cat pyproject.toml
Expand Down
17 changes: 1 addition & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ CPMAddPackage(

CPMAddPackage(
NAME PackageProject
VERSION 1.11.1
VERSION 1.11.2
GIT_REPOSITORY "https://github.com/TheLartians/PackageProject.cmake"
EXCLUDE_FROM_ALL ${VIENNALS_BUILD_PYTHON})

Expand All @@ -128,11 +128,6 @@ if(VIENNALS_USE_VTK AND VIENNALS_VTK_PYTHON_LIBS)
elseif(VIENNALS_USE_VTK)
enable_language(C)

find_package(VTK QUIET)
set(VIENNALS_SYSTEM_VTK
${VTK_FOUND}
CACHE INTERNAL "")

CPMFindPackage(
NAME VTK
# TODO: Change to 9.3.1 as soon as it's released
Expand Down Expand Up @@ -194,16 +189,6 @@ if(VIENNALS_ENABLE_SANITIZER)
viennacore_enable_sanitizer()
endif()

# --------------------------------------------------------------------------------------------------------
# Check need for environment setups
# --------------------------------------------------------------------------------------------------------

if(NOT VIENNALS_VTK_PYTHON_LIBS AND (NOT VIENNALS_SYSTEM_VTK OR VIENNALS_PACKAGE_PYTHON))
set(VIENNALS_VTK_ENV
ON
CACHE INTERNAL "")
endif()

# --------------------------------------------------------------------------------------------------------
# Setup Shared/Static Library
# --------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions cmake/vtk.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
macro(setup_vtk_env TARGET OUTPUT)
message(STATUS "[ViennaLS] Setting up VTK-Environment for ${TARGET}")

if(NOT TARGET vtksys)
message(WARNING "[ViennaLS] Could not find VTK-Target")
return()
endif()

# We expect all of the VTK binaries to be present in the same directory to which "vtksys" is
# built. This is currently the case, and has been the case for prior vtk versions - However we
# should keep an eye on this.
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(ViennaLS_Examples ALL)

if(WIN32 AND VIENNALS_VTK_ENV)
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${PROJECT_BINARY_DIR}/examples>)
setup_vtk_env(ViennaLS_Examples ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
Expand Down
2 changes: 1 addition & 1 deletion include/viennals/lsGeometricAdvect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ template <class T, int D> class GeometricAdvect {
}
}
} // domainBounds for
} // parallel region
} // parallel region

// copy all points into the first vector
{
Expand Down
11 changes: 6 additions & 5 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ target_compile_definitions(viennals3d PRIVATE -DVIENNALS_PYTHON_DIMENSION=3

set(VIENNALS_LIB_FOLDER ${VIENNALS_LIBRARY_OUTPUT_DIR}/viennals.libs)

if(NOT VIENNALS_VTK_ENV)
return()
endif()
# Not required for both targets, one will suffice
setup_vtk_env(viennals2d ${VIENNALS_LIB_FOLDER})

setup_vtk_env(viennals2d ${VIENNALS_LIB_FOLDER}) # Not required for both targets, one will suffice
install(DIRECTORY ${VIENNALS_LIB_FOLDER} DESTINATION .)
install(
DIRECTORY ${VIENNALS_LIB_FOLDER}
DESTINATION .
OPTIONAL)
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(ViennaLS_Tests ALL)

if(WIN32 AND VIENNALS_VTK_ENV)
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${PROJECT_BINARY_DIR}/tests>)
setup_vtk_env(ViennaLS_Tests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
Expand Down

0 comments on commit ca07cd8

Please sign in to comment.