hdfview icon indicating copy to clipboard operation
hdfview copied to clipboard

building hdfview 3.2.0 (or master) on debian gnu/linux sid with jdk 18

Open alexmyczko opened this issue 3 years ago • 5 comments

debian will freeze early next year, and release sometime after the freeze.

i'd really like to have hdfview updated in debian, however i fail to understand its dependencies as well as the build system. the problems are documented at:

https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=hdfview;dist=unstable

and my build problem is, the import for jarhdf/jarhdf5 fails. here's the full log:

https://sid.ethz.ch/debian/hdfview/2023/

i'm using to build systems with configure, cmake, scons and others, but ant configuration appears to be editing the xml file? how would i tell it to not look for/use jarhdf (4.x)?

any help or tip or patch is welcome.

alexmyczko avatar Aug 19 '22 13:08 alexmyczko

You would need to remove the H4 object java files in src/org.hdfgroup.object/hdf/object/h4

And make the following changes.

diff --git a/src/org.hdfgroup.hdfview/hdf/view/dialog/NewStringAttributeDialog.java b/src/org.hdfgroup.hdfview/hdf/view/dialog/NewStringAttributeDialog.java
index 96f6fe5..22bce93 100644
--- a/src/org.hdfgroup.hdfview/hdf/view/dialog/NewStringAttributeDialog.java
+++ b/src/org.hdfgroup.hdfview/hdf/view/dialog/NewStringAttributeDialog.java
@@ -573,7 +573,8 @@ public class NewStringAttributeDialog extends NewDataObjectDialog {
         Attribute attr = null;
         try {
             if (isH4)
-                attr = new hdf.object.h4.H4ScalarAttribute(parentObj, attrName, datatype, dims);
+                attr = null;
+                //attr = new hdf.object.h4.H4ScalarAttribute(parentObj, attrName, datatype, dims);
             else
                 attr = new hdf.object.nc2.NC2Attribute(parentObj, attrName, datatype, dims);
         }
diff --git a/src/org.hdfgroup.object/module-info.java b/src/org.hdfgroup.object/module-info.java
index 380702a..84096de 100644
--- a/src/org.hdfgroup.object/module-info.java
+++ b/src/org.hdfgroup.object/module-info.java
@@ -2,13 +2,13 @@
 module org.hdfgroup.object {
     exports hdf.object;
     exports hdf.object.fits;
-    exports hdf.object.h4;
+//    exports hdf.object.h4;
     exports hdf.object.h5;
     exports hdf.object.nc2;

     requires netcdf;
     requires fits;
-    requires jarhdf;
+//    requires jarhdf;
     requires jarhdf5;
     requires org.slf4j;
 }

FYI, I think 3.2.0 will require to be compiled against 1.12.2 HDF5 library since it uses HDF5Constants.H5F_LIBVER_V112

oyarzun avatar Sep 10 '22 21:09 oyarzun

whatever i try, i end up at:

    [javac]     /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/module-info.java
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.hdfview/hdf/view/ImageView/DefaultImageView.java:347: warning: [removal] runFinalization() in System has been deprecated and marked for removal
    [javac]                 System.runFinalization();
    [javac]                       ^
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.hdfview/hdf/view/TreeView/DefaultTreeView.java:3157: error: cannot find symbol
    [javac]             int[] lowConstants = { HDF5Constants.H5F_LIBVER_EARLIEST, HDF5Constants.H5F_LIBVER_V18, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_V112, HDF5Constants.H5F_LIBVER_V114, HDF5Constants.H5F_LIBVER_LATEST };
    [javac]                                                                                                                                                                                ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.hdfview/hdf/view/TreeView/DefaultTreeView.java:3159: error: cannot find symbol
    [javac]             int[] highConstants = { HDF5Constants.H5F_LIBVER_V18, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_V112, HDF5Constants.H5F_LIBVER_V114, HDF5Constants.H5F_LIBVER_LATEST };
    [javac]                                                                                                                                              ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/hdf/object/h5/H5File.java:138: error: cannot find symbol
    [javac]     public static final int LIBVER_V114 = HDF5Constants.H5F_LIBVER_V114;
    [javac]                                                        ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/hdf/object/h5/H5File.java:1030: error: cannot find symbol
    [javac]             low = HDF5Constants.H5F_LIBVER_V114;
    [javac]                                ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/hdf/object/h5/H5File.java:1045: error: cannot find symbol
    [javac]             high = HDF5Constants.H5F_LIBVER_V114;
    [javac]                                 ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/hdf/object/h5/H5File.java:1089: error: cannot find symbol
    [javac]                 low = HDF5Constants.H5F_LIBVER_V114;
    [javac]                                    ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/hdf/object/h5/H5File.java:1104: error: cannot find symbol
    [javac]                 high = HDF5Constants.H5F_LIBVER_V114;
    [javac]                                     ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/hdf/object/h5/H5File.java:1174: error: cannot find symbol
    [javac]         else if (libver[0] == HDF5Constants.H5F_LIBVER_V114)
    [javac]                                            ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] /var/www/debian/hdfview/2023/hdfview-3.2.0/src/org.hdfgroup.object/hdf/object/h5/H5File.java:1187: error: cannot find symbol
    [javac]         else if (libver[1] == HDF5Constants.H5F_LIBVER_V114)
    [javac]                                            ^
    [javac]   symbol:   variable H5F_LIBVER_V114
    [javac]   location: class HDF5Constants
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 9 errors
    [javac] 1 warning

BUILD FAILED
/var/www/debian/hdfview/2023/hdfview-3.2.0/build.xml:344: Compile failed; see the compiler error output for details.
	at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1373)
	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1092)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
	at org.apache.tools.ant.Main.runBuild(Main.java:818)
	at org.apache.tools.ant.Main.startAnt(Main.java:223)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

Total time: 24 seconds

alexmyczko avatar Sep 13 '22 13:09 alexmyczko

@alexmyczko HDF5Constants.H5F_LIBVER_V114 means it needs to be compiled against HDF5 1.14 which is not yet released.

https://www.hdfgroup.org/2022/06/2022-hdf5-release-schedule/

oyarzun avatar Sep 13 '22 14:09 oyarzun

thanks, wonder where i got that tarball 3.2.0 from will try with 3.1.x

alexmyczko avatar Sep 13 '22 15:09 alexmyczko

thanks, wonder where i got that tarball 3.2.0 from will try with 3.1.x

master branch is the only one that should have HDF5Constants.H5F_LIBVER_V114 (which will be hdfview 3.3.x) when 1.14 is released.

hdfview-3-1_12 branch will have HDF5Constants.H5F_LIBVER_V112 as the highest. HDFView 3.2.1+ now requires hdf5-1.12.3 as a minimum due to fixes for variable-length.

hdfview-3-1_10 branch will have HDF5Constants.H5F_LIBVER_V110 as the highest. HDFView 3.1.5+ now requires hdf5-1.10.10 as a minimum due to fixes for variable-length.

byrnHDF avatar Oct 03 '22 12:10 byrnHDF

Future releases will be with the latest released branch. So HDFView 3.3.0 will be with HDF5 1.14.0 and HDF 4.2.16. The dev branch will be hdfview-3-1_14 and be based on the development branch of HDF5_1_14.

byrnHDF avatar Mar 14 '23 17:03 byrnHDF

i wish releases were tagged on github.com

alexmyczko avatar Jun 13 '23 11:06 alexmyczko

i wish releases were tagged on github.com

My mistake, I forgot. However we will have a more automatic release process in place soon.

byrnHDF avatar Jun 13 '23 12:06 byrnHDF

i also read something about build system change ant to gradle? will gradle 4.x be usable or must it be 6.x+ or 7.x, 8.x?

alexmyczko avatar Jun 13 '23 12:06 alexmyczko

Yes, see #93 . Contribution for gradle is always welcome!

hyoklee avatar Jun 13 '23 16:06 hyoklee

My Java got rusty 25 years ago. I have no idea of it. I only want to get the debian package fixed…

alexmyczko avatar Jun 13 '23 17:06 alexmyczko

I don't see HDFView for Debian from the repo watch:

https://github.com/hyoklee/hdfview

Is it something you're working on now?

hyoklee avatar Jun 13 '23 17:06 hyoklee

Here is the package https://packages.debian.org/sid/hdfview and here its bugs https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=hdfview;dist=unstable

alexmyczko avatar Jun 13 '23 18:06 alexmyczko

here its bugs https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=hdfview;dist=unstable

Those are for version 2.11! The current release is 3.3.0 with a soon to be released patch release becasue of hdf4 floats/xdr.dll issues. 3.1.4 was the last stable release.

byrnHDF avatar Jun 13 '23 18:06 byrnHDF