Please see The HDF Group's new Support Portal for the latest information.
Latest Release: 3.3.2
The HDF Java software is built with CMake. To simplify building HDF Java with CMake, a CTest script and platform configuration file can be used, as shown below.
Preconditions:
-
CMake MUST be installed. The configuration scripts were tested with CMake 3.2.
-
Blank spaces MUST NOT be used in directory path names as this will cause the build to fail.
-
(Optional) On Windows, an NSIS or WiX should be installed in order to create an install image with CPack. NSIS will create a .exe installer. WiX will create a .msi installer.
Build Instructions
Please follow the instructions below for building.
-
Review the preconditions to be sure all needed software is on your machine.
-
Create a working directory.
-
From the table below download the appropriate file for your platform to your working directory. Uncompress it. It will contain a CMake-hdfjava-3.3.2 directory.
Software Comments Windows ( md5 ) Contains files to build HDF Java with CMake on Windows Unix ( md5 ) Contains files to build HDF Java with CMake on Unix -
Move to the CMake-hdfjava-3.3.2 directory. You will see the following files:
build*.sh (.bat) Build Script(s) CTestScript.cmake ctest Command HDF4.tar.gz HDF4 source code HDF5.tar.gz HDF5 source code hdfjava-3.3.2/ HDF-Java source code HDFJavaconfig.cmake Configuration File HDFJNIExamples-0.1.1-Source.tar.gz (.zip) Example Programs HDFoptions.cmake User definable options JPEG8d.tar.gz External Library for JPEG 8 Compression SZip.tar.gz External Library for SZIP Compression ZLib.tar.gz External Library for ZLIB Compression
These files will build HDF Java with HDF4, HDF5, SZIP, ZLIB, and JPEG included.
Select the build script to use. It contains the ctest command that you need to run to build HDF Java. (See Troubleshooting if you do not see your platform).
OPTIONAL: Change build options as needed in the build script. REQUIRED: Visual Studio Express users must change the build options to turn off packaging or the build will fail.
Build scripts that you may see depending on the distribution (Unix or Windows):
Platform | Batch File / Shell Script | Contains following ctest command |
Windows 64-bit VS 2015 | build-VS2015-64.bat | ctest -S HDFJavaconfig.cmake,64-VS2015 -C Release -V -O hdfJava.log |
Windows 32-bit VS 2015 | build-VS2015-32.bat | ctest -S HDFJavaconfig.cmake,32-VS2015 -C Release -V -O hdfJava.log |
Windows 64-bit VS 2013 | build-VS2013-64.bat | ctest -S HDFJavaconfig.cmake,64-VS2013 -C Release -V -O hdfJava.log |
Windows 32-bit VS 2013 | build-VS2013-32.bat | ctest -S HDFJavaconfig.cmake,32-VS2013 -C Release -V -O hdfJava.log |
Unix | build-hdfjava-unix.sh | ctest -S HDFJavaconfig.cmake -C Release -V -O hdfJava.log |
Where the ctest command is using these options:
- The -S option uses the script version of ctest. HDFJavaconfig.cmake is the configuration file.
- The -C option specifies the build configuration which matches CTEST_BUILD_CONFIGURATION in the configuration file.
- The -V option indicates verbose. Using the -VV option indicates more verbose.
- The -O option saves the output to a log file, hdfJava.log.
-
Locate the built binary.
The built binary will be copied to the working directory if successful. It will have the format:HDFJava-<platform>.<zip or tar.gz>
On Unix, <platform> will be "Linux". A similar .sh file will also be created.
If the built binary is not there, then see Troubleshooting for help.
On Windows, <platform> will be "win64" or "win32". If you have an installer on your system, you will also see a similar file that ends in either .exe (NSIS) or .msi (WiX).
Execute the batch file or shell script for your platform.
Troubleshooting
-
My platform/compiler is not included. Can I still use the configuration files?
Yes, you can but you will have to edit the HDFJavaconfig.cmake file and update the variable:
CTEST_CMAKE_GENERATOR
Other variables may be updated for informational purposes but are not required (for example, SITE_OS_BITS).The generators for your platform can be seen by typing:
cmake --help
-
What do I do if the build fails?
I received an error during the build and the built and compressed binary is not in the build directory as I expected. How do I determine what the problem is?
If the error is not clear, then the first thing you may want to do is replace the -V (Dash Vee) option for ctest in the build script to -VV (Dash Vee Vee). Then remove the build directory and re-run the build script. The output should be more verbose.
If the error is still not clear, then check the log files. You will find those in the build directory. For example, on Unix the log files will be in:
build/Testing/Temporary/
There are log files for the configure, test, and build.
-
What do I do if I need to rebuild the software?
If you have to rebuild HDF Java, remove the build directory first.
-
The library was built but there are no binaries. What do I do?
To install or package the binaries, run either make install or cpack in the build/ directory.
- - Last modified: 04 January 2018