GPC: Vona's Java Utils

This is a collection of general purpose Java code I have written and which I use in various projects.

The best way to learn about using these utilities is to read the javadoc and the source.

Download, Dependencies, and Installation

Vona's Java Utils is released in under the GNU GPL. The distribution jar comes with everything rolled into one: java source, scheme source, html (m4) source, the makefiles and related stuff, plus precompiled versions of everything (java class files, html, and javadoc). Further, it includes the pure java dependencies of the library, which are

A lighter-weight jar is also available which excludes third-party dependencies.

Native Dependencies

Vona's Java Utils requires a Java 1.6+ JRE and, for JOGLDisplay, JOGL 2.0+. It has been tested under recent Sun JREs on GNU/Linux, Windows XP, and Mac OS 10.6.

JOGL is required for building and for runtime use of JOGLDisplay but, as this includes native code (i.e. it is not "pure java"), it is not included in any of the provided jars. You will need to download and install it separately if you want to rebuild the code or if you want to use JOGLDisplay. I typically set it up as an installed extension, though this may not be officially recommended.

netlib-java JNI Acceleration

The SVD driver can use netlib-java for computation of the SVD (this is the default). While netlib-java will itself default to a pure-java implementation, it is much faster to use its optional JNI-accelerated call to an optimized native SVD implementation.

You do not need to take any special action to run without netlib-java JNI acceleration, since the distribution jar includes a copy of netlib-java.

To use netlib-java JNI acceleration, you'll need to download netlib-java separately, build the native libraries on your system (we provide some precompiled binaries below), and symlink the native libs so your JRE can find them.

Here are the steps on a modern Debian-based GNU/Linux system like Ubuntu (the resulting GNU/Linux x86_64 and x86 *.so binaries are available here for convenience; unpack in /usr/local/lib and skip directly to the last step if you want to try them directly):

  1. sudo apt-get install liblapack-dev libatlas-base-dev gfortran
  2. download netlib-java and unpack into e.g. /usr/local/lib/netlib-java-version
  3. cd /usr/local/lib/netlib-java-version/jni
  4. set the environment variable JAVA_HOME to the base dir of your JDK and ensure $JAVA_HOME/bin (the directory containing the javac executable) is on your PATH
  5. at this point I found a bug in the netlib-java configure script, I had to change the line
    echo "JLAPACK_JNI_CP=../netlib-java-0.9.0.jar" >> Makefile.incl
    to
    echo "JLAPACK_JNI_CP=../netlib-java-0.9.1.jar" >> Makefile.incl
  6. chmod a+x configure; ./configure
  7. make
  8. cd $JAVA_HOME/jre/lib/arch/; sudo ln -s /usr/local/lib/netlib-java-version/jni/*.so (Notes: substitute your machine architecture, such as i386, for arch; depending on where you've installed your JDK, you may not need or want the sudo; if you've downloaded the precompiled binaries then you can install directly into a JRE at $JAVA_HOME/lib/arch.)

On Macintosh OS X 10.6.2 (x86_64) I had success with these steps (the resulting OS X x86_64 *.jnilib binaries are available here for convenience; unpack in /usr/local/lib and skip directly to the last step if you want to try them directly):

  1. sudo port install gcc45 +gfortran (get some coffee...)
  2. make the following changes to the netlib-java jni configure script:
    ARCH=x86_64
    
    CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Headers"
    
    FC="/opt/local/bin/gfortran-mp-4.5"
    
    FORTRAN_LIBS="-L/opt/local/lib/gcc45 -lgfortran -Wl,-single_module"
    
  3. chmod a+x configure; ./configure
  4. make
  5. cd /System/Library/Java/Extensions; sudo ln -s /usr/local/lib/netlib-java-version/jni/*.jnilib .

(Re-)Building the Code

The Vona's Java Utils build has been tested on GNU/Linux. Other platforms may work. You should only need to (re)build the code if you have made a change; it is distributed with pre-built binaries.

The build system is based on the Super-Ninja Makefile. You'll need to have already installed

You'll probably want to create a directory into which to unpack the jar (jar xvf Vona-newest.jar). The code for Vona's Java Utils proper will be under the unpacked directory vona/; sibling directories contain the bundled pure-Java dependencies. The build system will find these. Alternately, you can unpack Vona-lite-newest.jar, and in that case, the build system will look for jarfiles for the pure java deps in the location specified by its EXT_DIR variable, which you can inspect via make show-settings (and/or see the makefile for how it is derived).

From within the vona/ directory,

Disclaimer

THIS INFORMATION AND/OR SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS INFORMATION AND/OR SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.