Setting up a development version for JForces

Starting from a binary install

It is much easier to set up a developement install from an existing binary install. The binary install should install all system libraries including those needed to build JForces for a development version.

Step 1: Remove (or Backup) directories that should be under revision control

Run the following commands from the baseline directory (usually /home/forces) to move all the directories that need to be revision controlled out of the way:
  mkdir backup
  mv Autogen backup
  mv behavior backup
  mv common backup
  mv cshrc backup
  mv data backup
  mv db_patches backup
  mv forcesMap backup
  mv htdocs backup
  mv interfaces backup
  mv libraries backup
  mv ng-code backup
  mv pcomm backup
  mv rap backup
  mv rcvr backup
  mv scripts backup
  mv sim backup
  mv sim_extensions backup
  mv stratcam backup
  mv tcl_stuff backup
  mv tools backup
  mv wn backup
If the remote user is set up for access to the more restricted repositories also run the following:
  mv exec backup
  mv behavior-runtime backup

Step 2: Add host entry for git server

Look at the file /etc/hosts and make sure there is a line that looks like:
  71.216.49.141   GIT_SERVER
If not run the following command as root:
  echo "71.216.49.141   GIT_SERVER" >> /etc/hosts

Step 3: Clone the git repositories

Next set a variable equal to the user name you have on the git server by typing the following in a terminal (replace the contents of the quotes with your information).
  setenv REMOTE_USER "your user name"
In same terminal you should now be able to copy and paste in the following commands to close all the basic git repositories:
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/cshrc
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/scripts
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/tools
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/data
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/interfaces
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/pcomm
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/sim
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/wn
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/Autogen
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/db_patches
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/rap
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/behavior
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/forcesMap
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/rcvr
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/common
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/libraries
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/tcl_stuff
If the remote user is set up for access to the more restricted repositories also run the following:
  git clone ssh://$REMOTE_USER@GIT_SERVER/maestro_git/exec
  git clone ssh://$REMOTE_USER@GIT_SERVER/maestro_git/behavior-runtime

Step 4: move over static data

Not all of the data in the data directory is under revision control, you can populate the rest of the data in there with your old data directory using the following commands:
  cd $BASELINE/backup/data
  mv ccs cnf data_collection db_prototype defn_files DTED HFI hotstarts inputs intel jtids logfiles NWARS rap replay run_results sadl tmp VMAP xml $BASELINE/data

Step 5: Perform a big make

Now to test the new development install simply run the command:
Make
This should pop up a window, press the "GO" button. The window will change to a log of the compilation. Wait until the DISMISS button appears. After that check the bottom of the log and see if the line is green and says: "SUCCESS!! ALL CRITICAL MODULES INSTALLED ON THIS SYSTEM BUILT SUCCESSFULLY" if so then the development install is working. Multiple problems can occur with the build, read the output log for more information should you encounter one.

Step 5: Clean up

If everything has gone well then you won't need the backup directory that you made before, so simply delete it:
rm -fr $BASELINE/backup

Starting from scratch

For a variety of reasons it may not be possible to have a binary install before installing a development version.

Step 1: Installing required packages

Unfortunately these instructions will vary according to what version of linux you wish to install on. You will need at leas the following installed:

Step 2: Creating a user account to use jforces

It is preferred that a user is set up specifially to run jforces usually we call the user forces and that name will be used in all of the examples. Feel free to use a different user name if you need to. Run the following as root to create a user and set that user to use the c shell:
  useradd forces -d /home/forces -m -s /bin/tcsh

Step 3: Add host entry for git server

Look at the file /etc/hosts and make sure there is a line that looks like:
  71.216.49.141   GIT_SERVER
If not run the following command as root:
  echo "71.216.49.141   GIT_SERVER" >> /etc/hosts

Step 4: Checkout out the repositories from git

Next switch to the forces user and change to the directory you'd like to use as the baseline (usually /home/forces). Set a variable equal to the user name you have on the git server (the user will need access to all git repositories for this to work) by typing the following in a terminal (replace the contents of the quotes with your information).
  setenv REMOTE_USER "your user name"
In same terminal you should now be able to copy and paste in the following commands to close all the basic git repositories:
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/cshrc
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/scripts
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/tools
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/data
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/interfaces
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/pcomm
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/sim
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/wn
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/Autogen
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/db_patches
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/rap
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/behavior
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/forcesMap
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/rcvr
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/common
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/libraries
  git clone ssh://$REMOTE_USER@GIT_SERVER/forces_git/tcl_stuff
  git clone ssh://$REMOTE_USER@GIT_SERVER/maestro_git/exec
  git clone ssh://$REMOTE_USER@GIT_SERVER/maestro_git/behavior-runtime

Step 5: Setting up the environment

Now you will need to set up the environment. Run the following commands from the baseline directory (usually /home/forces):
  cp cshrc/.cshrc .
  cp cshrc/.odbc.ini .
To make sure the environment changes take effect everywhere it is best to log out and log back in before proceding to the next step.

Step 6: Adding Static Data

You will need to add additional data to the data directory for it to be complete. You can either download this data from the web at http://www.deadeyesoftware.com/support_files/data-static.tgz or make a static data tarball from an existing jforces install. To make a static data tarball from an existing install just run the following command from the baseline directory:
tar cvfz data/ccs data/cnf data/data_collection data/db_prototype data/defn_files data/DTED data/HFI data/hotstarts data/inputs data/intel data/jtids data/logfiles data/NWARS data/rap data/replay data/run_results data/sadl data/tmp data/VMAP data/xml data-static.tgz
After getting the static data tarball into the baseline directory on the new install simply run the following from the baseline directory:
tar xvfz data-static.tgz

Step 7: Making newmake

The newmake binary is critical for making everything else in JForces. To make a newmake binary simply run the command:
make_newmake

Step 8: Configuring Postgresql

It is reccommended that the forces be able to connect to the postgresql database as root with no password. Security policy may dictate otherwise in which case you'll need to allow full access to all the relavant databases.

Step 9: Loading the databases

Databases are archived in $BASELINE/data/archivedb load up all the adilib database any others you may need.

Step 10: doing a big make

Now to test the new development install simply run the command:
Make
This should pop up a window, press the "GO" button. The window will change to a log of the compilation. Wait until the DISMISS button appears. After that check the bottom of the log and see if the line is green and says: "SUCCESS!! ALL CRITICAL MODULES INSTALLED ON THIS SYSTEM BUILT SUCCESSFULLY" if so then the development install is complete. Multiple problems can occur with the build, read the output log for more information should you encounter one.