-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preview of java 22 jextract to replace JNI package
- Loading branch information
Showing
319 changed files
with
188,902 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#! /bin/sh | ||
# | ||
# Copyright by The HDF Group. | ||
# All rights reserved. | ||
# | ||
# This file is part of HDF5. The full HDF5 copyright notice, including | ||
# terms governing use, modification, and redistribution, is contained in | ||
# the COPYING file, which can be found at the root of the source code | ||
# distribution tree, or in https://www.hdfgroup.org/licenses. | ||
# If you do not have access to either file, you may request a copy from | ||
# [email protected]. | ||
# | ||
## Update HDF5 java/jsrc after the HDF5 software has been built ## | ||
## For help page, use "h5jextract -help" ## | ||
|
||
# show help page | ||
usage() { | ||
# A wonderfully informative "usage" message. | ||
echo "usage: $prog_name [OPTIONS]" | ||
echo " OPTIONS:" | ||
echo " -help|help This help message" | ||
echo " -echo Show all the shell commands executed" | ||
echo " -jextract=DIR Directory to find the jextract binary" | ||
echo " [default: current <user home>/jextract/bin]" | ||
echo " -sourcedir=DIR Directory for the HDF5 source files" | ||
echo " [default: current directory]" | ||
echo " -includedir=DIR Directory for the HDF5 header files" | ||
echo " [default: current directory/include]" | ||
echo " [should be set to the public only headers]" | ||
echo " " | ||
exit $EXIT_FAILURE | ||
} | ||
|
||
# Report Error message | ||
ERROR() | ||
{ | ||
echo "***ERROR***" | ||
echo "$1" | ||
} | ||
|
||
# Main | ||
# | ||
############################################################################ | ||
# Initialization | ||
prefix= | ||
jextract= | ||
includedir= | ||
|
||
# Parse options | ||
for arg in $@ ; do | ||
case "$arg" in | ||
-jextract=*) | ||
jextract="`echo $arg | cut -f2 -d=`" | ||
;; | ||
-sourcedir=*) | ||
sourcedir="`echo $arg | cut -f2 -d=`" | ||
;; | ||
-includedir=*) | ||
includedir="`echo $arg | cut -f2 -d=`" | ||
;; | ||
-echo) | ||
set -x | ||
;; | ||
-help|help) | ||
usage | ||
;; | ||
*) | ||
ERROR "Unknown Option($arg)" | ||
usage | ||
exit $EXIT_FAILURE | ||
;; | ||
esac | ||
done | ||
|
||
# Set to default value, one above where i am, if not given by user | ||
if [ -z "$sourcedir" ]; then | ||
sourcedir=`(cd ..;pwd)` | ||
fi | ||
if [ -z "$includedir" ]; then | ||
includedir='${sourcedir}'/include # use single quotes to prevent expansion of $ | ||
fi | ||
if [ -z "$jextract" ]; then | ||
jextract='${HOME}'/jextract/bin # use single quotes to prevent expansion of $ | ||
fi | ||
|
||
|
||
$jextract/jextract \ | ||
--include-dir $includedir \ | ||
--output $sourcedir/java/jsrc \ | ||
--target-package org.hdfgroup.javahdf5 \ | ||
--library hdf5 \ | ||
$includedir/hdf5.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required (VERSION 3.18) | ||
project (HDF5_JAVA_JSRC Java) | ||
|
||
set (CMAKE_VERBOSE_MAKEFILE 1) | ||
|
||
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_JSRC_SOURCE_DIR};${HDF5_JAVA_JSRC_BINARY_DIR}") | ||
|
||
file (GLOB HDF5_JAVA_JSRC_SOURCES LIST_DIRECTORIES false ${HDF5_JAVA_JSRC_SOURCE_DIR}/org/hdfgroup/javahdf5/*.java) | ||
|
||
file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt | ||
" | ||
" | ||
) | ||
|
||
set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_LOGGING_JAR}") | ||
|
||
add_jar (${HDF5_JAVA_JSRC_LIB_TARGET} OUTPUT_NAME "${HDF5_JAVA_JSRC_LIB_TARGET}-${HDF5_PACKAGE_VERSION}" OUTPUT_DIR ${CMAKE_JAVA_TARGET_OUTPUT_DIR} MANIFEST ${PROJECT_BINARY_DIR}/Manifest.txt ${HDF5_JAVA_JSRC_SOURCES}) | ||
install_jar (${HDF5_JAVA_JSRC_LIB_TARGET} LIBRARY DESTINATION ${HDF5_INSTALL_JAR_DIR} COMPONENT libraries) | ||
#if (NOT WIN32) | ||
# install_jni_symlink (${HDF5_JAVA_JSRC_LIB_TARGET} ${HDF5_INSTALL_JAR_DIR} libraries) | ||
#endif () | ||
|
||
get_target_property (${HDF5_JAVA_JSRC_LIB_TARGET}_JAR_FILE ${HDF5_JAVA_JSRC_LIB_TARGET} JAR_FILE) | ||
SET_GLOBAL_VARIABLE (HDF5_JAVA_XJARS_TO_EXPORT "${HDF5_JAVA_XJARS_TO_EXPORT};${${HDF5_JAVA_JSRC_LIB_TARGET}_JAR_FILE}") | ||
SET_GLOBAL_VARIABLE (HDF5_JAVA_XJARS ${${HDF5_JAVA_JSRC_LIB_TARGET}_JAR_FILE}) | ||
|
||
set_target_properties (${HDF5_JAVA_JSRC_LIB_TARGET} PROPERTIES FOLDER libraries/java) | ||
if (HDF5_ENABLE_FORMATTERS) | ||
clang_format (HDF5_JAVA_SRC_FORMAT ${HDF5_JAVA_JSRC_SOURCES}) | ||
endif () | ||
|
||
set (CMAKE_JAVA_INCLUDE_PATH "") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Generated by jextract | ||
|
||
package org.hdfgroup.javahdf5; | ||
|
||
import java.lang.invoke.*; | ||
import java.lang.foreign.*; | ||
import java.nio.ByteOrder; | ||
import java.util.*; | ||
import java.util.function.*; | ||
import java.util.stream.*; | ||
|
||
import static java.lang.foreign.ValueLayout.*; | ||
import static java.lang.foreign.MemoryLayout.PathElement.*; | ||
|
||
/** | ||
* {@snippet lang=c : | ||
* typedef struct _IO_FILE { | ||
* int _flags; | ||
* char *_IO_read_ptr; | ||
* char *_IO_read_end; | ||
* char *_IO_read_base; | ||
* char *_IO_write_base; | ||
* char *_IO_write_ptr; | ||
* char *_IO_write_end; | ||
* char *_IO_buf_base; | ||
* char *_IO_buf_end; | ||
* char *_IO_save_base; | ||
* char *_IO_backup_base; | ||
* char *_IO_save_end; | ||
* struct _IO_marker *_markers; | ||
* struct _IO_FILE *_chain; | ||
* int _fileno; | ||
* int _flags2; | ||
* __off_t _old_offset; | ||
* unsigned short _cur_column; | ||
* signed char _vtable_offset; | ||
* char _shortbuf[1]; | ||
* _IO_lock_t *_lock; | ||
* __off64_t _offset; | ||
* struct _IO_codecvt *_codecvt; | ||
* struct _IO_wide_data *_wide_data; | ||
* struct _IO_FILE *_freeres_list; | ||
* void *_freeres_buf; | ||
* size_t __pad5; | ||
* int _mode; | ||
* char _unused2[20]; | ||
* } FILE | ||
* } | ||
*/ | ||
public class FILE extends _IO_FILE { | ||
|
||
FILE() { | ||
// Should not be called directly | ||
} | ||
} | ||
|
Oops, something went wrong.