Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev-jhdf5-1.10.11-dynamic-recomp…
Browse files Browse the repository at this point in the history
…ilation'

# Conflicts:
#	src/main/java/ru/itmo/ctlab/hict/hict_library/chunkedfile/hdf5/HDF5LibraryInitializer.java
#	src/main/resources/libs/natives/linux_64/libh5blosc.so
#	src/main/resources/libs/natives/linux_64/libh5bshuf.so
#	src/main/resources/libs/natives/linux_64/libh5bz2.so
#	src/main/resources/libs/natives/linux_64/libh5jpeg.so
#	src/main/resources/libs/natives/linux_64/libh5lzf.so
#	src/main/resources/libs/natives/linux_64/libh5zfp.so
#	src/main/resources/libs/natives/linux_64/libh5zstd.so
#	src/main/resources/libs/natives/linux_64/libhdf5.so
#	src/main/resources/libs/natives/linux_64/libhdf5_java.so
#	src/main/resources/libs/natives/linux_64/libjhdf5.so
#	src/main/resources/libs/natives/linux_64/libnativedata.so
#	src/main/resources/libs/natives/linux_64/libunix.so
#	src/main/resources/libs/natives/windows_64/blosc.dll
#	src/main/resources/libs/natives/windows_64/hdf5.dll
#	src/main/resources/libs/natives/windows_64/hdf5_java.dll
#	src/main/resources/libs/natives/windows_64/hdf5_tools.dll
#	src/main/resources/libs/natives/windows_64/jhdf5.dll
#	src/main/resources/libs/natives/windows_64/libh5blosc.dll
#	src/main/resources/libs/natives/windows_64/libh5bshuf.dll
#	src/main/resources/libs/natives/windows_64/libh5bz2.dll
#	src/main/resources/libs/natives/windows_64/libh5lz4.dll
#	src/main/resources/libs/natives/windows_64/libh5lzf.dll
#	src/main/resources/libs/natives/windows_64/libh5zfp.dll
#	src/main/resources/libs/natives/windows_64/libh5zstd.dll
#	src/main/resources/libs/sis-jhdf5-19.04.1.jar
#	src/main/resources/natives/linux_64/libh5blosc.so
#	src/main/resources/natives/linux_64/libh5bshuf.so
#	src/main/resources/natives/linux_64/libh5bz2.so
#	src/main/resources/natives/linux_64/libh5jpeg.so
#	src/main/resources/natives/linux_64/libh5lzf.so
#	src/main/resources/natives/linux_64/libh5zfp.so
#	src/main/resources/natives/linux_64/libh5zstd.so
#	src/main/resources/natives/linux_64/libhdf5.so
#	src/main/resources/natives/linux_64/libhdf5_java.so
#	src/main/resources/natives/linux_64/libjhdf5.so
#	src/main/resources/natives/windows_64/blosc.dll
#	src/main/resources/natives/windows_64/hdf5.dll
#	src/main/resources/natives/windows_64/hdf5_java.dll
#	src/main/resources/natives/windows_64/jhdf5.dll
#	src/main/resources/natives/windows_64/libh5blosc.dll
#	src/main/resources/natives/windows_64/libh5bshuf.dll
#	src/main/resources/natives/windows_64/libh5bz2.dll
#	src/main/resources/natives/windows_64/libh5lz4.dll
#	src/main/resources/natives/windows_64/libh5lzf.dll
#	src/main/resources/natives/windows_64/libh5zfp.dll
#	src/main/resources/natives/windows_64/libh5zstd.dll
#	version.txt
  • Loading branch information
AxisAlexNT committed May 15, 2024
2 parents fb72eda + d1f2ade commit 8876541
Show file tree
Hide file tree
Showing 101 changed files with 130 additions and 18 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/autobuild-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- created
push:
branches: [ "master" ]
branches: [ "master", "dev*" ]
pull_request:
branches: [ "master", "dev*" ]

Expand All @@ -18,6 +18,10 @@ jobs:
packages: write

steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3.8.1
Expand All @@ -44,8 +48,8 @@ jobs:
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
automatic_release_tag: latest-${{ steps.extract_branch.outputs.branch }}
prerelease: true
title: "Latest autogenerated build"
title: "Latest autogenerated build (branch ${{ steps.extract_branch.outputs.branch }})"
files: |
**/build/**/*hict*.jar
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,45 @@ public class HDF5LibraryInitializer {
private static final PathCollectingJNIExtractor jniExtractor = new PathCollectingJNIExtractor(defaultJNIExtractor);

static {
libraryNames.put("hdf5", "HDF5");
libraryNames.put("jhdf5", "jHDF5");
libraryNames.put("hdf5_tools", "HDF5_tools");
libraryNames.put("hdf5_java", "HDF5_java");
libraryNames.put("libh5blosc", "HDF5 BLOSC filter plugin (Linux-style naming)");
libraryNames.put("h5blosc", "HDF5 BLOSC filter plugin (Windows-style naming)");
//libraryNames.put("jhdf5", "jHDF5");
// SiS JHDF5 dependencies:
// libraryNames.put("libnativedata", "NativeData (Linux-style naming)");
// libraryNames.put("nativedata", "NativeData (Windows-style naming)");
// libraryNames.put("libunix", "libunix.so (Linux-style naming), not needed on Windows");
// libraryNames.put("unix", "libunix.so (Windows-style naming), not needed on Windows");
// Main HDF5 library, rebuilt from sources:
// libraryNames.put("libhdf5", "HDF5 (Linux-style naming)");
// libraryNames.put("hdf5", "HDF5 (Windows-style naming)");
// HDF5_java library (from source on Linux, from SiS-modified jni/ folder JHDF5 source on Windows):
// libraryNames.put("libhdf5_java", "HDF5 (Linux-style naming)");
// libraryNames.put("hdf5_java", "HDF5 (Windows-style naming)");
// This library might be in dependencies:
// libraryNames.put("hdf5_tools", "HDF5_tools");
// The most important HDF5 filter plugins for HiCT (bitshuffle and LZF compression):
libraryNames.put("libh5bshuf", "HDF5 Shuffle filter plugin (Linux-style naming)");
libraryNames.put("h5bshuf", "HDF5 Shuffle filter plugin (Windows-style naming)");
libraryNames.put("h5lzf", "HDF5 LZ4 filter plugin (Windows-style naming)");
libraryNames.put("libh5lzf", "HDF5 LZF filter plugin (Linux-style naming)");
// SiS-modified jni/ folder source linked to libhdf5.a on Linux, SiS-modified version of hdf5_java.dll on Windows
// libraryNames.put("jhdf5", "jHDF5");
// Other general compression plugins:
libraryNames.put("libh5bz2", "HDF5 BZ2 filter plugin (Linux-style naming)");
libraryNames.put("h5bz2", "HDF5 BZ2 filter plugin (Windows-style naming)");
libraryNames.put("libh5lz4", "HDF5 LZ4 filter plugin (Linux-style naming)");
libraryNames.put("h5lz4", "HDF5 LZ4 filter plugin (Windows-style naming)");
libraryNames.put("libh5lzf", "HDF5 LZF filter plugin (Linux-style naming)");
libraryNames.put("h5lzf", "HDF5 LZF filter plugin (Windows-style naming)");
libraryNames.put("libh5zfp", "HDF5 ZFP filter plugin (Linux-style naming)");
libraryNames.put("h5zfp", "HDF5 ZFP filter plugin (Windows-style naming)");
libraryNames.put("libh5zstd", "HDF5 zSTD filter plugin (Linux-style naming)");
libraryNames.put("h5zstd", "HDF5 zSTD filter plugin (Windows-style naming)");

// Lossy compression plugins currently not used by HiCT:
// libraryNames.put("libh5blosc", "HDF5 BLOSC filter plugin (Linux-style naming)");
// libraryNames.put("h5blosc", "HDF5 BLOSC filter plugin (Windows-style naming)");
/*
libraryNames.put("hdf5", "HDF5 (Windows-style naming)");
libraryNames.put("h5bshuf", "HDF5 Shuffle filter plugin (Windows-style naming)");
libraryNames.put("h5lzf", "HDF5 LZF filter plugin (Windows-style naming)");
libraryNames.put("jhdf5", "jHDF5");
*/
initializeHDF5Library();
}

Expand All @@ -55,16 +75,63 @@ public static synchronized void initializeHDF5Library() {
return;
}

NativeLibraryUtil.loadNativeLibrary(jniExtractor, "hdf5", "resources/", "resources/libs/", "resources/libs/natives/", "/resources/", "/resources/libs/", "/resources/libs/natives/");
log.info("Loaded HDF5");
// NativeLibraryUtil.loadNativeLibrary(jniExtractor, "jhdf5", "resources/", "resources/libs/", "resources/libs/natives/", "/resources/", "/resources/libs/", "/resources/libs/natives/");
// log.info("Loaded JHDF5");

for (int i = H5.H5PLsize() - 1; i >= 0; --i) {
final String path;
try {
path = H5.H5PLget(i);
} catch (final HDF5LibraryException e) {
log.error("Failed to get plugin path with index " + i);
continue;
}

try {
H5.H5PLremove(i);
log.info("Removed pre-existing path with index " + i + " that was " + path);
} catch (final HDF5LibraryException e) {
log.error("Failed to remove plugin path with index " + i + " that is " + path);
continue;
}
}

// for (final var libPath : jniExtractor.getFullPathsCollection()) {
// try {
// log.info("Prepending " + libPath + " to the plugin path registry of H5 library");
// H5.H5PLprepend(libPath);
// log.info("Appending " + libPath + " to the plugin path registry of H5 library");
// H5.H5PLappend(libPath);
// } catch (final HDF5LibraryException e) {
// log.error("Failed to append " + libPath + " to the plugin registry", e);
// }
// }

// for (final var libPath : jniExtractor.getAbsolutePathsCollection()) {
// try {
// log.info("Prepending " + libPath + " to the plugin path registry of H5 library");
// H5.H5PLprepend(libPath);
// log.info("Appending " + libPath + " to the plugin path registry of H5 library");
// H5.H5PLappend(libPath);
// } catch (final HDF5LibraryException e) {
// log.error("Failed to append " + libPath + " to the plugin registry", e);
// }
// }


for (final var e : libraryNames.entrySet()) {
final var lib = e.getKey();
final var name = e.getValue();
log.info("Loading " + name + " library");
try {
if (!NativeLibraryUtil.loadNativeLibrary(jniExtractor, lib)) {
if (!NativeLibraryUtil.loadNativeLibrary(jniExtractor, lib, "resources/", "resources/libs/", "resources/libs/natives/", "/resources/", "/resources/libs/", "/resources/libs/natives/")) {
log.warn("Failed to load library " + lib + " with custom JNI Extractor, will try fallback method.");
NativeLoader.loadLibrary(lib);
log.warn("Fallback method succeeded but the library path won't be added to the H5 plugins search registry.");
}
log.info("Successfully loaded library " + lib + " using NativeLoader");
} catch (final IOException err) {
log.warn("Failed to load native library " + name + " by NativeLoader due to IOException", err);
// log.warn("Failed to load native library due to IOException");
Expand All @@ -76,14 +143,54 @@ public static synchronized void initializeHDF5Library() {
}
}

//
// for (int i = H5.H5PLsize() - 1; i >= 0; --i) {
// final String path;
// try {
// path = H5.H5PLget(i);
// } catch (final HDF5LibraryException e) {
// log.error("Failed to get plugin path with index " + i);
// continue;
// }
//
// try {
// H5.H5PLremove(i);
// log.info("Removed pre-existing path with index " + i + " that was " + path);
// } catch (final HDF5LibraryException e) {
// log.error("Failed to remove plugin path with index " + i + " that is " + path);
// continue;
// }
// }
//
// for (final var libPath : jniExtractor.getFullPathsCollection()) {
// try {
// log.info("Prepending " + libPath + " to the plugin path registry of H5 library");
// H5.H5PLprepend(libPath);
// log.info("Appending " + libPath + " to the plugin path registry of H5 library");
// H5.H5PLappend(libPath);
// } catch (final HDF5LibraryException e) {
// log.error("Failed to append " + libPath + " to the plugin registry", e);
// }
// }

for (final var libPath : jniExtractor.getAbsolutePathsCollection()) {
try {
log.info("Prepending " + libPath + " to the plugin path registry of H5 library");
H5.H5PLprepend(libPath);
log.info("Appending " + libPath + " to the plugin path registry of H5 library");
H5.H5PLappend(libPath);
} catch (final HDF5LibraryException e) {
log.error("Failed to append " + libPath + " to the plugin registry", e);
}
}

try {
H5.loadH5Lib();
log.info("Loaded HDF5 library");
} catch (final Throwable uoe) {
log.error("Caught an Unsupported Operation Exception while initializing HDF5 Library, if it complains about library version, you can simply ignore that", uoe);
}


for (final var libPath : jniExtractor.getAbsolutePathsCollection()) {
try {
log.info("Prepending " + libPath + " to the plugin path registry of H5 library");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ru.itmo.ctlab.hict.hict_library.visualization.colormap.gradient.SimpleLinearGradient;

import java.awt.*;
import java.util.Locale;
import java.util.regex.Pattern;

@Getter(AccessLevel.PUBLIC)
Expand All @@ -33,8 +34,8 @@ public SimpleLinearGradientDTO(String startColorHEX, String endColorHEX, double
// final String endHEX = String.format("#%02x%02x%02x%02x", cmap.getEndColor().getRed(), cmap.getEndColor().getGreen(), cmap.getEndColor().getBlue(), cmap.getEndColor().getAlpha());

return new SimpleLinearGradientDTO(
String.format("rgba(%d,%d,%d,%f)", cmap.getStartColor().getRed(), cmap.getStartColor().getGreen(), cmap.getStartColor().getBlue(), ((double) cmap.getStartColor().getAlpha() / 255.0d)),
String.format("rgba(%d,%d,%d,%f)", cmap.getEndColor().getRed(), cmap.getEndColor().getGreen(), cmap.getEndColor().getBlue(), ((double) cmap.getEndColor().getAlpha() / 255.0d)),
String.format(Locale.US, "rgba(%d,%d,%d,%f)", cmap.getStartColor().getRed(), cmap.getStartColor().getGreen(), cmap.getStartColor().getBlue(), ((double) cmap.getStartColor().getAlpha() / 255.0d)),
String.format(Locale.US, "rgba(%d,%d,%d,%f)", cmap.getEndColor().getRed(), cmap.getEndColor().getGreen(), cmap.getEndColor().getBlue(), ((double) cmap.getEndColor().getAlpha() / 255.0d)),
cmap.getMinSignal(),
cmap.getMaxSignal()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void addHandlersToRouter(final @NotNull Router router) {

final List<?> files;
try (final var fileStream = Files.walk(dataDirectory)) {
files = fileStream.filter(Files::isRegularFile).map(dataDirectory::relativize).map(Object::toString).filter(p -> p.endsWith(".hict.hdf5")).collect(Collectors.toList());
files = fileStream.filter(Files::isRegularFile).map(dataDirectory::relativize).map(Object::toString).collect(Collectors.toList());
} catch (final IOException e) {
throw new RuntimeException(e);
}
Expand Down
Binary file added src/main/resources/libs/_sis-jhdf5-19.04.1.jar_
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/main/resources/libs/sis-jhdf5-19.04.1.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libh5blosc.so
Binary file not shown.
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libh5bz2.so
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libh5jpeg.so
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libh5lzf.so
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libh5zfp.so
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libh5zstd.so
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libhdf5.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/main/resources/natives/linux_64/libjhdf5.so
Binary file not shown.
Binary file added src/main/resources/natives/windows_64/blosc.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/main/resources/natives/windows_64/hdf5.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/main/resources/natives/windows_64/jhdf5.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.29-aed9a29-webui_d454f01
1.0.34-677dc4a-webui_8060ecf

0 comments on commit 8876541

Please sign in to comment.