This page will look better in a graphical browser that supports web standards, but is accessible to any browser or internet device.

Served by Samwise.

Cardiac Physiome Society workshop: November 6-9, 2017 , Toronto

Building JSim From Source

This page applies to JSim version 2.03 and above. Click here for the earlier JSim 2.00-2.02 version. Click here for the earlier JSim 1.6 version.

Introduction

This page describes how JSim source code is structured, and how to build a JSim binary distribution from that source code. JSim source code may currently be obtained in two ways: the JSim open source distribution or the NSR CVS archive (/cvsroot/JSIM/SRC2.0). The latter is available only to NSR collaborators. There are minor differences in the build procedure depending upon which method of source code access you use, which are noted in this document. Use of JSim source code must be in accordance with the file license.html found in the distribution root directory.

Source distribution contents

Building JSim on Linux

  1. Perform the following in a Bash shell.
  2. Create a new directory and unpack the source distribution .zip file, or NSR CVS checkout into it. Set environment variable JSIMSRC to this directory.
  3. Set your PATH to include $JSIMSRC/build.
  4. Install the Sun Java SDK version 1.6 on your system. Set environment variable JSIMSDK its location. On NSR Linux systems, this is /usr/local/jdk.
  5. Install gcc and gfortran version 4 on your system and edit $JSIMSRC/home/lib/Makefile.global.linux to match the appropriate locations. The distributed version of thie file targets NSR's Linux build machine, currently 64-bit EL5. Comments in the file allow modification for other NSR Linux boxes, including a mix of 32 and 64 bit EL6. For building on NSR Linux boxes, uncommment and comment this file to match your particular machine.
  6. If building on NSR Linux boxes:
    • Set the environment variable JSIMAUXLIB=/NSRware/jsimauxlib/ver#
    Where ver# is current JSim version number (example: 2.07) If on some other system, you'll need to download a copy of the extra libraries:
    • wget -r -np http://www.physiome.org/jsim/download/jsimauxlib/ver#/linux
    • mv www.physiome.org/jsim/download/jsimauxlib/ver# $JSIMSRC/jsimauxlib
    • rm -r -f www.physiome.org/
    • Set the environment variable JSIMAUXLIB=$JSIMSRC/jsimauxlib
    JSIMAUXLIB contains libsbml native libraries and redistributable JREs for each architecture. The libsbml library is specific to the jar file used in the source distribution, and other versions will not work.
  7. Build JSim entirely with the command jsbuild.all. If you are modifying JSim, examine this script to find short ways of building limited parts of JSim. This will save you a lot of time because the entire build takes a long time.
  8. You should now be able to launch your new built JSim GUI with jsim.db, or the JSim batch interface with jsbatch.db.

Building JSim on MacIntosh

Building JSim on MacOS is largely similar to build on Linux.

  1. Perform the following in a Bash shell.
  2. Create a new directory and unpack the source distribution .zip file, or NSR CVS checkout into it. Set environment variable JSIMSRC to this directory.
  3. Set your PATH to include $JSIMSRC/build.
  4. Sun's Java SDK 1.6 in already installed on MacIntosh and JSIMSDK does not need to be set here for JSim to build properly.
  5. Install gcc and gfortran version 4 on your system and edit $JSIMSRC/home/lib/Makefile.global.macos to match the appropriate locations.
  6. Download a copy of the extra libraries:
    • wget -r -np http://www.physiome.org/jsim/download/jsimauxlib/ver#/macos
    • Where ver# is current JSim version number (example: 2.07)
    • mv www.physiome.org/jsim/download/jsimauxlib/ver# $JSIMSRC/jsimauxlib
    • rm -r -f www.physiome.org/
    • Set the environment variable JSIMAUXLIB=$JSIMSRC/jsimauxlib
    JSIMAUXLIB contains libsbml native libraries for each architecture. The libsbml library is specific to the jar file used in the source distribution, and other versions will not work.
  7. Build JSim entirely with the command jsbuild.all. If you are modifying JSim, examine this script to find short ways of building limited parts of JSim. This will save you a lot of time because the entire build takes a long time.
  8. JSim versions 2.03 and above support or Intel-based MacIntoshes. The script jsbuild.fat, used in 2.02 and below, is no longer in use.
  9. You should now be able to launch your new built JSim GUI with jsim.db, or the JSim batch interface with jsbatch.db.

Building JSim on Windows

JSim's Windows build requires assistance from a helper Linux or MacIntosh workstation to build JSim Java code. Only Windows native code is built on Windows itself.

  1. Build JSim from source on your helper workstation, following the above instructions, with one change: the auxilliary libraries to be downloaded need to be the native windows versions, not ones for linux. If you are building on an NSR system, the above instructions need not be changed at all, as versions for all systems exist in /NSRware/jsimauxlib/. If you are not on an NSR system, download the win32 versions with the following commands:
    • wget -r -np http://www.physiome.org/jsim/download/jsimauxlib/ver#/win32
    • Where ver# is current JSim version number (example: 2.07)
    • mkdir -p $JSIMSRC/jsimauxlib
    • mv www.physiome.org/jsim/download/jsimauxlib/ver#/win32 $JSIMSRC/jsimauxlib/
    • rm -r -f www.physiome.org/
    • Set the environment variable JSIMAUXLIB=$JSIMSRC/jsimauxlib
    JSIMAUXLIB contains libsbml native libraries and redistributable JREs for each architecture. The libsbml library is specific to the jar file used in the source distribution, and other versions will not work.
  2. On your helper workstation, run jsdist.srcaux. This will create $JSIMSRC/dist/JSim_srcaux_2_??.zip.
  3. On your Windows workstation, install Cygwin (a Unix-like environment for Windows). Make sure sh, make and ldd are a part of the installation.
  4. Install Mingw versions of gcc 4.x and gfortran 4.x (http://www.mingw.org/). Do not use the Cygwin compilers since we need to generate libraries that depend only on MS Windows libraries.
  5. Perform the following operations in a Cygwin bash shell:
  6. Create a new directory and unzip the srcaux .zip file from above in it. Set the environment variable JSIMSRC to this directory.
  7. Edit $JSIMSRC/home/lib/Makefile.global.win32 to match the appropriate locations of gcc and gfortran (installed above) on your system.
  8. Set your PATH variable to include $JSIMSRC/build.
  9. Set the environment variables:
      JSIMAUXLIB=$JSIMSRC/auxlib
      JSIMJARDIR=$JSIMAUXLIB
      JSIMSDK=$JSIMAUXLIB/jre
    
  10. Build JSim native libraries with jsbuild.native. Do not run jsbuild.all like on other systems above. jsbuild.all does not work properly on Windows.
  11. You should now be able to launch your new built JSim GUI from Cygwin with jsim.db, or the JSim batch interface with jsbatch.db. (jsim.bat and jsbatch.bat will also work from a Windows command-line, or by double-clicking.)

Creating JSim binary distribution

Binary distribution may be created for all 3 supported platforms (Windows, MacIntosh, Linux) from either a Linux or MacIntosh workstation.

  1. Build JSim from source on your Linux or MacIntosh workstation.
  2. If you wish to build binary distributions for other platforms as well, build on those platforms and copy the architecture-specific files to $JSIMSRC/native.
  3. Run jsdist.bin ARCH, where ARCH is one of linux, macos, or win32. The resulting .zip archive will be created in $JSIMSRC/dist.
  4. Install your newly created .zip archive using the standard installation instructions for the target machine.

Running the JSim verify suite

$JSIMSRC/verify contains various regression tests of JSim computational functionality. These regressions tests are fairly exact for Linux builds, and somewhat less exact for other architectures. The fpack, xsim and xfunc tests are not currently supported under Windows. Run the suite as follows:

  1. Perform the following in a Bash shell.
  2. run ". jsverify.env DIST" where DIST is either "src" for the JSim source build or a home directory for a JSim binary distribution.
  3. cd $JSIMSRC/verify
  4. Execture "runall [SWITCHES] [DIRS]" where DIRS is a list of subdirectories to verify. If DIRS is empty, all subdirectories are verified. If DIRS is the special value "win32" (which is not a subdirectory), all subdirectories except fpack, xfunc and xsim are verified.
  5. The results of runall are saved in "log" and echoed to the screen. Examine the runall script for further details.
Comments or Questions?

[This page was last modified 06Jul12, 3:10 pm.]

Model development and archiving support at physiome.org provided by the following grants: NIH/NIBIB BE08407 Software Integration, JSim and SBW 6/1/09-5/31/13; NIH/NHLBI T15 HL88516-01 Modeling for Heart, Lung and Blood: From Cell to Organ, 4/1/07-3/31/11; NSF BES-0506477 Adaptive Multi-Scale Model Simulation, 8/15/05-7/31/08; NIH/NHLBI R01 HL073598 Core 3: 3D Imaging and Computer Modeling of the Respiratory Tract, 9/1/04-8/31/09; as well as prior support from NIH/NCRR P41 RR01243 Simulation Resource in Circulatory Mass Transport and Exchange, 12/1/1980-11/30/01 and NIH/NIBIB R01 EB001973 JSim: A Simulation Analysis Platform, 3/1/02-2/28/07.