diff --git a/Applications/ApplicationsLib/CMakeLists.txt b/Applications/ApplicationsLib/CMakeLists.txt index 05b380e432004e765c4ae7c0f398c94ec7a24076..b27de484c97e4c92bd0cf2a863f74929b45136f2 100644 --- a/Applications/ApplicationsLib/CMakeLists.txt +++ b/Applications/ApplicationsLib/CMakeLists.txt @@ -8,6 +8,7 @@ ogs_add_library(ApplicationsLib ${LIB_SOURCES}) target_link_libraries( ApplicationsLib PUBLIC BaseLib GeoLib NumLib + $<$<TARGET_EXISTS:VTK::ParallelMPI>:VTK::ParallelMPI> PRIVATE CMakeInfoLib MathLib MeshLib MeshGeoToolsLib $<$<BOOL:${OGS_USE_PYTHON}>:pybind11::pybind11> $<$<BOOL:${OGS_USE_PETSC}>:petsc> diff --git a/Applications/CLI/CMakeLists.txt b/Applications/CLI/CMakeLists.txt index 0c17d46da86956a781fc0d4bc202b92dd3bddf76..7917577bc43d3d8121e54cdbbb2fcdf90b868320 100644 --- a/Applications/CLI/CMakeLists.txt +++ b/Applications/CLI/CMakeLists.txt @@ -84,6 +84,7 @@ target_link_libraries( $<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX> $<$<TARGET_EXISTS:InSituLib>:InSituLib> $<$<TARGET_EXISTS:petsc>:petsc> + $<$<TARGET_EXISTS:VTK::ParallelMPI>:VTK::ParallelMPI> tclap ) diff --git a/Applications/DataExplorer/DataExplorer.cmake b/Applications/DataExplorer/DataExplorer.cmake index 58fc4ef9999fb7f39a439e4e83bc695d20d9ee9e..696700a46fa53f6cdb8bbe8043cc5dbb83d036f2 100644 --- a/Applications/DataExplorer/DataExplorer.cmake +++ b/Applications/DataExplorer/DataExplorer.cmake @@ -41,7 +41,7 @@ target_link_libraries( Qt5::Xml Qt5::Network spdlog::spdlog - ${VTK_LIBRARIES} + VTK::IOExport ) if(UNIX AND NOT APPLE) diff --git a/Applications/DataExplorer/VtkVis/CMakeLists.txt b/Applications/DataExplorer/VtkVis/CMakeLists.txt index cb3af8ab7a10f9f50f6855c7c78f4596f5279aa9..4a725f1e73e465b47041f144ae9897ba9f1ebd64 100644 --- a/Applications/DataExplorer/VtkVis/CMakeLists.txt +++ b/Applications/DataExplorer/VtkVis/CMakeLists.txt @@ -36,10 +36,19 @@ if(OGS_USE_NETCDF) endif() ogs_add_library(VtkVisFilter ${FILTER_SOURCES}) -target_include_directories( - VtkVisFilter PUBLIC ${VTK_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} +target_include_directories(VtkVisFilter PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries( + VtkVisFilter + PRIVATE GeoLib + Qt5::Core + Qt5::Widgets + VTK::CommonExecutionModel + VTK::RenderingCore + VTK::IOImage + VTK::FiltersSources + VTK::FiltersGeometry + VTK::FiltersTexture ) -target_link_libraries(VtkVisFilter PRIVATE GeoLib Qt5::Core Qt5::Widgets ${VTK_LIBRARIES}) if(OGS_USE_NETCDF) target_link_libraries( @@ -163,8 +172,27 @@ if(GEOTIFF_FOUND) endif() # GEOTIFF_FOUND target_link_libraries( - VtkVis PUBLIC BaseLib GeoLib MeshLib DataHolderLib QtBase VtkVisFilter - PRIVATE MathLib ApplicationsFileIO Qt5::Gui + VtkVis + PUBLIC BaseLib + GeoLib + MeshLib + DataHolderLib + QtBase + VtkVisFilter + VTK::GUISupportQt + VTK::FiltersTexture + PRIVATE MathLib + ApplicationsFileIO + Qt5::Gui + VTK::InteractionStyle + VTK::RenderingCore + VTK::RenderingAnnotation + VTK::FiltersGeneral + VTK::ImagingCore + VTK::IOImage + VTK::FiltersModeling + VTK::FiltersExtraction + VTK::FiltersGeometry ) set_property(TARGET VtkVis PROPERTY FOLDER "DataExplorer") diff --git a/Applications/Utils/MeshEdit/CMakeLists.txt b/Applications/Utils/MeshEdit/CMakeLists.txt index 1c13bc9ef78c17dadae901d2fede06306de1a80b..c14cc806f524a5101df5aaa1db2239d7d1934eee 100644 --- a/Applications/Utils/MeshEdit/CMakeLists.txt +++ b/Applications/Utils/MeshEdit/CMakeLists.txt @@ -25,17 +25,17 @@ set(TOOLS Vtu2Grid ) -if(OGS_BUILD_GUI) - ogs_add_executable( - RemoveGhostData RemoveGhostData.cpp - ${PROJECT_SOURCE_DIR}/ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp - ) - target_include_directories( - RemoveGhostData PRIVATE ${PROJECT_SOURCE_DIR}/ThirdParty/paraview - ) - target_link_libraries(RemoveGhostData GitInfoLib MeshLib tclap) - install(TARGETS RemoveGhostData RUNTIME DESTINATION bin) -endif() +ogs_add_executable( + RemoveGhostData RemoveGhostData.cpp + ${PROJECT_SOURCE_DIR}/ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp +) +target_include_directories( + RemoveGhostData PRIVATE ${PROJECT_SOURCE_DIR}/ThirdParty/paraview +) +target_link_libraries( + RemoveGhostData GitInfoLib MeshLib tclap VTK::FiltersParallel +) +install(TARGETS RemoveGhostData RUNTIME DESTINATION bin) foreach(tool ${TOOLS}) ogs_add_executable(${tool} ${tool}.cpp) diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt b/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt index 06d2e80887c5b24e2e032a9ed74056c0ab1acbf3..00a0b5489c77e70cf2b2e58bf74c3ec17cc21476 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt +++ b/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt @@ -4,7 +4,7 @@ if(OGS_USE_MPI) ) target_link_libraries( binaryToPVTU GitInfoLib MeshLib tclap - $<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX> + $<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX> VTK::ParallelMPI ) install(TARGETS binaryToPVTU RUNTIME DESTINATION bin) endif() diff --git a/Applications/Utils/OGSFileConverter/CMakeLists.txt b/Applications/Utils/OGSFileConverter/CMakeLists.txt index a0f55c5c55407440fd9bc206cb2ab74275d2bc27..640abb9fa4959c4f37ce1d7759dbbd6bc96c0092 100644 --- a/Applications/Utils/OGSFileConverter/CMakeLists.txt +++ b/Applications/Utils/OGSFileConverter/CMakeLists.txt @@ -4,7 +4,7 @@ ogs_add_library( ) target_link_libraries( OGSFileConverterLib PUBLIC ApplicationsFileIO MathLib QtBase - ${VTK_LIBRARIES} INTERFACE MeshLib + INTERFACE MeshLib ) set_target_properties(OGSFileConverterLib PROPERTIES AUTOMOC TRUE AUTOUIC TRUE) diff --git a/Applications/Utils/Tests.cmake b/Applications/Utils/Tests.cmake index 718868464173b1dbfa3e7a8a1b30730b85a051fd..cfadb610d929d580eceacea5536f6d0fe2c117bf 100644 --- a/Applications/Utils/Tests.cmake +++ b/Applications/Utils/Tests.cmake @@ -535,29 +535,27 @@ if(OGS_USE_NETCDF) ) endif() -if(OGS_BUILD_GUI) - AddTest( - NAME RemoveGhostData_Test - PATH MeshLib - WORKING_DIRECTORY ${Data_SOURCE_DIR}/MeshLib - EXECUTABLE RemoveGhostData - EXECUTABLE_ARGS -i Mesh3D.pvtu -o ${Data_BINARY_DIR}/MeshLib/RemoveGhostDataOutput.vtu - TESTER vtkdiff - DIFF_DATA - RemoveGhostDataOutput.vtu RemoveGhostDataOutput.vtu slice slice 0 0 - ) +AddTest( + NAME RemoveGhostData_Test + PATH MeshLib + WORKING_DIRECTORY ${Data_SOURCE_DIR}/MeshLib + EXECUTABLE RemoveGhostData + EXECUTABLE_ARGS -i Mesh3D.pvtu -o ${Data_BINARY_DIR}/MeshLib/RemoveGhostDataOutput.vtu + TESTER vtkdiff + DIFF_DATA + RemoveGhostDataOutput.vtu RemoveGhostDataOutput.vtu slice slice 0 0 +) - AddTest( - NAME RemoveGhostData_EllipticSquareTest - PATH EllipticPETSc - WORKING_DIRECTORY ${Data_SOURCE_DIR}/EllipticPETSc - EXECUTABLE RemoveGhostData - EXECUTABLE_ARGS -i square_1e1_neumann_ts_1_t_1_000000.pvtu -o ${Data_BINARY_DIR}/EllipticPETSc/square_1e1_neumann_ts_1_t_1_000000.vtu - TESTER diff - DIFF_DATA - square_1e1_neumann_ts_1_t_1_000000.vtu - ) -endif() +AddTest( + NAME RemoveGhostData_EllipticSquareTest + PATH EllipticPETSc + WORKING_DIRECTORY ${Data_SOURCE_DIR}/EllipticPETSc + EXECUTABLE RemoveGhostData + EXECUTABLE_ARGS -i square_1e1_neumann_ts_1_t_1_000000.pvtu -o ${Data_BINARY_DIR}/EllipticPETSc/square_1e1_neumann_ts_1_t_1_000000.vtu + TESTER diff + DIFF_DATA + square_1e1_neumann_ts_1_t_1_000000.vtu +) AddTest( NAME Raster2Mesh_Elevation_Test diff --git a/MeshLib/CMakeLists.txt b/MeshLib/CMakeLists.txt index 905236e8e0719578c25fdacd85e9e5000bb3a0ca..2c4a8a83ca037fb4342de403df56d4967af4ee51 100644 --- a/MeshLib/CMakeLists.txt +++ b/MeshLib/CMakeLists.txt @@ -38,14 +38,14 @@ target_link_libraries( GitInfoLib ${HDF5_LIBRARIES} MathLib - ${VTK_LIBRARIES} + VTK::IOXML + VTK::IOLegacy + $<$<TARGET_EXISTS:VTK::IOParallelXML>:VTK::IOParallelXML> $<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX> $<$<TARGET_EXISTS:petsc>:petsc> ) -target_include_directories( - MeshLib PUBLIC ${VTK_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} -) +target_include_directories(MeshLib PUBLIC ${HDF5_INCLUDE_DIRS}) target_compile_definitions( MeshLib diff --git a/ProcessLib/PhaseField/Tests.cmake b/ProcessLib/PhaseField/Tests.cmake index 90454b5856a5b2867b6fc38dfa88fe8c251fabb6..cd2e65304cb152a0a592d83eb44b1f2ed96b4b5b 100644 --- a/ProcessLib/PhaseField/Tests.cmake +++ b/ProcessLib/PhaseField/Tests.cmake @@ -22,7 +22,7 @@ AddTest( WRAPPER_ARGS -np 1 TESTER vtkdiff REQUIREMENTS OGS_USE_MPI - RUNTIME 18 + RUNTIME 260 DIFF_DATA expected_AT2_iso_tension_ts_10_t_1_000000_0.vtu AT2_iso_tension_ts_10_t_1_000000_0.vtu displacement displacement 1e-5 0 expected_AT2_iso_tension_ts_10_t_1_000000_0.vtu AT2_iso_tension_ts_10_t_1_000000_0.vtu phasefield phasefield 1e-6 0 @@ -52,7 +52,7 @@ AddTest( WRAPPER_ARGS -np 2 TESTER vtkdiff REQUIREMENTS OGS_USE_MPI - RUNTIME 18 + RUNTIME 140 DIFF_DATA expected_AT1_vd_tension_2core_ts_10_t_1_000000_0.vtu AT1_vd_tension_2core_ts_10_t_1_000000_0.vtu displacement displacement 1e-5 0 expected_AT1_vd_tension_2core_ts_10_t_1_000000_1.vtu AT1_vd_tension_2core_ts_10_t_1_000000_1.vtu displacement displacement 1e-5 0 diff --git a/ProcessLib/TH2M/Tests.cmake b/ProcessLib/TH2M/Tests.cmake index 73040ab89add2710e06c14795e3653189701c5ef..ecf9700f0044c06d3c511f0385ef5b4d938bac5d 100644 --- a/ProcessLib/TH2M/Tests.cmake +++ b/ProcessLib/TH2M/Tests.cmake @@ -314,7 +314,7 @@ AddTest( AddTest( NAME Parallel_TH2M_THM_point_heatsource PATH TH2M/THM/sphere - RUNTIME 40 + RUNTIME 625 EXECUTABLE ogs EXECUTABLE_ARGS point_heatsource.prj WRAPPER mpirun @@ -369,7 +369,7 @@ AddTest( AddTest( NAME Parallel_TH2M_TH2_heat_pipe PATH TH2M/TH2/heatpipe/PETSc - RUNTIME 20 + RUNTIME 370 EXECUTABLE ogs EXECUTABLE_ARGS heat_pipe_strict.prj WRAPPER mpirun diff --git a/ProcessLib/ThermoMechanics/Tests.cmake b/ProcessLib/ThermoMechanics/Tests.cmake index 14b119d251a226d89d2a3b5debe8b1eb32d0ca36..288b6f7b382ad72f1e62d246a2ca5b36c36d5449 100644 --- a/ProcessLib/ThermoMechanics/Tests.cmake +++ b/ProcessLib/ThermoMechanics/Tests.cmake @@ -308,7 +308,7 @@ AddTest( DIFF_DATA CreepAfterExcavation_ts_61_t_4320000.000000.vtu CreepAfterExcavation_ts_61_t_4320000.000000.vtu sigma sigma 5e-6 0 CreepAfterExcavation_ts_61_t_4320000.000000.vtu CreepAfterExcavation_ts_61_t_4320000.000000.vtu epsilon epsilon 1e-15 0 - CreepAfterExcavation_ts_61_t_4320000.000000.vtu CreepAfterExcavation_ts_61_t_4320000.000000.vtu displacement displacement 1e-16 1e-9 + CreepAfterExcavation_ts_61_t_4320000.000000.vtu CreepAfterExcavation_ts_61_t_4320000.000000.vtu displacement displacement 1e-16 2e-9 ) # Basic test that MFront models work for TM. diff --git a/ProcessLib/ThermoRichardsMechanics/Tests.cmake b/ProcessLib/ThermoRichardsMechanics/Tests.cmake index 4243c5080846344a9c88ee1d94720ab8fe374e53..e4712e4f3728d2b1b00b03ea359de5b0748811ec 100644 --- a/ProcessLib/ThermoRichardsMechanics/Tests.cmake +++ b/ProcessLib/ThermoRichardsMechanics/Tests.cmake @@ -126,7 +126,7 @@ AddTest( AddTest( NAME ParallelFEM_ThermoRichardsMechanics_3D_ThermoElastic_Stress_Analysis PATH ThermoRichardsMechanics/Simple3DThermoMechanicsFromTM - RUNTIME 45 + RUNTIME 280 EXECUTABLE ogs EXECUTABLE_ARGS cube_1e3.prj WRAPPER mpirun @@ -169,7 +169,7 @@ AddTest( AddTest( NAME ParallelFEM_ThermoRichardsMechanics_point_heat_injection PATH ThermoRichardsMechanics/PointHeatSource - RUNTIME 45 + RUNTIME 635 EXECUTABLE ogs EXECUTABLE_ARGS point_heat_source_2D.prj WRAPPER mpirun @@ -199,7 +199,7 @@ AddTest( AddTest( NAME ParallelFEM_ThermoRichardsMechanics_point_heat_injection_gml PATH ThermoRichardsMechanics/PointHeatSource - RUNTIME 45 + RUNTIME 635 EXECUTABLE ogs EXECUTABLE_ARGS point_heat_source_2D_gml.prj WRAPPER mpirun @@ -229,7 +229,7 @@ AddTest( AddTest( NAME ParallelFEM_ThermoRichardsMechanics_TaskCDECOVALEX2023 PATH ThermoRichardsMechanics/TaskCDECOVALEX2023 - RUNTIME 30 + RUNTIME 500 EXECUTABLE ogs EXECUTABLE_ARGS Decovalex-0.prj WRAPPER mpirun diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index ad8182fbb22358a466ea3d7ce5659798d1636d7d..884fb83562ed41d8490310710e33c5a1f610e122 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -77,8 +77,9 @@ target_link_libraries( ProcessLib Processes TestInfoLib + VTK::FiltersGeneral + VTK::FiltersSources $<$<TARGET_EXISTS:Threads::Threads>:Threads::Threads> - ${VTK_LIBRARIES} $<$<TARGET_EXISTS:LIE>:LIE> $<$<TARGET_EXISTS:TH2M>:TH2M> $<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX> @@ -98,6 +99,7 @@ if(OGS_BUILD_GUI) Qt5::Network VtkVisFilter QtDataView + VTK::IOImage ) if(GEOTIFF_FOUND) target_link_libraries(testrunner PRIVATE ${GEOTIFF_LIBRARIES}) diff --git a/Tests/Data/MeshLib/Mesh3D-B.vtu b/Tests/Data/MeshLib/Mesh3D-B.vtu index 859806c8bd4f5a11f0a9ef7feeff967b68fc0a2a..59e2b8e71cd0d44bfb1dd6293d7bd91225c6ab6f 100644 --- a/Tests/Data/MeshLib/Mesh3D-B.vtu +++ b/Tests/Data/MeshLib/Mesh3D-B.vtu @@ -5,7 +5,7 @@ <PointData> </PointData> <CellData> - <DataArray type="UInt8" Name="vtkGhostTypeT" format="ascii" RangeMin="0" RangeMax="1"> + <DataArray type="UInt8" Name="vtkGhostType" format="ascii" RangeMin="0" RangeMax="1"> 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 diff --git a/Tests/Data/TH2M/HM/flow_fully_saturated.prj b/Tests/Data/TH2M/HM/flow_fully_saturated.prj index 7437c22d77d84bbbb4dc1863f14ad29b775696c1..f308c90791cf6596e2da40e594c5e7697cf81398 100644 --- a/Tests/Data/TH2M/HM/flow_fully_saturated.prj +++ b/Tests/Data/TH2M/HM/flow_fully_saturated.prj @@ -463,14 +463,14 @@ <vtkdiff> <regex>flow_fully_saturated_ts_.*.vtu</regex> <field>liquid_density</field> - <absolute_tolerance>2e-15</absolute_tolerance> - <relative_tolerance>1e-15</relative_tolerance> + <absolute_tolerance>3e-15</absolute_tolerance> + <relative_tolerance>3e-15</relative_tolerance> </vtkdiff> <vtkdiff> <regex>flow_fully_saturated_ts_.*.vtu</regex> <field>gas_density</field> - <absolute_tolerance>2e-15</absolute_tolerance> - <relative_tolerance>1e-15</relative_tolerance> + <absolute_tolerance>3e-15</absolute_tolerance> + <relative_tolerance>3e-15</relative_tolerance> </vtkdiff> <vtkdiff> <regex>flow_fully_saturated_ts_.*.vtu</regex> diff --git a/Tests/Data/TH2M/HM/flow_fully_saturated_gas.prj b/Tests/Data/TH2M/HM/flow_fully_saturated_gas.prj index af0ac7688b01921b776c5186e64856c374d5c64c..8cad62f4818f658254fc950ed8b3ad06fbf292a3 100644 --- a/Tests/Data/TH2M/HM/flow_fully_saturated_gas.prj +++ b/Tests/Data/TH2M/HM/flow_fully_saturated_gas.prj @@ -458,14 +458,14 @@ <vtkdiff> <regex>flow_fully_saturated_gas_ts_.*.vtu</regex> <field>liquid_density</field> - <absolute_tolerance>2e-15</absolute_tolerance> - <relative_tolerance>1e-15</relative_tolerance> + <absolute_tolerance>3e-15</absolute_tolerance> + <relative_tolerance>3e-15</relative_tolerance> </vtkdiff> <vtkdiff> <regex>flow_fully_saturated_gas_ts_.*.vtu</regex> <field>gas_density</field> - <absolute_tolerance>2e-15</absolute_tolerance> - <relative_tolerance>1e-15</relative_tolerance> + <absolute_tolerance>3e-15</absolute_tolerance> + <relative_tolerance>3e-15</relative_tolerance> </vtkdiff> <vtkdiff> <regex>flow_fully_saturated_gas_ts_.*.vtu</regex> diff --git a/Tests/Data/TH2M/THM/Confined_Compression/THM_confined_compression_gas.prj b/Tests/Data/TH2M/THM/Confined_Compression/THM_confined_compression_gas.prj index 81e191f94a032ac7b46fdf1572db4109ef1e374e..55ed93e1dafc250d1771b793284d3a1195ab849a 100644 --- a/Tests/Data/TH2M/THM/Confined_Compression/THM_confined_compression_gas.prj +++ b/Tests/Data/TH2M/THM/Confined_Compression/THM_confined_compression_gas.prj @@ -446,7 +446,7 @@ <vtkdiff> <regex>THM_confined_compression_gas_ts_.*.vtu</regex> <field>gas_pressure_interpolated</field> - <absolute_tolerance>8e-12</absolute_tolerance> + <absolute_tolerance>9e-12</absolute_tolerance> <relative_tolerance>0.</relative_tolerance> </vtkdiff> <vtkdiff> @@ -464,7 +464,7 @@ <vtkdiff> <regex>THM_confined_compression_gas_ts_.*.vtu</regex> <field>displacement</field> - <absolute_tolerance>1e-12</absolute_tolerance> + <absolute_tolerance>2e-12</absolute_tolerance> <relative_tolerance>0.</relative_tolerance> </vtkdiff> <vtkdiff> diff --git a/Tests/MathLib/Polynomials.h b/Tests/MathLib/Polynomials.h index bf68858deeb1698e62a30926ed4ad672c903e0a3..e0372d375abb7c455114e2a88c87e4c15c09837f 100644 --- a/Tests/MathLib/Polynomials.h +++ b/Tests/MathLib/Polynomials.h @@ -40,8 +40,10 @@ public: virtual double getAnalyticalIntegralOverUnitCube() const = 0; - operator Function() const + Function toFunction() const { + // Note: this is captured, hence the caller is responsible that 'this' + // is alive as long as the returned function is used. return [this](std::array<double, 3> const& coords) { return (*this)(coords); }; } diff --git a/Tests/MathLib/TestGaussLegendreIntegration.cpp b/Tests/MathLib/TestGaussLegendreIntegration.cpp index 653ac0bd3766257e5d4e4777acb90bfeef5beed2..31c3f2e083027179ffb3c251c245f7ce3ad85468 100644 --- a/Tests/MathLib/TestGaussLegendreIntegration.cpp +++ b/Tests/MathLib/TestGaussLegendreIntegration.cpp @@ -413,7 +413,7 @@ static void mathLibIntegrationGaussLegendreTestImpl( auto const analytical_integral = f->getAnalyticalIntegralOverUnitCube(); - auto const numerical_integral = pcs.integrate(*f); + auto const numerical_integral = pcs.integrate(f->toFunction()); EXPECT_NEAR(analytical_integral, numerical_integral, eps) << "integration order: " << integration_order << "\npolynomial order: " << polynomial_order // diff --git a/ThirdParty/container-maker b/ThirdParty/container-maker index ce25b94f647ad77c420182158cb4376804d9a70f..c0ff4f23541a20fef7af6a3e6c5f74bcfff45073 160000 --- a/ThirdParty/container-maker +++ b/ThirdParty/container-maker @@ -1 +1 @@ -Subproject commit ce25b94f647ad77c420182158cb4376804d9a70f +Subproject commit c0ff4f23541a20fef7af6a3e6c5f74bcfff45073 diff --git a/scripts/ci/jobs/build-linux.yml b/scripts/ci/jobs/build-linux.yml index cda1f7e7d615b67a5c08d74c2289ab961eb63822..9c7acc60b1da9ce7f159669776217b6bee182dbf 100644 --- a/scripts/ci/jobs/build-linux.yml +++ b/scripts/ci/jobs/build-linux.yml @@ -94,7 +94,7 @@ build linux debug with sanitizers: UBSAN_OPTIONS: "print_stacktrace=1" LSAN_OPTIONS: "suppressions=$CI_PROJECT_DIR/scripts/test/leak_sanitizer.suppressions" -build linux ubuntu: +.build linux ubuntu: # Temporary disabled until node is updated extends: - .template-build-linux - .test-artifacts diff --git a/scripts/ci/jobs/check-header.yml b/scripts/ci/jobs/check-header.yml index 3184cee8bfc9523e15341f83d30dd084efb3f3e2..da6b8dfac5fb418d6e0f1043924e79aee3be02c8 100644 --- a/scripts/ci/jobs/check-header.yml +++ b/scripts/ci/jobs/check-header.yml @@ -3,7 +3,8 @@ check header: allow_failure: true extends: - .rules-master-manual - needs: [meta, ci_images] + needs: [ meta ] + tags: [ envinf ] variables: BUILD_DIR: "../build/check-header" CMAKE_ARGS: >- @@ -11,7 +12,6 @@ check header: -DOGS_BUILD_GUI=ON -DBUILD_SHARED_LIBS=OFF -DOGS_BUILD_PYTHON_MODULE=OFF - image: $CONTAINER_GCC_GUI_IMAGE script: - rm -rf $BUILD_DIR - mkdir -p $BUILD_DIR diff --git a/scripts/ci/jobs/ci_images.yml b/scripts/ci/jobs/ci_images.yml index 19bff9d70b7c5d6a57ae0520127184691ff3397e..d3a69ac5a1f4f0d918d47bb860011982206a06be 100644 --- a/scripts/ci/jobs/ci_images.yml +++ b/scripts/ci/jobs/ci_images.yml @@ -42,17 +42,21 @@ ci_images: - !reference [.container-maker-setup, before_script] - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - poetry run ogscm compiler.py ogs.py --build --ogs off + --compiler_version 11 --pm system --cvode --cppcheck --docs --gcovr --mfront --ccache --version_file ../../web/data/versions.json --tag $CONTAINER_GCC_IMAGE --upload --cpu-target $CPU_TARGET + --packages build-essential - poetry run ogscm compiler.py ogs.py --build --ogs off + --compiler_version 11 --cvode --cppcheck --docs --gcovr --gui --ccache --version_file ../../web/data/versions.json --tag $CONTAINER_GCC_GUI_IMAGE --upload --cpu-target $CPU_TARGET + --packages build-essential - poetry run ogscm compiler.py ogs.py --build --ogs off - --compiler clang --compiler_version 9 --ccache + --compiler clang --compiler_version 11 --ccache --version_file ../../web/data/versions.json --tag $CONTAINER_CLANG_IMAGE --upload --cpu-target $CPU_TARGET diff --git a/scripts/ci/jobs/code-quality.yml b/scripts/ci/jobs/code-quality.yml index 58b21d27a99d388859bf63aee74eba5824dfeee8..5e2b1168a0bd922cd99a8c61982d59162ca37eb8 100644 --- a/scripts/ci/jobs/code-quality.yml +++ b/scripts/ci/jobs/code-quality.yml @@ -1,7 +1,7 @@ cppcheck: stage: check - image: $CONTAINER_GCC_IMAGE - needs: [ci_images, meta] + needs: [ meta ] + tags: [ envinf ] before_script: - mkdir -p build - cd build diff --git a/scripts/ci/jobs/jupyter.yml b/scripts/ci/jobs/jupyter.yml index b438e38005337465ea655428701846b1699b0d19..1f152d5844f81f9588abdb984b8de112440f9b11 100644 --- a/scripts/ci/jobs/jupyter.yml +++ b/scripts/ci/jobs/jupyter.yml @@ -16,25 +16,30 @@ build jupyter: export DOCKER_TAG_JUPYTER="ci-$CI_PROJECT_NAME-$CI_COMMIT_BRANCH-serial-jupyter:latest" export DOCKER_TAG_JUPYTER_PETSC="ci-$CI_PROJECT_NAME-$CI_COMMIT_BRANCH-petsc-jupyter:latest" fi - # Jupyter container - # TODO: use Tests/Date/Notebooks/requirements.txt in ogs_jupyter.py - # TODO: or better: migrate requirements.txt to versions.json + ### Jupyter container ### + # Build base image for 22.04 + - | + rm -rf docker-stacks + git clone https://github.com/jupyter/docker-stacks.git + cd docker-stacks/base-notebook + docker build --build-arg ROOT_CONTAINER=ubuntu:22.04 -t jupyter/base-notebook:22.04 . + cd ../.. - > poetry run ogscm compiler.py ogs.py ogs_jupyter.py -B -R --ogs ../.. --build_args ' --progress=plain' - --cvode --ccache --mfront + --cvode --ccache --cpmcache --mfront --cpu-target $CPU_TARGET --cmake_args ' -DOGS_CPU_ARCHITECTURE=OFF -DOGS_BUILD_TESTING=OFF' - --runtime_base_image 'jupyter/base-notebook' + --runtime_base_image 'jupyter/base-notebook:22.04' --tag $DOCKER_TAG_JUPYTER $ON_MASTER_ARGS - > poetry run ogscm compiler.py mpi.py ogs.py ogs_jupyter.py -B -R --ogs ../.. --build_args ' --progress=plain' - --cvode --ccache --mfront + --cvode --ccache --cpmcache --mfront --cpu-target $CPU_TARGET --cmake_args ' -DOGS_CPU_ARCHITECTURE=OFF -DOGS_BUILD_TESTING=OFF' - --runtime_base_image 'jupyter/base-notebook' + --runtime_base_image 'jupyter/base-notebook:22.04' --mpi_no_entrypoint --tag $DOCKER_TAG_JUPYTER_PETSC $ON_MASTER_ARGS diff --git a/scripts/cmake/CheckHeaderCompilation.cmake b/scripts/cmake/CheckHeaderCompilation.cmake index efe12f7dae7f29a86880febf022519a0d600f844..f012afe8a64f127c208b60a75c109a45cbee60de 100644 --- a/scripts/cmake/CheckHeaderCompilation.cmake +++ b/scripts/cmake/CheckHeaderCompilation.cmake @@ -116,6 +116,19 @@ function(_check_header_compilation target) if("${file}" MATCHES "ui_.*\\.h") # Ignore Qt-generated ui files continue() endif() + if("${file}" MATCHES "MeshItem|ModelTreeItem") + # These files have transitive vtk includes, see below. + message(STATUS "Ignoring ${file} due to (transitive) vtk include.") + continue() + endif() + + file(READ "${file}" file_contents LIMIT 8000) + # Ignore files including vtk. There is no easy way to get all required + # VTK include directories with the vtk 9 module system. + if("${file_contents}" MATCHES "#include <vtk") + message(STATUS "Ignoring ${file} due to vtk include.") + continue() + endif() string(REPLACE "${PROJECT_SOURCE_DIR}/" "" TEST_NAME ${file}) string(REPLACE "." "_" TEST_NAME ${TEST_NAME}) diff --git a/scripts/cmake/CppCheck.cmake b/scripts/cmake/CppCheck.cmake index 0231abc0b3ab24ea0c6b72adf5588d83c62a412a..5ce9cf0c5399380f59a4923d6c85a3550896715c 100644 --- a/scripts/cmake/CppCheck.cmake +++ b/scripts/cmake/CppCheck.cmake @@ -8,6 +8,12 @@ if(DEFINED ENV{CMAKE_BUILD_PARALLEL_LEVEL}) elseif(DEFINED CMAKE_BUILD_PARALLEL_LEVEL) set(CPPCHECK_PARALLEL ${CMAKE_BUILD_PARALLEL_LEVEL}) endif() +if(DEFINED CPM_SOURCE_CACHE) + set(_cpp_check_ingore "-i${CPM_SOURCE_CACHE}") +else() + set(_cpp_check_ingore "-i${PROJECT_BINARY_DIR}/_deps") +endif() + configure_file( ${PROJECT_SOURCE_DIR}/scripts/test/cppcheck.in.sh ${PROJECT_BINARY_DIR}/cppcheck.sh diff --git a/scripts/cmake/Dependencies.cmake b/scripts/cmake/Dependencies.cmake index d570ab0481419481d7389f7d18c7644c05755da0..387be3631fcaf915545f466d509663cc8dbac8f1 100644 --- a/scripts/cmake/Dependencies.cmake +++ b/scripts/cmake/Dependencies.cmake @@ -50,17 +50,6 @@ if(OGS_BUILD_TESTING) endif() endif() -CPMAddPackage( - NAME exprtk - GIT_REPOSITORY https://gitlab.opengeosys.org/ogs/libs/exprtk.git - GIT_TAG 2a5c62b93c9661470e69be572f22d821308b6f61 - DOWNLOAD_ONLY YES -) -if(exprtk_ADDED) - add_library(exprtk INTERFACE IMPORTED) - target_include_directories(exprtk SYSTEM INTERFACE ${exprtk_SOURCE_DIR}) -endif() - CPMFindPackage(NAME spdlog GITHUB_REPOSITORY gabime/spdlog VERSION 1.8.2) CPMFindPackage( @@ -178,121 +167,6 @@ CPMAddPackage( OPTIONS "BUILD_SHARED_LIBS OFF" ) -if(OGS_USE_MPI) - set(_hdf5_options "HDF5_ENABLE_PARALLEL ON") -endif() - -string(REPLACE "." "_" HDF5_TAG ${ogs.minimum_version.hdf5}) -if(OGS_USE_NETCDF) - list(APPEND CMAKE_MODULE_PATH ${PROJECT_BINARY_DIR}) - find_package(HDF5 REQUIRED) -else() - # ZLIB is a HDF5 dependency - CPMFindPackage( - NAME ZLIB - GITHUB_REPOSITORY madler/zlib - VERSION 1.2.11 - EXCLUDE_FROM_ALL YES - ) - - CPMFindPackage( - NAME HDF5 - GITHUB_REPOSITORY HDFGroup/hdf5 - GIT_TAG hdf5-${HDF5_TAG} - VERSION ${ogs.minimum_version.hdf5} - OPTIONS "HDF5_EXTERNALLY_CONFIGURED 1" - "HDF5_GENERATE_HEADERS OFF" - "HDF5_BUILD_TOOLS OFF" - "HDF5_BUILD_EXAMPLES OFF" - "HDF5_BUILD_HL_LIB OFF" - "HDF5_BUILD_FORTRAN OFF" - "HDF5_BUILD_CPP_LIB OFF" - "HDF5_BUILD_JAVA OFF" - ${_hdf5_options} - EXCLUDE_FROM_ALL YES - ) - if(HDF5_ADDED) - list(APPEND DISABLE_WARNINGS_TARGETS hdf5-static) - set(HDF5_LIBRARIES hdf5-static) - if(ZLIB_ADDED) - list(APPEND HDF5_LIBRARIES zlibstatic) - endif() - set(HDF5_INCLUDE_DIRS ${HDF5_SOURCE_DIR}/src ${HDF5_BINARY_DIR}) - set(HDF5_C_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS}) - set(HDF5_C_INCLUDE_DIR ${HDF5_INCLUDE_DIRS}) - target_include_directories(hdf5-static INTERFACE ${HDF5_INCLUDE_DIRS}) - if(OGS_USE_MKL AND WIN32) - # In this case the hdf5 build fails with, e.g.: - # ~~~ - # H5system.c(710): error C2065: 'timezone': undeclared identifier - # ~~~ - # Reason is that the H5_HAVE_VISUAL_STUDIO-symbol is not defined - # anymore!? - target_compile_definitions( - hdf5-static PRIVATE -DH5_HAVE_VISUAL_STUDIO - ) - endif() - else() - find_package(HDF5 REQUIRED) - endif() -endif() - -if(OGS_USE_PETSC AND NOT HDF5_ADDED) - include(CheckCXXSymbolExists) - set(CMAKE_REQUIRED_INCLUDES "${HDF5_INCLUDE_DIR}" "${HDF5_BINARY_DIR}") - set(CMAKE_REQUIRED_LIBRARIES "${HDF5_LIBRARIES}") - check_cxx_symbol_exists(H5Pset_fapl_mpio hdf5.h HAVE_H5Pset_fapl_mpio) - unset(CMAKE_REQUIRED_INCLUDES) - if(NOT HAVE_H5Pset_fapl_mpio) - message(FATAL_ERROR "HDF5 was not build with MPI support! " - "(Enable with HDF5_ENABLE_PARALLEL)" - ) - endif() -endif() - -# Does not compile in Debug-mode, see #3175. -if(CMAKE_BUILD_TYPE STREQUAL "Release" AND OGS_BUILD_TESTING) - set(XDMF_LIBNAME OgsXdmf CACHE STRING "") - CPMAddPackage( - NAME xdmf - VERSION 3.0.0 - GIT_REPOSITORY https://gitlab.opengeosys.org/ogs/xdmflib.git - GIT_TAG 92a851f1acb87ad5367eb62f9b97785bedb700bb - OPTIONS "XDMF_LIBNAME OgsXdmf" - EXCLUDE_FROM_ALL YES - ) - if(xdmf_ADDED) - target_include_directories( - OgsXdmf PUBLIC ${xdmf_SOURCE_DIR} ${xdmf_BINARY_DIR} - ) - - target_link_libraries(OgsXdmf Boost::boost) - target_include_directories( - OgsXdmfCore PUBLIC ${xdmf_SOURCE_DIR}/core ${xdmf_BINARY_DIR}/core - PRIVATE ${xdmf_SOURCE_DIR}/CMake/VersionSuite - ) - target_link_libraries( - OgsXdmfCore PUBLIC Boost::boost LibXml2::LibXml2 ${HDF5_LIBRARIES} - ) - - set_target_properties( - OgsXdmf OgsXdmfCore - PROPERTIES RUNTIME_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR} - LIBRARY_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} - ARCHIVE_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} - ) - if(BUILD_SHARED_LIBS) - install(TARGETS OgsXdmf OgsXdmfCore - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) - endif() - list(APPEND DISABLE_WARNINGS_TARGETS OgsXdmf OgsXdmfCore) - endif() -endif() - if(OGS_BUILD_SWMM) CPMAddPackage( NAME SWMMInterface GITHUB_REPOSITORY ufz/SwmmInterface @@ -392,27 +266,24 @@ foreach(option_index ${ogs.libraries.vtk.options}) ) list(APPEND VTK_OPTIONS ${cmake_option}) endforeach() - endif() endforeach() +list(REMOVE_DUPLICATES VTK_OPTIONS) # TODO: if(OGS_INSITU) find_package(ParaView REQUIRED) end() unset(VTK_COMPONENTS) foreach(opt ${VTK_OPTIONS}) - if("${opt}" MATCHES "^Module_(.*) ON") + if("${opt}" MATCHES "^VTK_MODULE_ENABLE_VTK_(.*) YES") list(APPEND VTK_COMPONENTS ${CMAKE_MATCH_1}) endif() endforeach() find_package(VTK ${ogs.minimum_version.vtk} QUIET COMPONENTS ${VTK_COMPONENTS}) -if(VTK_FOUND) - include(${VTK_USE_FILE}) -else() +if(NOT VTK_FOUND) list(APPEND VTK_OPTIONS "BUILD_SHARED_LIBS OFF") - # Workaround for configuration error in [vtk]/CMake/vtkGroups.cmake:43 - set(VTK_Group_Rendering OFF CACHE BOOL "") - set(VTK_Group_StandAlone OFF CACHE BOOL "") + set(VTK_GROUP_ENABLE_Rendering DONT_WANT CACHE STRING "") + set(VTK_GROUP_ENABLE_StandAlone DONT_WANT CACHE STRING "") CPMAddPackage( NAME VTK @@ -421,23 +292,165 @@ else() OPTIONS ${VTK_OPTIONS} EXCLUDE_FROM_ALL YES GIT_SUBMODULES "" # Disable submodules ) - include(${VTK_BINARY_DIR}/VTKConfig.cmake) endif() -if(VTK_ADDED AND OpenMP_FOUND AND TARGET vtkFiltersStatistics) - target_link_libraries(vtkFiltersStatistics PRIVATE OpenMP::OpenMP_C) +if(VTK_ADDED) + if(OpenMP_FOUND AND TARGET vtkFiltersStatistics) + target_link_libraries(vtkFiltersStatistics PRIVATE OpenMP::OpenMP_C) + endif() + if(TARGET loguru) + # Fixes https://stackoverflow.com/questions/9894961 on vismac05: + set_target_properties(loguru PROPERTIES CXX_VISIBILITY_PRESET default) + # Also suppress warnings + list(APPEND DISABLE_WARNINGS_TARGETS loguru) + endif() endif() # end VTK ### +if(VTK_ADDED) + # VTK already comes with exprtk, reusing it. + target_include_directories( + exprtk SYSTEM INTERFACE ${VTK_SOURCE_DIR}/ThirdParty/exprtk/vtkexprtk + ) +else() + CPMAddPackage( + NAME exprtk + GIT_REPOSITORY https://gitlab.opengeosys.org/ogs/libs/exprtk.git + GIT_TAG 2a5c62b93c9661470e69be572f22d821308b6f61 + DOWNLOAD_ONLY YES + ) + if(exprtk_ADDED) + add_library(exprtk INTERFACE IMPORTED) + target_include_directories(exprtk SYSTEM INTERFACE ${exprtk_SOURCE_DIR}) + endif() +endif() + if(OGS_BUILD_TESTING OR OGS_BUILD_UTILS) CPMAddPackage( NAME vtkdiff GITHUB_REPOSITORY ufz/vtkdiff - GIT_TAG aa76480b883572e42dbc3c088729006a888e79eb + GIT_TAG 788100291f73e472febf7e5550eea36ec4be518b ) if(vtkdiff_ADDED) install(PROGRAMS $<TARGET_FILE:vtkdiff> DESTINATION bin) endif() endif() +if(OGS_USE_MPI) + set(_hdf5_options "HDF5_ENABLE_PARALLEL ON") +endif() + +string(REPLACE "." "_" HDF5_TAG ${ogs.minimum_version.hdf5}) +if(OGS_USE_NETCDF) + list(APPEND CMAKE_MODULE_PATH ${PROJECT_BINARY_DIR}) + find_package(HDF5 REQUIRED) +else() + # ZLIB is a HDF5 dependency + if(NOT VTK_ADDED) + CPMFindPackage( + NAME ZLIB + GITHUB_REPOSITORY madler/zlib + VERSION 1.2.11 + EXCLUDE_FROM_ALL YES + ) + endif() + + CPMFindPackage( + NAME HDF5 + GITHUB_REPOSITORY HDFGroup/hdf5 + GIT_TAG hdf5-${HDF5_TAG} + VERSION ${ogs.minimum_version.hdf5} + OPTIONS "HDF5_EXTERNALLY_CONFIGURED 1" + "HDF5_GENERATE_HEADERS OFF" + "HDF5_BUILD_TOOLS OFF" + "HDF5_BUILD_EXAMPLES OFF" + "HDF5_BUILD_HL_LIB OFF" + "HDF5_BUILD_FORTRAN OFF" + "HDF5_BUILD_CPP_LIB OFF" + "HDF5_BUILD_JAVA OFF" + ${_hdf5_options} + EXCLUDE_FROM_ALL YES + ) + if(HDF5_ADDED) + list(APPEND DISABLE_WARNINGS_TARGETS hdf5-static) + set(HDF5_LIBRARIES hdf5-static) + if(ZLIB_ADDED) + list(APPEND HDF5_LIBRARIES zlibstatic) + endif() + set(HDF5_INCLUDE_DIRS ${HDF5_SOURCE_DIR}/src ${HDF5_BINARY_DIR}) + set(HDF5_C_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS}) + set(HDF5_C_INCLUDE_DIR ${HDF5_INCLUDE_DIRS}) + target_include_directories(hdf5-static INTERFACE ${HDF5_INCLUDE_DIRS}) + if(OGS_USE_MKL AND WIN32) + # In this case the hdf5 build fails with, e.g.: + # ~~~ + # H5system.c(710): error C2065: 'timezone': undeclared identifier + # ~~~ + # Reason is that the H5_HAVE_VISUAL_STUDIO-symbol is not defined + # anymore!? + target_compile_definitions( + hdf5-static PRIVATE -DH5_HAVE_VISUAL_STUDIO + ) + endif() + else() + find_package(HDF5 REQUIRED) + endif() +endif() + +if(OGS_USE_PETSC AND NOT HDF5_ADDED) + include(CheckCXXSymbolExists) + set(CMAKE_REQUIRED_INCLUDES "${HDF5_INCLUDE_DIR}" "${HDF5_BINARY_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${HDF5_LIBRARIES}") + check_cxx_symbol_exists(H5Pset_fapl_mpio hdf5.h HAVE_H5Pset_fapl_mpio) + unset(CMAKE_REQUIRED_INCLUDES) + if(NOT HAVE_H5Pset_fapl_mpio) + message(FATAL_ERROR "HDF5 was not build with MPI support! " + "(Enable with HDF5_ENABLE_PARALLEL)" + ) + endif() +endif() + +# Does not compile in Debug-mode, see #3175. +if(CMAKE_BUILD_TYPE STREQUAL "Release" AND OGS_BUILD_TESTING) + set(XDMF_LIBNAME OgsXdmf CACHE STRING "") + CPMAddPackage( + NAME xdmf + VERSION 3.0.0 + GIT_REPOSITORY https://gitlab.opengeosys.org/ogs/xdmflib.git + GIT_TAG 92a851f1acb87ad5367eb62f9b97785bedb700bb + OPTIONS "XDMF_LIBNAME OgsXdmf" + EXCLUDE_FROM_ALL YES + ) + if(xdmf_ADDED) + target_include_directories( + OgsXdmf PUBLIC ${xdmf_SOURCE_DIR} ${xdmf_BINARY_DIR} + ) + + target_link_libraries(OgsXdmf Boost::boost) + target_include_directories( + OgsXdmfCore PUBLIC ${xdmf_SOURCE_DIR}/core ${xdmf_BINARY_DIR}/core + PRIVATE ${xdmf_SOURCE_DIR}/CMake/VersionSuite + ) + target_link_libraries( + OgsXdmfCore PUBLIC Boost::boost LibXml2::LibXml2 ${HDF5_LIBRARIES} + ) + + set_target_properties( + OgsXdmf OgsXdmfCore + PROPERTIES RUNTIME_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR} + LIBRARY_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} + ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} + ) + if(BUILD_SHARED_LIBS) + install(TARGETS OgsXdmf OgsXdmfCore + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endif() + list(APPEND DISABLE_WARNINGS_TARGETS OgsXdmf OgsXdmfCore) + endif() +endif() + if(OGS_BUILD_UTILS) CPMAddPackage( NAME metis diff --git a/scripts/cmake/MarkVariablesAdvanced.cmake b/scripts/cmake/MarkVariablesAdvanced.cmake index 08b4c62e6f19c1916f2b6d83a4746f241ec78032..b584964672ed6711a58d9866b28c552c4b4b06b7 100644 --- a/scripts/cmake/MarkVariablesAdvanced.cmake +++ b/scripts/cmake/MarkVariablesAdvanced.cmake @@ -35,7 +35,6 @@ mark_as_advanced( TIME_TOOL_PATH VALGRIND_TOOL_PATH VTK_DIR - VTK_LIBRARIES VTKIO_LIB_FOUND xtiff_INCLUDE_DIR ZIP_TOOL_PATH diff --git a/scripts/test/cppcheck.in.sh b/scripts/test/cppcheck.in.sh index 4e697174904e276660aea1c3cb1784d73f49895b..b119abd2e9626ef2faefc8e97c1fc7740fa1003a 100644 --- a/scripts/test/cppcheck.in.sh +++ b/scripts/test/cppcheck.in.sh @@ -7,6 +7,7 @@ ${CPPCHECK_TOOL_PATH} \ --enable=all \ --inconclusive \ -j ${CPPCHECK_PARALLEL} \ + ${_cpp_check_ingore} \ --suppress=*:*/usr/local\* \ --suppress=*:*cpm\* \ --suppress=*:*Tests\* \ diff --git a/web/content/docs/devguide/getting-started/prerequisites/index.md b/web/content/docs/devguide/getting-started/prerequisites/index.md index 0fb5fd2c9652ef46c28bda650cb994b7881a7cca..8cab2ece630dd320c547eebdbb9b25faff2d3779 100644 --- a/web/content/docs/devguide/getting-started/prerequisites/index.md +++ b/web/content/docs/devguide/getting-started/prerequisites/index.md @@ -50,42 +50,40 @@ As we use lots of features of the C++17-standard we support **Visual Studio {{< </div> <div class='linux'> -On Debian-based (e.g. Ubuntu) you need to install the `build-essential`-package (which contains the `gcc`-compiler and the `make`-tool): + +On Debian-based (we recommend using Ubuntu {{< dataFile "versions.tested_version.ubuntu" >}}) you need to install the `build-essential`-package (which contains the `gcc`-compiler and the `make`-tool): ```bash sudo apt install build-essential ``` -You need to have at least **gcc {{< dataFile "versions.minimum_version.gcc" >}}**: - -```bash -$ gcc --version -gcc (GCC) {{< dataFile "versions.minimum_version.gcc" >}}.0 -``` +You need to have at least **gcc {{< dataFile "versions.minimum_version.gcc" >}}** which you can check with `gcc --version` (Ubuntu {{< dataFile "versions.tested_version.ubuntu" >}} has already version 11). <div class='note'> -### Install a newer compiler on Ubuntu +### Install the required compiler on older Ubuntu versions -We recommend using Ubuntu {{< dataFile "versions.tested_version.ubuntu" >}} as its standard `gcc` package is already at version 9. If you are on an older Ubuntu version you can install a newer compiler from the `ubuntu-toolchain-r/test`-repository: +If you are on an older Ubuntu version you can install a newer compiler from the `ubuntu-toolchain-r/test`-repository (with the following steps e.g. you can install gcc 10.3.0 on Ubuntu 20.04): ```bash +sudo apt-get install software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update -sudo apt-get install gcc-9 g++-9 +sudo apt-get install gcc-10 +sudo apt-get install g++-10 ``` To make the newly installed compiler the default one: ```bash -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-9 +sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-10 ``` If you do not do this you have to specify the compiler during the first CMake run: ```bash -CC=gcc-9 CXX=c++-9 cmake ../ogs [more CMake options] +CC=gcc-10 CXX=c++-10 cmake ../ogs [more CMake options] ``` </div> diff --git a/web/content/docs/devguide/troubleshooting/conan/index.md b/web/content/docs/devguide/troubleshooting/conan/index.md index 4316ebcf2fe6a3a377336d4aa11e2b0e554eaae6..fba3cbb6c7c1183e57081d1a13a169d37fbccb11 100644 --- a/web/content/docs/devguide/troubleshooting/conan/index.md +++ b/web/content/docs/devguide/troubleshooting/conan/index.md @@ -57,24 +57,3 @@ ERROR: Error in system requirements ``` Please run `sudo -v` before your `cmake`-command. This will ask you for your password to let Conan install some system packages during the `cmake`-run. - -## Something went wrong during building - -On Ubuntu always use the system default gcc version! Otherwise if you use a newer compiler -than the default you may end up using incompatible Conan packages. E.g. when you use gcc 6 -on Ubuntu 16.04 (where gcc 5 is the default) Conan uses packages which are built on Ubuntu -17.10 (where gcc 6 is the default). Ubuntu 17.10 uses a newer glibc library (2.25) which -is incompatible to the glibc library on Ubuntu 16.04 (2.23). - -In this case you would get linker errors with the Conan VTK library: - -```bash -error: undefined reference to `getrandom' -.../expat/vtkexpat/lib/xmlparse.c 694 -``` - -If you still want to use your OS / compiler combination you can build the VTK Conan package on your machine. Run this one time: - -```bash -cmake . -DOGS_CONAN_BUILD=vtk -``` diff --git a/web/data/versions.json b/web/data/versions.json index 55e1a358dd4d619f34a95a923ca96eec3bbc53ff..4a342e57088fdaaf0da6e5eb9317da7934ab610d 100644 --- a/web/data/versions.json +++ b/web/data/versions.json @@ -1,6 +1,6 @@ { "minimum_version": { - "gcc": "9.1", + "gcc": "10.2.0", "clang": "9.0", "apple_clang": "12.0.0", "msvc": { @@ -15,7 +15,7 @@ "hugo": "0.64.1", "boost": "1.69.0", "eigen": "9441d94dccccd5db8d64179516fdc5b53994a047", - "vtk": "8.2.0", + "vtk": "9.1.0", "petsc": "3.16.3", "qt": "5.14.2", "python": "3.6", @@ -27,7 +27,7 @@ "gtest": "1.11.0" }, "tested_version": { - "ubuntu": "20.04", + "ubuntu": "22.04", "qt": "5.15.2", "cmake": "3.22.3" }, @@ -62,15 +62,24 @@ "ogscm": "True" }, "cmake": [ - "VTK_Group_Rendering=OFF", - "VTK_Group_StandAlone=OFF", + "VTK_GROUP_ENABLE_Rendering=DONT_WANT", + "VTK_GROUP_ENABLE_StandAlone=DONT_WANT", "BUILD_TESTING=OFF", "VTK_BUILD_EXAMPLES=OFF", "VTK_BUILD_TESTING=OFF", "VTK_ENABLE_WRAPPING=OFF", "VTK_USE_64BIT_IDS=ON", - "Module_vtkIOXML=ON", - "Module_vtkIOLegacy=ON" + "VTK_MODULE_ENABLE_VTK_IOXML=YES", + "VTK_MODULE_ENABLE_VTK_IOLegacy=YES" + ] + }, + { + "condition": { + "cmake": "OGS_BUILD_UTILS", + "ogscm": "True" + }, + "cmake": [ + "VTK_MODULE_ENABLE_VTK_FiltersParallel=YES" ] }, { @@ -79,8 +88,9 @@ "ogscm": "toolchain.CC == \"mpicc\"" }, "cmake": [ - "Module_vtkIOParallelXML=ON", - "Module_vtkParallelMPI=ON" + "VTK_MODULE_ENABLE_VTK_IOParallelXML=YES", + "VTK_MODULE_ENABLE_VTK_ParallelMPI=YES", + "VTK_USE_MPI=ON" ] }, { @@ -89,29 +99,29 @@ "ogscm": "local_args.gui" }, "cmake": [ - "Module_vtkIOExport=ON", - "Module_vtkImagingCore=ON", - "Module_vtkInteractionStyle=ON", - "Module_vtkInteractionWidgets=ON", - "Module_vtkGUISupportQt=ON", - "Module_vtkRenderingOpenGL2=ON", - "Module_vtkRenderingContextOpenGL2=ON", - "Module_vtkFiltersTexture=ON", - "Module_vtkRenderingAnnotation=ON", - "Module_vtkRenderingCore=ON", - "Module_vtkFiltersParallel=ON" + "VTK_MODULE_ENABLE_VTK_IOExport=YES", + "VTK_MODULE_ENABLE_VTK_ImagingCore=YES", + "VTK_MODULE_ENABLE_VTK_InteractionStyle=YES", + "VTK_MODULE_ENABLE_VTK_InteractionWidgets=YES", + "VTK_MODULE_ENABLE_VTK_GUISupportQt=YES", + "VTK_MODULE_ENABLE_VTK_RenderingOpenGL2=YES", + "VTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES", + "VTK_MODULE_ENABLE_VTK_FiltersTexture=YES", + "VTK_MODULE_ENABLE_VTK_RenderingAnnotation=YES", + "VTK_MODULE_ENABLE_VTK_RenderingCore=YES", + "VTK_MODULE_ENABLE_VTK_FiltersParallel=YES" ] }, { - "condition": { - "cmake": "OGS_BUILD_TESTING", - "ogscm": "local_args.ogs == \"off\" or \"OGS_BUILD_TESTING=OFF\" not in local_args.cmake_args.capitalize()" - }, - "cmake": [ - "Module_vtkFiltersGeneral=ON", - "Module_vtkFiltersSources=ON" - ] - } + "condition": { + "cmake": "OGS_BUILD_TESTING", + "ogscm": "local_args.ogs == \"off\" or \"OGS_BUILD_TESTING=OFF\" not in local_args.cmake_args.capitalize()" + }, + "cmake": [ + "VTK_MODULE_ENABLE_VTK_FiltersGeneral=YES", + "VTK_MODULE_ENABLE_VTK_FiltersSources=YES" + ] + } ] } }