diff --git a/.gitlab/ci/docker/el7-mindeps/install_deps.sh b/.gitlab/ci/docker/el7-mindeps/install_deps.sh index 9b4f97ce96be85b8663c1f065d7ef1a180852936..55722139a926b85a9f5c7b19e894c3ee98cdc072 100755 --- a/.gitlab/ci/docker/el7-mindeps/install_deps.sh +++ b/.gitlab/ci/docker/el7-mindeps/install_deps.sh @@ -2,13 +2,39 @@ set -e +# mirrorlist.centos.org no longer exists because el7 is past end of life. +# To get packages, replace mirrorlist with baseurl and change mirror.centos.org +# to vault.centos.org. +sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo +sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo +sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo + # Install extra dependencies for VTK yum install -y --setopt=install_weak_deps=False \ bzip2 patch git-core +# To install devtools-8 and Python 3.8 via scl +yum install -y --setopt=install_weak_deps=False \ + centos-release-scl + +# Clean up additional repos configured by centos-release-scl +sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo +sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo +sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo + # Core build tools yum install -y --setopt=install_weak_deps=False \ - gcc gcc-c++ + devtoolset-8 + +yum install -y --setopt=install_weak_deps=False \ + rh-python38-python rh-python38-python-devel \ + rh-python38-python-pip rh-python38-python-numpy + +# Install a venv which provides `matplotlib` +scl enable rh-python38 -- python3 -m venv /opt/python38/venv +/opt/python38/venv/bin/pip install matplotlib +# Ignore mpi4py for now as the CI job doesn't build with MPI anyways. +# scl enable rh-python38 -- /opt/python38/venv/bin/pip install mpi4py # MPI dependencies yum install -y --setopt=install_weak_deps=False \ @@ -29,20 +55,6 @@ yum install -y --setopt=install_weak_deps=False \ tbb-devel libiodbc-devel libarchive-devel freeglut-devel sqlite-devel \ fontconfig-devel -# Python 3.8 via scl -yum install -y --setopt=install_weak_deps=False \ - centos-release-scl - -yum install -y --setopt=install_weak_deps=False \ - rh-python38-python rh-python38-python-devel \ - rh-python38-python-pip rh-python38-python-numpy - -# Install a venv which provides `matplotlib` -scl enable rh-python38 -- python3 -m venv /opt/python38/venv -/opt/python38/venv/bin/pip install matplotlib -# Ignore mpi4py for now as the CI job doesn't build with MPI anyways. -# scl enable rh-python38 -- /opt/python38/venv/bin/pip install mpi4py - # EPEL for more tools yum install -y --setopt=install_weak_deps=False \ epel-release diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 9681891dac8252a9586f45a203ab412074ba6792..fedf885256d770fbcaf22d9772e7e246a36ace6c 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -183,11 +183,11 @@ .el7_mindeps: extends: .linux - image: "kitware/vtk:ci-el7-mindeps-20231201" + image: "kitware/vtk:ci-el7-mindeps-20250116" variables: VENV_ROOT: "/opt/python38/venv" - LAUNCHER: "scl enable rh-python38 --" + LAUNCHER: "scl enable rh-python38 devtoolset-8 --" .el8_icc: extends: .linux diff --git a/CMake/vtkCompilerChecks.cmake b/CMake/vtkCompilerChecks.cmake index c4452d6dfbd2f8c236ee68970b4c193430f8c5d0..2bef073a823a07b6403097a7f0948fb8dbd10f70 100644 --- a/CMake/vtkCompilerChecks.cmake +++ b/CMake/vtkCompilerChecks.cmake @@ -1,39 +1,39 @@ -# Minimum compiler version check: GCC >= 4.8 +# Minimum compiler version check: GCC >= 8.0 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - message(FATAL_ERROR "GCC 4.8 or later is required.") + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) + message(FATAL_ERROR "GCC 8.0 or later is required.") endif () -# Minimum compiler version check: LLVM Clang >= 3.3 +# Minimum compiler version check: LLVM Clang >= 5.0 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) - message(FATAL_ERROR "LLVM Clang 3.3 or later is required.") + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + message(FATAL_ERROR "LLVM Clang 5.0 or later is required.") endif () -# Minimum compiler version check: Apple Clang >= 7.0 (Xcode 7.2.1) +# Minimum compiler version check: Apple Clang >= 10.0 (Xcode 10.2.1) if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) - message(FATAL_ERROR "Apple Clang 7.0 or later is required.") + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + message(FATAL_ERROR "Apple Clang 10.0 or later is required.") endif () -# Minimum compiler version check: Microsoft C/C++ >= 19.0 (aka VS 2015) +# Minimum compiler version check: Microsoft C/C++ >= 19.10 (aka VS 2017) if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) - message(FATAL_ERROR "Microsoft Visual Studio 2015 or later is required.") + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) + message(FATAL_ERROR "Microsoft Visual Studio 2017 or later is required.") endif () -# Minimum compiler version check: Intel C++ (ICC) >= 14 +# Minimum compiler version check: Intel C++ (ICC) >= 19 if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0) - message(FATAL_ERROR "Intel C++ (ICC) 14.0 or later is required.") + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + message(FATAL_ERROR "Intel C++ (ICC) 19.0 or later is required.") endif () -# Make sure we have C++11 enabled. -if(NOT VTK_IGNORE_CMAKE_CXX11_CHECKS) +# Make sure we have C++17 enabled. +if(NOT VTK_IGNORE_CMAKE_CXX17_CHECKS) # Needed to make sure libraries and executables not built by the - # vtkModuleMacros still have the C++11 compiler flags enabled + # vtkModuleMacros still have the C++17 compiler flags enabled # Wrap this in an escape hatch for unknown compilers - set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_EXTENSIONS False) endif() diff --git a/CMake/vtkCompilerWarningFlags.cmake b/CMake/vtkCompilerWarningFlags.cmake index 4f03b055773e740bf7572b4119540e2ee1134e2b..22975985a9084b128fd8c519626d105a004ddaed 100644 --- a/CMake/vtkCompilerWarningFlags.cmake +++ b/CMake/vtkCompilerWarningFlags.cmake @@ -1,3 +1,13 @@ +# Silence spurious -Wattribute warnings on GCC < 9.1: +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325 +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) + target_compile_options(vtkbuild + INTERFACE + "$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:C>:-Wno-attributes>>" + "$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:CXX>:-Wno-attributes>>") +endif() + # This module requires CMake 3.19 features (the `CheckCompilerFlag` # module). Just skip it for older CMake versions. if (CMAKE_VERSION VERSION_LESS "3.19") diff --git a/Common/DataModel/vtkStructuredCellArray.cxx b/Common/DataModel/vtkStructuredCellArray.cxx index 47446518d57ac0f04208e70e01390f08617f5ead..b9f1bb279f3e07e2b83cc400f92c0d3782fdf50d 100644 --- a/Common/DataModel/vtkStructuredCellArray.cxx +++ b/Common/DataModel/vtkStructuredCellArray.cxx @@ -343,11 +343,6 @@ struct vtkStructuredCellArray::vtkStructuredTCellBackend : public vtkStructuredC } }; -//------------------------------------------------------------------------------ -template <int DataDescription, bool UsePixelVoxelOrientation> -constexpr std::array<std::array<int, 8>, 3> vtkStructuredCellArray::vtkStructuredTCellBackend< - DataDescription, UsePixelVoxelOrientation>::ShiftLUT; - //------------------------------------------------------------------------------ // template instantiated for each data description template struct vtkStructuredCellArray::vtkStructuredTCellBackend<VTK_SINGLE_POINT, true>; diff --git a/Documentation/release/dev/c++17-requirement.md b/Documentation/release/dev/c++17-requirement.md new file mode 100644 index 0000000000000000000000000000000000000000..0e4531f66ccd0a721b722cbda931fdfabdfad2de --- /dev/null +++ b/Documentation/release/dev/c++17-requirement.md @@ -0,0 +1,10 @@ +## C++17 is now required for VTK + +VTK now permits C++17 language features and hence requires C++17 compiler support. The minimum required compiler versions have been updated as well. + +* Updates minimum required compilers: + * gcc 8.0 from 4.8 + * LLVM Clang 5.0 from 3.3 + * Apple Clang 10.0 from 7.0 + * MSVC 2017 from 2015 + * Intel ICC 19.0 from 14.0 diff --git a/Filters/General/CMakeLists.txt b/Filters/General/CMakeLists.txt index 6c5cbf77ccf42b63cde268b8eb49497552af9862..1b1dbab33b6651cf9a678accd9e91e886fe4ecb7 100644 --- a/Filters/General/CMakeLists.txt +++ b/Filters/General/CMakeLists.txt @@ -134,10 +134,6 @@ set(classes vtkWarpVector vtkYoungsMaterialInterface) -set(private_classes - vtkTableBasedClipCases -) - set(templates vtkJoinTables.txx) @@ -146,7 +142,6 @@ set(no_wrap_classes vtk_module_add_module(VTK::FiltersGeneral CLASSES ${classes} - PRIVATE_CLASSES ${private_classes} NOWRAP_CLASSES ${no_wrap_classes} TEMPLATES ${templates}) vtk_add_test_mangling(VTK::FiltersGeneral) diff --git a/Filters/General/vtkTableBasedClipCases.cxx b/Filters/General/vtkTableBasedClipCases.cxx deleted file mode 100644 index 0f1ea48f13363478b6bb58a1362a9044fd6f11bb..0000000000000000000000000000000000000000 --- a/Filters/General/vtkTableBasedClipCases.cxx +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen -// SPDX-FileCopyrightText: Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC -// SPDX-License-Identifier: BSD-3-Clause - -#include "vtkTableBasedClipCases.h" - -VTK_ABI_NAMESPACE_BEGIN -constexpr bool vtkTableBasedClipCasesBase::SupportedCellTypes[VTK_NUMBER_OF_CELL_TYPES]; - -constexpr uint8_t vtkTableBasedClipCasesBase::CellMaxCase[9]; - -constexpr uint8_t vtkTableBasedClipCasesBase::CellEdges[NUM_CELL_TYPES][MAX_NUM_EDGES][2]; - -constexpr int16_t vtkTableBasedClipCasesBase::CellCasesStartIndexLookUp[NUM_CELL_TYPES]; - -constexpr std::array<uint8_t, 26665> vtkTableBasedClipCases<false>::CellCases; - -constexpr std::array<uint16_t, 670> vtkTableBasedClipCases<false>::StartCellCases; - -constexpr std::array<uint8_t, 23879> vtkTableBasedClipCases<true>::CellCases; - -constexpr std::array<uint16_t, 670> vtkTableBasedClipCases<true>::StartCellCases; -VTK_ABI_NAMESPACE_END diff --git a/Filters/General/vtkTableBasedClipDataSet.cxx b/Filters/General/vtkTableBasedClipDataSet.cxx index 70be47057623cc8f43e23f966f5e0580935edbf1..9d6834e2d618421cc92f33699a7a2dead53b9d5f 100644 --- a/Filters/General/vtkTableBasedClipDataSet.cxx +++ b/Filters/General/vtkTableBasedClipDataSet.cxx @@ -486,10 +486,6 @@ struct EvaluatePoints } }; -//----------------------------------------------------------------------------- -template <typename TInputIdType, bool InsideOut> -constexpr TInputIdType EvaluatePoints<TInputIdType, InsideOut>::InsideOutValues[2]; - // 8 because of hexahedron. constexpr int MAX_CELL_SIZE = 8; diff --git a/IO/CellGrid/vtkCellGridWriter.cxx b/IO/CellGrid/vtkCellGridWriter.cxx index 48577c88d24a5db74aee6ce04ea36758877a60ee..a26b1e269a4451fe0409d5ee25d88af6f194fdcf 100644 --- a/IO/CellGrid/vtkCellGridWriter.cxx +++ b/IO/CellGrid/vtkCellGridWriter.cxx @@ -201,7 +201,7 @@ nlohmann::json serializeArrayValues(vtkAbstractArray* arr) { for (vtkIdType ii = 0; ii < arr->GetNumberOfValues(); ++ii) { - result.push_back(arr->GetVariantValue(ii).ToString()); + result.push_back(static_cast<std::string>(arr->GetVariantValue(ii).ToString())); } } return result; diff --git a/README.md b/README.md index 102f735eb1502a5e3e11269da9ba453ee468750e..2cecb0ea826b7c93348376c03ece12871af6f754 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,11 @@ In general VTK tries to be as portable as possible; the specific configurations VTK supports the following compilers: -1. GCC 4.8 or newer -2. Clang 3.3 or newer -3. Apple Clang 5.0 (from Xcode 5.0) or newer -4. Microsoft Visual Studio 2015 or newer -5. Intel 14.0 or newer +1. GCC 8.0 or newer +2. Clang 5.0 or newer +3. Apple Clang 10.0 or newer +4. Microsoft Visual Studio 2017 or newer +5. Intel 19.0 or newer VTK supports the following operating systems: