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

add workaround for FPE in vtkXMLWriter #279

Merged
merged 2 commits into from
Aug 27, 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
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ list(APPEND build_list silo )


set(RAJA_DIR "${CMAKE_INSTALL_PREFIX}/raja")
set(RAJA_URL "${TPL_MIRROR_DIR}/RAJA-v2024.02.2.tar.gz")
set(RAJA_URL "${TPL_MIRROR_DIR}/RAJA-v2024.07.0.tar.gz")


message(STATUS "Building RAJA found at ${RAJA_URL}")
Expand Down Expand Up @@ -370,7 +370,7 @@ list(APPEND build_list raja )
# CHAI
################################
set(CHAI_DIR "${CMAKE_INSTALL_PREFIX}/chai")
set(CHAI_URL "${TPL_MIRROR_DIR}/chai-2024.02.2.tar.gz")
set(CHAI_URL "${TPL_MIRROR_DIR}/chai-2024.07.0.tar.gz")
message(STATUS "Building CHAI found at ${CHAI_URL}")

ExternalProject_Add( chai
Expand Down Expand Up @@ -1133,7 +1133,7 @@ endif( ENABLE_MPI )
PREFIX ${PROJECT_BINARY_DIR}/vtk
URL ${VTK_URL}
INSTALL_DIR ${VTK_DIR}
PATCH_COMMAND patch -p0 < ${TPL_MIRROR_DIR}/vtkXMLReader-fpe.patch
PATCH_COMMAND patch -p0 -t < ${TPL_MIRROR_DIR}/vtkXML-fpe.patch
BUILD_COMMAND ${TPL_BUILD_COMMAND}
INSTALL_COMMAND "${TPL_INSTALL_COMMAND}"
CMAKE_GENERATOR ${TPL_GENERATOR}
Expand Down
3 changes: 0 additions & 3 deletions tplMirror/RAJA-v2024.02.2.tar.gz

This file was deleted.

3 changes: 3 additions & 0 deletions tplMirror/RAJA-v2024.07.0.tar.gz
Git LFS file not shown
3 changes: 0 additions & 3 deletions tplMirror/chai-2024.02.2.tar.gz

This file was deleted.

3 changes: 3 additions & 0 deletions tplMirror/chai-2024.07.0.tar.gz
Git LFS file not shown
41 changes: 41 additions & 0 deletions tplMirror/vtkXML-fpe.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
unchanged:
--- IO/XML/vtkXMLReader.cxx 2023-02-14 20:03:53.000000000 -0800
+++ IO/XML/vtkXMLReader.cxx.patch 2023-05-12 08:52:36.017274000 -0700
@@ -53,6 +53,7 @@
#include <algorithm>
#include <cassert>
#include <cctype>
+#include <cmath>
#include <functional>
#include <locale> // C++ locale
#include <numeric>
@@ -1958,7 +1959,7 @@
if (!this->AbortExecute)
{
// Round progress to nearest 100th.
- float rounded = static_cast<float>(int((progress * 100) + 0.5f)) / 100.f;
+ float const rounded = std::round(progress * 100) * 0.01;
if (this->GetProgress() != rounded)
{
this->UpdateProgress(rounded);
only in patch2:
unchanged:
--- IO/XML/vtkXMLWriter.cxx 2023-02-14 20:03:53.000000000 -0800
+++ IO/XML/vtkXMLWriter-patch.cxx 2024-08-26 10:11:05.373719000 -0700
@@ -64,6 +64,7 @@
#include <memory>

#include <cassert>
+#include <cmath>
#include <sstream>
#include <string>

@@ -3052,7 +3053,7 @@
if (!this->AbortExecute)
{
// Round progress to nearest 100th.
- float rounded = static_cast<float>(static_cast<int>((progress * 100) + 0.5f)) / 100.f;
+ float const rounded = std::round(progress * 100) * 0.01;
if (this->GetProgress() != rounded)
{
this->UpdateProgress(rounded);
19 changes: 19 additions & 0 deletions tplMirror/vtkXMLWriter-fpe.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- vtkXMLWriter.cxx 2023-02-14 20:03:53.000000000 -0800
+++ vtkXMLWriter-patch.cxx 2024-08-26 10:11:05.373719000 -0700
@@ -64,6 +64,7 @@
#include <memory>

#include <cassert>
+#include <cmath>
#include <sstream>
#include <string>

@@ -3052,7 +3053,7 @@
if (!this->AbortExecute)
{
// Round progress to nearest 100th.
- float rounded = static_cast<float>(static_cast<int>((progress * 100) + 0.5f)) / 100.f;
+ float const rounded = std::round(progress * 100) * 0.01;
if (this->GetProgress() != rounded)
{
this->UpdateProgress(rounded);