From df8912ff8a2169445997ac55a533775113547e2a Mon Sep 17 00:00:00 2001 From: "Richard M. Shaw" Date: Mon, 17 Oct 2016 07:57:16 -0500 Subject: [PATCH] Add patch to fix unit tests on big endian systems. --- Field3D-unit_test.patch | 34 ++++++++++++++++++++++++++++++++++ Field3D.spec | 5 ++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Field3D-unit_test.patch diff --git a/Field3D-unit_test.patch b/Field3D-unit_test.patch new file mode 100644 index 0000000..3e22cc6 --- /dev/null +++ b/Field3D-unit_test.patch @@ -0,0 +1,34 @@ +From fc8ec604f5cc4cafca063029adb2cdfee3107360 Mon Sep 17 00:00:00 2001 +From: Rafael Fonseca +Date: Thu, 13 Oct 2016 15:36:20 +0200 +Subject: [PATCH] Fallback to HDF5 in case of big endian architectures. + +Fixes https://github.com/imageworks/Field3D/issues/90 +--- + src/Field3DFile.cpp | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/src/Field3DFile.cpp b/src/Field3DFile.cpp +index d34d364..e6caced 100644 +--- a/src/Field3DFile.cpp ++++ b/src/Field3DFile.cpp +@@ -826,6 +826,19 @@ bool Field3DInputFile::open(const string &filename) + "In file: " + filename + " - Bad file hierarchy. "); + success = false; + } ++ catch (runtime_error &e) { ++ // HDF5 fallback ++ m_hdf5.reset(new Field3DInputFileHDF5); ++ m_hdf5Base = m_hdf5; ++ if (m_hdf5->open(filename)) { ++ // Handled. Just return. ++ return true; ++ } else { ++ Msg::print(Msg::SevWarning, ++ "In file: " + filename + ": " + string(e.what())); ++ success = false; ++ } ++ } + catch (...) { + Msg::print(Msg::SevWarning, + "In file: " + filename + " Unknown exception "); diff --git a/Field3D.spec b/Field3D.spec index 90be772..f3394e4 100644 --- a/Field3D.spec +++ b/Field3D.spec @@ -1,6 +1,6 @@ Name: Field3D Version: 1.7.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library for storing voxel data License: BSD @@ -80,6 +80,9 @@ popd %changelog +* Mon Oct 17 2016 Richard Shaw - 1.7.2-3 +- Add patch to fix unit tests on big endian systems. + * Wed Jun 29 2016 Orion Poplawski - 1.7.2-2 - Rebuild for hdf5 1.8.17