Building HDFView 3.1.2 on Ubuntu 20.04


#1

Hi,

I’ve tried to install HDFView 3.1.2 on my Linux Ubuntu 20.04 laptop and I have downloaded HDFView pre-build binary file from HDFView-3.1.2-ubuntu20_64.tar.gz link.

I didn’t see any error during installation. But it didn’t open at all.

hdfview.

possible reasons for that maybe it compiled with 5.4.0-52-generic. I am using

java-1.11.0-openjdk 
hdf5-1.10
5.4.0-58-generic

Could you please let me know how should I install HDFView?


#2

I can confirm that the binary doesn’t run on Ubuntu 20.04 LTS:

 % /opt/hdfview/bin/HDFView
Error: dl failure on line 534
Error: failed /opt/hdfview/lib/runtime/lib/server/libjvm.so, because /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /opt/hdfview/lib/runtime/lib/server/libjvm.so)
Failed to launch JVM

Google will show that many people using Ubuntu 20.04 LTS (focal fossa) are having problems with 3rd party applications that require GLIBC_2.32'. Ubuntu focal hasGLIBC_2.31’. Upgrading to 20.10 should provide `GLIBC_2.32’ along with the 5.8 kernel (as mentioned in the README file).


#3

Yes it was compiled on ubuntu 20.10. The release.txt file in the binary should indicate that exact versions.

Allen


#4

I solved the previous problem.

Now If I want to do it from the source code, How am I supposed to do it? I have added

hdf.lib.dir = /home/pranto/opt/hdf-4.2.15_root_install/lib
hdf5.lib.dir = /home/pranto/opt/hdf5_1.10.7_root_install/lib

lines in the build.properties file. When I run ant run, I got the following error

create-property-file:
[propertyfile] Creating new property file: /home/pranto/Downloads/hdfview-3.1.2/build/classes/hdf/versions.properties

compileobj:
     [copy] Copied 2 empty directories to 2 empty directories under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilehdf4:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilefits:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilenc2:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compilehdf5:
     [copy] Copied 1 empty directory to 1 empty directory under /home/pranto/Downloads/hdfview-3.1.2/build/classes/org.hdfgroup.object

compile:
    [javac] Compiling 98 source files to /home/pranto/Downloads/hdfview-3.1.2/build/classes
    [javac] javac: invalid flag: --module-source-path
    [javac] Usage: javac <options> <source files>
    [javac] use -help for a list of possible options

BUILD FAILED
/home/pranto/Downloads/hdfview-3.1.2/build.xml:340: Compile failed; see the compiler error output for details.

Total time: 2 seconds

#5

modules require JDK-15 and at least ant-1.10. We use the latest OpenJDK-15 and ant 1.10.5.

Allen


#6

Hi,

I got the following error while compiling from the source file of hdf5-1.10.7 and got the same error also with hdf5-1.12

./configure --enable-shared \
--enable-cxx --enable-fortran --with-szlib --enable-build-mode=debug \
--enable-java --prefix=$HOME/opt/hdf5_1.10.7_root_instal

            SUMMARY OF THE HDF5 CONFIGURATION
	    =================================
       AM C++ Flags: 
             Shared C++ Library: yes
             Static C++ Library: yes

                           Java: yes
                  Java Compiler: /usr/bin/java (openjdk 11.0.9.1 2020-11-04)

make[1]: Entering directory '/home/pranto/opt/hdf5-1.10.7/java'
Making all in src
make[2]: Entering directory '/home/pranto/opt/hdf5-1.10.7/java/src'
Making all in jni
make[3]: Entering directory '/home/pranto/opt/hdf5-1.10.7/java/src/jni'
  CC       exceptionImp.lo
exceptionImp.c:32:10: fatal error: jni.h: No such file or directory
   32 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
make[3]: *** [Makefile:948: exceptionImp.lo] Error 1
make[3]: Leaving directory '/home/pranto/opt/hdf5-1.10.7/java/src/jni'
make[2]: *** [Makefile:763: all-recursive] Error 1
make[2]: Leaving directory '/home/pranto/opt/hdf5-1.10.7/java/src'
make[1]: *** [Makefile:828: all-recursive] Error 1
make[1]: Leaving directory '/home/pranto/opt/hdf5-1.10.7/java'
make: *** [Makefile:669: all-recursive] Error 1

How to solve this problem?


#7
exceptionImp.c:32:10: fatal error: jni.h: No such file or directory
   32 | #include "jni.h"
      |          ^~~~~~~

The jni.h file is provided by the jdk. Do you have /usr/lib/jvm/java-11-openjdk-amd64/include/jni.h? If not, you need to install the openjdk-11-jdk package.
If you have jni.h then some investigation is needed to determine why is isn’t found.

PS: You mentioned that you had solved the previous problem, but it isn’t clear
which problem or how you solved it. In my experience, for each person who writes
about a problem there are many others watching for the solution, so it is very helpful if the forum provides a complete record


#8

The “can’t find jni.h” issue sounds like a problem we recently fixed in the develop branch. Try copying develop’s autotools jni file to the m4 directory in your unpacked source.


#9

The jni.h file is provided by the jdk. Do you have /usr/lib/jvm/java-11-openjdk-amd64/include/jni.h?

I reinstalled openjdk-11-jdk and everything works fine now.


#10

Also, note that hdfview 3.1.2 will need at least openjdk 15, for packaging. For building hdfview you will also need a recent ant (like 10.2).

Allen


#11

I am having problems building it on Ubuntu 20.10. Can anybody please provide proper steps to build it succcessfully. Thanks. It is much needed for my academic project.


Cannot download hdfview on Ubuntu 20.04
#12

HDFView (at Ubuntu 20.04 LTS)

I have just start using it after that:

$ sudo apt-get install alien
$ cd ~/Downloads

$ wget https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.1.2/bin/HDFView-3.1.2-centos7_64.tar.gz
$ tar xfvz HDFView-3.1.2-centos7_64.tar.gz$ cd ~Downloads/HDFView-3.1.2-centos7_64
$ sudo alien --scripts hdfview-3.1.2-1.x86_64.rpm
$ sudo dpkg -i hdfview_3.1.2-2_amd64.deb

and it seems working fine… :slight_smile:


#13

How did you get this to run? I did all the steps but it’s not running


#14

The permissions set by the alien installation only allow root to use hdfview:

% cd /opt/hdfview
% ls -ld *
drwx------ 2 root root 3 Aug 20 15:48 bin
drwx------ 4 root root 7 Aug 20 15:48 lib

Root privileges should only be used for well-tested and trusted administrative
tools. HDFview is nowhere close to well-tested and trusted and is not an
administration tool – users should fix the permissions before attempting to
use the package.

This is easily corrected by users with basic linux command-line skills, so
is “an excercise left to the reader”. Any reader who didn’t recognize this
problem and knows an efficient solution needs to spend a few evenings
with linuxcommand.org or a similar introduction to the linux command line
until they feel confident about the management of basic file and directory
permissions in linux. Hint: the find command is useful for an efficient
solution.


#15

This works for me. Thank you very much.