Building JSim From Source
This page is for the older JSim version 1.6. Click here for the latest JSim 2.0 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. 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 LICENSE file found in the distribution root directory.
- Version numbers
- Source distribution content
- Building the complete JSim source distribution
- Creating a JSim binary distribution
- The JSim Verification Suite
- Building JSim for Windows
Version numbers:
JSim version numbers are of the form 1_6_## for public and beta releases and 1_6_##alpha# for alpha (highly preliminary) releases, where the # are integers. All copies of public and beta releases should be built from identical source, however alpha releases may vary depending on which developer was working on the code. Bug reports should only be sent for public and beta releases.
Source distribution contents:
- README - start here
- license.html - licensing agreement, READ BEFORE USE !!!
- JSim/ - JSim's java and non-java source code
- home/ - static contents of $JSIMHOME (no local classes)
- build/ - build, test and distribution scripts
- linux/ - linux OS specific directory
- macos/ - Macintosh OS X specific directory
- win32/ - Windows OS specific directory
- unix/ - Common material for Unix-based OS'es (non Windows)
- third/ - misc 3rd party contributions to JSim
- fpack/ - JSim Fortran package of XSIM-compatible models (available via CVS access only)
- VERIFY/ - verification suite (available via CVS access only)
Contents of OS specific directories. When multiple chip-architectures are supported for an OS, these files may be repeated for each architecture:
- jre.zip - Java Run-time distribution (available via CVS access only)
- jre.notes - information on how jre.zip was created
- jsrun.skel - skeleton for distributed jsim, jsbatch & jsserver
- bin/ - OS-specific launch scripts
- lib/ - OS-specific libraries
- JSim.app/ - (Mac only) template for application bundle
Building the complete JSim source distribution:
The following build process assumes you have a Unix-like environment with C and Fortran compilers, the make utility, with Sun's java developer kit. Amoung JSim platforms, this assumption is violated only by Windows . Here JSIMOS will refer to the appropriate operating system (linux, macos, win32), JSIMARCH will refer to the hardware architecture (i386, ppc). Java SDK, make, gcc and gfortran are expected to be available. Versions used for NSR binary distributions are:
- all OS - Java SDK 1.4 or 1.5, see JSIMOS/jre.notes for additional details.
- linux_i386 - Redhat EL, gcc 4.2.0, gfortran 4.2.0
- macos_ppc - Darwin 8.7.0, gcc 4.0.0, gfortran 4.2.0
- macos_i386 - Darwin 8.7.1, gcc 4.0.1, gfortran 4.2.0
- win32 - need info here
Set environment variables:
- JSIMSDK = your Java SDK (e.g. /usr/local/jdk). For NSR production builds, a version of Sun's Java 1.4 SDK is used.
- JSIMJRE = Java JRE, if different from SDK. If not present, this defaults to your JSIMSDK. Currently JSim distribs are built with Java 1.4, but distributed with Java 1.5 on most platforms. This variable is new with JSim 1.6.68. For NSR production builds, a version of Sun's Java 1.5 SDK is used on all platforms that support it (all except IA64). Specifying /Library/Java/home under MacOS will use 1.5 if it is available.
- JSIMSRC = the absolute path of the source distribution.
- PATH = should include $JSIMSRC/build so the build scripts will work properly.
- Note: JSIMOS, JSIMARCH, JSIMG2CLIB variables that had to be set in earlier JSim releases no longer need to be set by the user.
Customize makefiles:
- OS-specific makefiles may be found in $JSIMSRC/home/lib. The distributed versions are set up for NSR file systems. You may need to modify them for the location of compilers and libraries on your system.
Build JSim via "jsbuild.all":
- Note any error messages.
- The non-java build gives messy messages, even if it works.
- If you're modifying source code, examine this script and others in build/ to see how they work.
If you have CVS access, you may also build the fpack models via jsbuild.fpack. There will be some warning messages which have not caused any known problems.
Native libraries created during a JSim build are placed in an architecture specific directory in $JSIMSRC/NATIVE. This directory will be named either OS or OS_ARCH when OS is the operating system, and ARCH is the hardware architecture.
$JSIMSRC/build contains debug versions of the JSim programs jsim, jsbatch, jsfim and jsserver, each with the suffix .db. These versions should run correctly after a successful build.
On Macintosh, a single jsbuild.all will create either macos_i386 or macos_ppc, depending upong the local architecture. To create macos fat (universal i386 + ppc) libraries run jsbuild.all twice, once on each architecture, and place both macos_i386 and macos_ppc in $JSIMSRC/NATIVE. Then run jsbuild.fat to create the fat libraries in $JSIMSRC/NATIVE/macos. Set shell variable JSIMFAT=true to allow the .db programs to access the fat libraries.
Creating a JSim Binary Distribution
This section describes creating a JSim binary distribution .zip file, which allows you to distribute your JSim build (see previous section) to others. Such distributions must be in accordance with license terms (above).
Examine jsbuild.osarch to determine the appropriate OSARCH strings for your distribution, e.g. linux_i386, macos (universal binary), macos_i386, macos_ppc, win32.
Find the jre.notes file appropriate for your OSARCH and make sure a corresponding jre.zip exists in the same directory. This step is not required for:
- Macintosh distributions, which use the OS's built-in JRE;
- those with NSR CVS access, since the appropraite jre.zip is part of the CVS archive.
Run "jsdist.bin OSARCH". This will create a new .zip file in $JSIMSRC/DIST named for the JSim version number and OSARCH.
The JSim Verification Suite
$JSIMSRC/VERIFY contains verification scripts for JSim computations. See instructions in that directory. Run ". jsverify.env src" before running verify scripts to verify the debug version, or ". jsverify.env $JSIMHOME" to verify a binary distribution.
This suite is currently available only to those with NSR CVS access. In the future, we hope to provide an open source version of this suite, however it is not ready for prime time yet.
Building JSim for Windows
See the separate document Building JSim for Windows.
[This page was last modified 02Feb11, 3:22 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.
