Building JSim for Windows
Introduction
This page describes building a JSim distribution for Windows. Since some of the JSim build and distribution scripts do not currently run properly on Windows, a Windows machine is used only to build the JSim native libraries and a Linux or MacIntosh is required to assemble the final distribution.
Instructions below were tested using a Windows 7 platform with Linux assistance. Other Windows versions (XP, Vista) may need to adjust appropriately.
Contents:- Software tools needed to build Windows native libraries
- Building Native libraries for Windows.
- Creating a Windows binary distribution.
Tools used for Windows 7 (win32) JSim Native libraries build.
- Sun Java 1.5 SDK,
- Cygwin,sh, make, ldd, etc should be include in the installation.
- mingw versions of gcc 4.x and gfortran 4.x (Do not use g77 compiler)
Building JSim Native Libraries Only
This section assumes access to JSim source build on a Linux host.JSim distribution from NSR uses archived native libraries for win32 and macos. These libraries must be remade and rearchived whenever changes are made to files in the JSim/nonJava directory. The process is outlined below for each the MS Windows operating system:
On Linux Host:- Use a CVS committed Linux source release.
- Run "jsdist.natsrc" on the linux build platform to create a native source release with prebuilt java classes (JSimClient.jar and JSimServer.jar). Go to $JSIMSRC/DIST to get zip file (ex:JSim_natsrc_1_6_#.zip).
- Unpack the distribution on the target MS Windows host.
- Confirm appropriate 3rd party tools (see above) are installed on MS Windows host. sh, make, gcc, gfortran and make should be available.
- Use Cygwin environment (linux environment emulation).
- Set environment as above. Set JSIMSDK to the location of the JAVA SDK, it is not needed for native library build but is needed for running the debug version of JSim. Set JSIMJARDIR to the directory containing JSimClient.jar & JSimServer.jar in the native source distribution. Make sure $PATH has '.' in it to run scripts in working directory.
Examples:- export JSIMJRE=/cygdrive/c/Java/jre1.5.0_22
- export JSIMSDK=/cygdrive/c/Java/jdk1.5.0_22
- export JSIMSRC=~/JSIM/BUILDTEST/SRC1.6
- export PATH=$PATH:$JSIMSRC/build:.
- export JSIMJARDIR=$JSIMSRC/home/lib
- Run "jsbuild.native" to generate the native libraries. (All build scripts are in $JSIMSRC/build/)
- Confirm native libraries are free of dependencies on mingw or cygwin libraries. You only want dependencies on Windows system dlls:
- Go to $JSIMSRC/NATIVE/win32/nml and use ldd to determine dependencies.
- Example: 'ldd odesolver.dll'
ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll (0x77080000)
kernel32.dll => /cygdrive/c/Windows/system32/kernel32.dll (0x765c0000)
KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll (0x75300000)
msvcrt.dll => /cygdrive/c/Windows/system32/msvcrt.dll (0x766b0000)
libgfortran-3.dll => /cygdrive/c/MinGW/bin/libgfortran-3.dll (0x6f600000) <---- Has dependency on MinGW
ADVAPI32.DLL => /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x768c0000)
sechost.dll => /cygdrive/c/Windows/SYSTEM32/sechost.dll (0x771c0000)
RPCRT4.dll => /cygdrive/c/Windows/system32/RPCRT4.dll (0x754d0000)
- If you find dependencies then you must remove them by getting those libraries linked statically (check Makefile.global.win32).
- Confirm JSim works on Windows 7 system with jsim.db (located in $JSIMSRC/build dir). Create a model that uses a PDE and run with toms solver to confirm native libraries are working.
- Run Verification suite on Windows to verify build.
- '. jsverify.env src' <<---- Sets environment for running suites.
- go to $JSIMSRC/VERIFY/ and run rundiffs script ( './rundiffs')
- The diffs may be off as the significant digits used are large. Also some scripts appear broken for win32 and need to be investigated.
Creating a Windows binary distribution
Build a binary distrib of JSim:- Copy native libs (dlls) from Windows host to linux host (into NATIVE/OS/ dir) that built jar files.
- Set env:
- export CVSROOT=/cvsroot/JSIM/
- export JSIMSDK=/usr/local/jdk
- export JSIMSRC=/user1/bartj/cvs_jsim/SRC1.6
- export PATH=$PATH:$JSIMSRC/build - Confirm jre.zip is in appropriate dir (SRC1.6/win32/ for Windows).
- run jdist.bin OS ('jsdist.bin win32'):
- zip file should be created in SRC1.6/DIST/ directory
[This page was last modified 11May10, 11:16 am.]
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.
