Installing HDFView on Linux

Hello,

I’ve tried to install HDFView on my Linux Ubuntu 20.04 laptop and I found HDFView on the official repositories:

:~$ sudo apt-cache show hdfview
Package: hdfview
Architecture: amd64
Version: 2.11.0+dfsg-3ubuntu2
Priority: optional
Section: universe/libs
Source: jhdf
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 516
Depends: libjgraph-java, libjhdf5-java, libjhdf4-java, libslf4j-java, java-wrappers,default-jre
Suggests: www-browser
Filename: pool/universe/j/jhdf/hdfview_2.11.0+dfsg-3ubuntu2_amd64.deb
Size: 442848
MD5sum: d4ac897eb747a3b1d7aab9f0a2684537
SHA1: b1a1a77e243a97ef64ac24bd25cdebb3f6fe3821
SHA256: e3a1c07450688c4958840c304d640ffc09262a5899126993ae0e022e5af0bd9c
Homepage: http://www.hdfgroup.org/hdf-java-html/
Description-en: Java HDF Object viewer
HDF is a versatile data model that can represent very complex data objects
and a wide variety of metadata. It is a completely portable file format
with no limit on the number or size of data objects in the collection.
.
This package provides a HDF4/HDF5 viewer.
Description-md5: 4b9ccbb5f76814f27025f1f65e5b4fbf

I’ve installed this package but when trying to start it, I get this error:

:~$ hdfview
/usr/bin/hdfview: 304: exec: /usr/lib/jvm/java-8-oracle/bin/java: not found

I’ve read the installation steps on this website: https://portal.hdfgroup.org/display/HDFVIEW/HDFView#HDFView-install. It seems there is something to do with the environment variables. However, this information is not meaningful enough for my poor IT skills.

It seems that the package version (2.11.0) available on the official repositories is quite old. Then, it is maybe not the best way to install it.

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

Many thanks for your help! :slightly_smiling_face:

HDF just released a new HDFView 3.1.2. Check the hdfgroup.org website.

Allen

after a lot of search and changing machine. I was able to install hdf5view in my system(Ubuntu 20.10 ).
steps:

  1. Download the first centos tar file from here HDFView-3.1.2-centos7_64.tar.gz .

  2. install “alien (sudo apt install alien)” tool to convert the rpm file into executable file for ubuntu.

2.a sudo alien -i your-downloaded-and-uncompressed-rpm-file

  1. After conversion the file in my case was present in /opt/hdfview/ directory and so I went there.

  2. Last step was execute the file with sudo /opt/hdfview/HDFView .

1 Like

Thanks! I managed to install HDFView following your instructions. However, I have difficulties to open HDF file. If I try to open a HDF file with HDFView (right click + “Open With HDFView”), I got the following error message on the bottom of the app:

HDFView root - /home/thibault
User property file - /home/thibault/.hdfview3.1.2
 *** Unable to open file '/home/thibault/Desktop/CAL_LID_L2_05kmCLay-Standard-V4-20.2010-08-05T23-40-14ZN.hdf': HDF4 library linking error *** 
 *** java.io.IOException: Unsupported fileformat - /home/thibault/Desktop/CAL_LID_L2_05kmCLay-Standard-V4-20.2010-08-05T23-40-14ZN.hdf *** 

If I open first the app and then open a file from the app, the app closes and I get the following error message in the terminal:

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class hdf.hdflib.HDFLibrary
	at hdf.object.h4.H4File.isThisType(H4File.java:207)
	at hdf.view.TreeView.DefaultTreeView.openFile(DefaultTreeView.java:2348)
	at hdf.view.HDFView.openLocalFile(HDFView.java:1812)
	at hdf.view.HDFView$26.widgetSelected(HDFView.java:973)
	at swt/org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at swt/org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at swt/org.eclipse.swt.widgets.Display.sendEvent(Display.java:5685)
	at swt/org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1423)
	at swt/org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4953)
	at swt/org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4446)
	at hdf.view.HDFView.runMainWindow(HDFView.java:378)
	at hdf.view.HDFView$39.run(HDFView.java:2572)
	at swt/org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
	at swt/org.eclipse.swt.widgets.Display.syncExec(Display.java:5795)
	at hdf.view.HDFView.main(HDFView.java:2563)
Failed to launch JVM

If this is an ubuntu machine, HDF has an ubuntu 20.10 based release file. Send a message to help@hdfgroup.org.
The error indicates a failure with the hdf4 library stack. Have you tried an hdf5 file to determine if it is only a hdf4 problem?

Allen

I’m not sure I have any hdf5 file handy…
I’m using Ubuntu 20.04. Is the 20.10 based release expected to work on 20.04?

This could mean your system lacks a supporting library. The ldd program is used to list the libraries required by a program or .so library. My fedora 33 system (which so far is used only with NtCDF4 files) shows:

$ cd /opt/hdfview/lib/app
$ ldd libmfhdf.so.4
ldd: warning: you do not have execution permission for `./libmfhdf.so.4'
        linux-vdso.so.1 (0x00007fff2b7e8000)
        libxdr.so.4 => not found
        libhdf.so.4 => /opt/hdfview/lib/app/./libhdf.so.4 (0x00007fb82381a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb82364f000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fb823509000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fb823502000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb823d8c000)

It seems that I get something similar:

$ ldd libmfhdf.so.4
	linux-vdso.so.1 (0x00007ffcc9cb9000)
	libxdr.so.4 => not found
	libhdf.so.4 => /opt/hdfview/lib/app/./libhdf.so.4 (0x00007f08d24c9000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f08d22d7000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f08d2188000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f08d2182000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f08d2a30000)

libxdr.so.4 => not found

That file is from hdf4 distribution, which somehow did not get in the packaging. It is available from the hdf4 binary, which should be on the website, else ask for the ubuntu version from help@hdfgroup.org.

Allen

I downloaded hdf-4.2.15-linux-centos7-x86_64-shared.tar.gz, but it does not contain libxdr.so.4.

okay, strange, I just checked a hdf4 build and an ldd of libmfhdf.so and there was no libxdr in the list.
Can you check ldd of libmfhdf.so on that hdf4 binary?

Allen

Then if ldd on hdf4 doesn’t show libxdr, try copying the hdf4 so files over the hdfview so files.

Allen

Note that the so.4 files are symlinks in hdf4, I just copied over the so.4.2.15 file and renamed it to so.4

Allen