Development/Checkout and Build

From Soar Wiki

Jump to: navigation, search

This process has completely changed! See discussion tab for old process.

New instructions are a work in progress.

Contents

Summary

Visual Studio build process (Windows)

  • Check out SoarSuite trunk (explained below).
  • Set up environment for usage of SWIG, Java, Csharp, Tcl and Python.
  • Open SML solution in MSVC and build everything. Among other things, this creates sml.jar.
    • If you change environment variables, restart MSVC so it picks up the changes.
    • Also the ClientSML<Java | Tcl | CSharp | Python> projects have a hard time computing dependencies correctly. You may need to right click on these projects and select "Project Only -> Rebuild this project" to get them to compile correctly.

Python error

  • Note that, in the Debug configuration, the ClientSMLPython project will fail with something like:
ClientSMLPython, namely: 10>LINK : fatal error LNK1104: cannot open file 'python24_d.lib'

Using Eclipse for Java Projects

  • Create sml.jar by building all projects in Visual Studio.
  • Download swt.jar from http://ai.eecs.umich.edu/~soar/sitemaker/misc/jars/ and place it in SoarSuite\SoarLibrary\bin
    • Or copy appropriate SWT jar from your Eclipse\plugins folder (mine is currently org.eclipse.swt.win32.win32.x86_3.1.2.jar)
  • Open Eclipse
  • Set your compliance to Java 1.4.
    • Go to Window-->Preferences...
    • Select Java-->Compiler
    • Uncheck "Use default compliance settings"
    • Set Generated .class files compatibilty to 1.4
    • Set Source compatibility to 1.4
  • import all projects in SoarSuite tree. Here's how to do that:
    • Select File->Import... You should get the Import dialog
    • Select Existing Projects into Workspace and click Next
    • Select root directory = your SoarSuite directory. All the Soar projects should now be listed on the dialog.
    • Select all (if it hasn't already checked all of them) and click Finish
  • Set up Run/Debug configurations for Eclipse projects. When doing so, the SoarLibrary/bin directory must be in the PATH when these projects run. There are three ways to do this:
    • Place SoarSuite\SoarLibrary\bin in the system PATH before launching Eclipse.
    • Set the current working directory for each Java project to be SoarSuite\SoarLibrary\bin
      • In the Run dialog, select the environment tab
      • Select New...
      • Name: PATH and VALUE: $(workspace_loc:SoarLibrary/bin)
    • Run eclipse with a batch file like this (to avoid changing the global path):
 set PATH=%PATH%;e:\svn\Soar\SoarSuite\SoarLibrary\bin
 d:\eclipse\eclipse.exe
  • Without this step you'll get an error about failing to load Java_sml_ClientInterface when you try to run the Java app. This is the Java-SML SWIG library located in SoarLibrary\bin which in turn will load KernelSML and ElementXML libraries.
  • When you first import, you may get a build path error for JavaBaseEnvironment. We think this is an Eclipse bug. To fix it, you need to manually remove and re-add swt.jar and sml.jar. Here's how to do it:
    • Right click on JavaBaseEnvironment and select Build Path->Configure Build Path... The "Properties for JavaBaseEnvironment" dialog appears.
    • Select sml.jar and click the Remove button.
    • Select swt.jar and click the Remove button.
    • Select the Add JARs... button
    • In SoarLibrary/bin find swt.jar and click OK.
    • Repeat the previous two steps for sml.jar
    • Click OK to close properties dialog. The error should go away.

Checking out SoarSuite Trunk

Prerequisites

Process

TortoiseSVN Detail

  • Browse to your development folder using explorer.
  • Create a folder named SoarSuite
  • Right-click that folder, select SVN Checkout...
  • Enter the repository URL in the appropriate box.
  • Click OK.

Command Line Detail

  • Change to your development folder.
  • Run:
svn checkout https://winter.eecs.umich.edu/svn/soar/trunk/SoarSuite
  • The above step will create a SoarSuite folder containing the latest Soar code.

Linux Procedure

The Ubuntu procedure is detailed. Other systems can be adapted from that process.

Ubuntu 7.04 Desktop

  • Install packages (and dependencies):
    • scons
    • swig
    • sun-java6-jdk
    • subversion
    • libc6-dev
    • g++
    • eclipse
    • python-dev
  • select the correct vm:
update-java-alternatives -l
sudo update-java-alternatives -s java-6-sun
  • Check out the repository
svn checkout https://winter.eecs.umich.edu/svn/soar/trunk/SoarSuite
  • find and export JAVA_HOME, exact location may vary:
find /usr -iname jni.h
  • chop off /include/jni.h and export the rest in JAVA_HOME
    • example:
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.00
  • consider making this export permanent in .bash_profile or similar startup script
  • Export library load path:
export LD_LIBRARY_PATH=/path/to/SoarSuite/SoarLibrary/lib
  • consider making this export permanent in .bash_profile or similar startup script
  • run scons
scons

Eclipse Configuration

  • If you have built everything with SCons before entering the eclipse environment, you will already have swt.jar in SoarLibrary/bin. If you have not built everything, download http://ai.eecs.umich.edu/~soar/sitemaker/misc/jars/gtk/swt.jar
  • Change the JRE: After starting eclipse, visit
    • window -> preferences -> java -> installed JREs -> add -> browse to /usr/lib/jvm/java-6-sun...etc (same place that you set JAVA_HOME to above) and add that JVM.
    • uncheck the default jre and check the one you just added
  • Set up a debugging profile: run -> debug -> new java application
    • arguments tab: VM arguments: -ea
      • enables assertions
    • environment tab: new:
      • LD_LIBRARY_PATH
      • ${workspace_loc:SoarLibrary/lib}
Personal tools