Development/Checkout and Build
From Soar Wiki
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.
- If you're only interested in C++ you can skip all of the SWIG/Java/CSharp/Tcl/Python steps and just choose the "Debug/Release (no SWIG)" configuration to build in the Visual Studio Solution.
- Download and install SWIG from http://www.swig.org/ (version 1.3.34)
- Download and install Java JDK from http://java.sun.com/j2se/
- Download and install Tcl from http://aspn.activestate.com/ASPN/Downloads/ActiveTcl/
- Note: As of Soar 8.6.2, only non-threaded Tcl builds are supported (i.e. nothing later than 8.4.11.1)
- This version of Tcl is good: http://downloads.activestate.com/ActiveTcl/Windows/8.4.11/ActiveTcl8.4.11.1.175185-win32-ix86.exe
- Download and install Python from http://www.python.org/download/
- Install only Python 2.4.x, such as 2.4.4: http://www.python.org/download/releases/2.4.4/
- Set JAVA_BIN to path to JDK bin folder (containing javac.exe)
- Set JAVA_INCLUDE to path to JDK include folder (containing jni.h)
- Set SWIG to path to Swig folder (containing swig.exe)
- Set TCL_BIN to path to Tcl bin folder (containing tclsh.exe)
- Set TCL_LIB to path to Tcl lib folder (containing tcl84.lib)
- Set TCL_INCLUDE to path to Tcl include folder (containing tcl.h)
- Set PY_LIB to path to Python libs folder (containing python24.lib)
- Set PY_INCLUDE to path to Python include folder (containing Python.h)
- Add C:\Path\To\jdk1.6.0_03\bin to PATH (containing java.exe)
- 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
- Subversion client
- TortoiseSVN: http://tortoisesvn.tigris.org/
- Command line: http://subversion.tigris.org/
- A Winter apache user name and password. You can test if you have one by opening the repository folder URL (below) and logging in.
Process
- Check out the following URL using Subversion:
- Download the correct swt.jar for your platform and place it in SoarSuite/SoarLibrary/bin:
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
- ...3 times, the first two attempts will fail because of scons issue 1672
- http://scons.tigris.org/issues/show_bug.cgi?id=1672
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}
- arguments tab: VM arguments: -ea
