Skip to content

Commit

Permalink
HDF5: Turn H5Vol on Again
Browse files Browse the repository at this point in the history
Changed HDF5 1.14+ H5Vol APIs are supported in ADIOS 2.9.0+
  • Loading branch information
ax3l committed Jun 5, 2023
1 parent 07b41cd commit 84024e9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 49 deletions.
70 changes: 23 additions & 47 deletions recipe/3652.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
From 4a2c67fe6e2fc4af3cbe247e9f97a1501f61e6bb Mon Sep 17 00:00:00 2001
From 9a163992131f518ccbdcd7b7155b427639ea7208 Mon Sep 17 00:00:00 2001
From: Junmin Gu <jgu@lbl.gov>
Date: Fri, 2 Jun 2023 14:03:29 -0700
Subject: [PATCH 1/2] work around with include <unistd.h> on windows
Subject: [PATCH] work around with include <unistd.h> on windows

---
source/h5vol/CMakeLists.txt | 15 +++++++++++++++
source/h5vol/CMakeLists.txt | 12 ++++++++++++
source/h5vol/H5VolReadWrite.c | 7 +++++++
2 files changed, 22 insertions(+)
2 files changed, 19 insertions(+)

diff --git a/source/h5vol/CMakeLists.txt b/source/h5vol/CMakeLists.txt
index c94593a70e..ba1baad80b 100644
index c94593a70..e8c2ce446 100644
--- a/source/h5vol/CMakeLists.txt
+++ b/source/h5vol/CMakeLists.txt
@@ -9,6 +9,21 @@ if(CMAKE_C_COMPILER_ID MATCHES "^(GNU)$")
@@ -9,6 +9,18 @@ if(CMAKE_C_COMPILER_ID MATCHES "^(GNU)$")
string(APPEND CMAKE_C_FLAGS " -Wno-format-zero-length")
endif()

+include(CheckIncludeFiles)
+check_include_files(unistd.h HAVE_UNISTD_H)
+check_include_files(windows.h HAVE_WINDOWS_H)
+
+message("- HAVE_UNISTD? ${HAVE_UNISTD_H} ")
+message("- HAVE_WINDOWS? ${HAVE_WINDOWS_H}")
+
+if (HAVE_UNISTD_H)
+ add_definitions(-DHAVE_UNISTD_H)
+endif()
Expand All @@ -35,45 +32,24 @@ index c94593a70e..ba1baad80b 100644
H5VolReadWrite.c
H5Vol.c
diff --git a/source/h5vol/H5VolReadWrite.c b/source/h5vol/H5VolReadWrite.c
index f049d9ad85..5633eaf03d 100644
index f049d9ad8..5633eaf03 100644
--- a/source/h5vol/H5VolReadWrite.c
+++ b/source/h5vol/H5VolReadWrite.c
@@ -16,7 +16,14 @@
#include "H5VolReadWrite.h"

#include "H5VolUtil.h"
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h> // sleep
+#elif defined HAVE_WINDOWS_H
+#include <windows.h>
+#define sleep(x) Sleep(1000 * (x))
+#endif
+
// these are in h5private.h
#define SUCCEED 1
#define FAIL 0

From a1a67ac6d25b510a5c3eb43118b4811bfb672118 Mon Sep 17 00:00:00 2001
From: Junmin Gu <guj@users.noreply.github.com>
Date: Sun, 4 Jun 2023 23:21:26 -0700
Subject: [PATCH 2/2] Update CMakeLists.txt, removing duplicated message()

---
source/h5vol/CMakeLists.txt | 3 ---
1 file changed, 3 deletions(-)

diff --git a/source/h5vol/CMakeLists.txt b/source/h5vol/CMakeLists.txt
index ba1baad80b..e8c2ce4461 100644
--- a/source/h5vol/CMakeLists.txt
+++ b/source/h5vol/CMakeLists.txt
@@ -13,9 +13,6 @@ include(CheckIncludeFiles)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(windows.h HAVE_WINDOWS_H)
#include "H5VolReadWrite.h"

-message("- HAVE_UNISTD? ${HAVE_UNISTD_H} ")
-message("- HAVE_WINDOWS? ${HAVE_WINDOWS_H}")
-
if (HAVE_UNISTD_H)
add_definitions(-DHAVE_UNISTD_H)
endif()
#include "H5VolUtil.h"
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h> // sleep
+#elif defined HAVE_WINDOWS_H
+#include <windows.h>
+#define sleep(x) Sleep(1000 * (x))
+#endif
+
// these are in h5private.h
#define SUCCEED 1
#define FAIL 0
--
2.34.1

1 change: 0 additions & 1 deletion recipe/build-libadios.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ cmake ^
-DADIOS2_USE_BZip2=ON ^
-DADIOS2_USE_Fortran=OFF ^
-DADIOS2_USE_HDF5=ON ^
-DADIOS2_HAVE_HDF5_VOL=OFF ^
-DADIOS2_USE_PNG=ON ^
-DADIOS2_USE_Profiling=OFF ^
-DADIOS2_USE_Python=ON ^
Expand Down
1 change: 0 additions & 1 deletion recipe/build-libadios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ cmake \
-DADIOS2_USE_Blosc=ON \
-DADIOS2_USE_BZip2=ON \
-DADIOS2_USE_HDF5=ON \
-DADIOS2_HAVE_HDF5_VOL=OFF \
-DADIOS2_USE_MPI=${USE_MPI} \
-DADIOS2_USE_PNG=ON \
-DADIOS2_USE_Python=ON \
Expand Down

0 comments on commit 84024e9

Please sign in to comment.