Building Photon
TracNav menu
-
Marketcetera
-
Overview
- Photon
- ORS
- Tradebase
- OrderLoader
- Virtual Appliance
- User Mailing List
- Download
- License
- Reporting Bugs
-
Documentation
- Marketcetera Platform Configuration
- ORS Guide
- Photon Installation and Configuration
- Photon Guide
- Photon Scripting
- Tradebase Guide
- OrderLoader Guide
- Configuration Files Guide
- Configuring Market Data Feeds
- Order Limits
- Excel Integration
- .NET Support
-
Support
- Support
- User FAQ
- Developer FAQ
-
For Developers
- Architecture
- Building Marketcetera Platform
- Building Photon
- Building Tradebase
- Building Appliance
- Building MarketceteraCOM
- FIX Overview
- Developer Mailing List
- Developer Notes
- Contribute!
- Reading List
- Third-party Dependencies
- Exchange Simulator
- JavaDoc
- Blog
Table of Contents
Prerequisites
In order to build Marketcetera Photon from the source you must have the following software installed:
- Java JDK version 1.6 (Java 6) or greater
- Eclipse version 3.3.2 (Europa-Winter, Ganymede won't work on a Mac)
Due to a bug in the Eclipse Platform Build, the fully automated build is only available on non-Windows platforms. Please see below on how to build and run Photon from inside the Eclipse IDE on all platforms.
Note that due to a bug in Eclipse RCP, Photon and the platform currently does not run on MacOSX out of the box. Please see the MacOS Eclipse setup on how to work around this problem.
Set up the Target Platform
You should first set up a separate target platform for Eclipse. Photon is currently built on version 3.3.0 of the Eclipse RCP and it is unlikely to work with any other version. You need to download the "europa-winter" Eclipse for RCP/Plug-in developers and place it in a separate directory
- Eclipse for RCP/Plug-in Developers - Windows binary
- Europa-Winter RCP Target Platform - general download page
- Download the additional plugins required for compilation and place them in the <target platform>/plugins directory
Make sure you get the "europa-winter" release and not the latest 3.4 release.
Get the Source
Please follow the instructions from building platform to setup and compile the platform code and generate the Eclipse project files (see below). Photon code will be part of the overall platform download. Feel free to skip the database setup sections as they are not necessary for Photon.
The following instructions will use C:\workspace (Windows Cygwin) and /opt/workspace (Linux) as the ${WSROOT}. Any operating system specifics are indicated.
To build all code, including Photon, from within Eclipse, follow these steps:
- Pull the latest Photon source into your workspace "code" directory (eg. C:\workspace\code) by executing the following. You may want to edit profiles.xml as noted earlier.
$ cd ${WSROOT} $ mkdir code $ cd code $ svn co http://code.marketcetera.org/root/tags/0.5.0 marketcetera-platform $ cp profiles.xml.sample profiles.xml - Create Eclipse metadata files by executing the following:
$ cd ${WSROOT}/code/marketcetera-platform $ mvn eclipse:eclipse - Start Eclipse by executing C:\eclipse\eclipse.exe (Windows) or /opt/eclipse/eclipse (Linux). Close the Welcome Page.
- (Ubuntu 8.04 Desktop) During eclipse startup, a message about your security system is not initialized comes up. The workaround is the create ~/.mozilla/eclipse directory
$ mkdir -p ~/.mozilla/eclipse
- Configure Eclipse as follows:
- Select Window > Preferences from the menu.
- Navigate to Java > Build Path > Classpath Variables. Click New.
- For Name, enter "M2_REPO".
- For Path, click the Folder button, browse and set the path to be your maven repository C:\Documents and Settings\<your account>\.m2\repository (Windows) or ~/.m2/repository (Linux).
- Navigate to Plug-in Development->Target Platform.
- For Location, browse to C:\share\eclipse-rcp-target-3.3.0 (Windows) /opt/share/eclipse-rcp-target-3.3.0 (Linux) or wherever you've placed your RCP target platfrom from previous step
- Navigate to Run/Debug->String Substitution. Click New.
- For Name, enter "maven_exec".
- For Value, click the browse button, browse and set the path to mvn <mvn install dir>\bin\mvn.bat (Windows) /usr/local/bin/mvn (Linux).
- Import projects into Eclipse:
- Right-Click in the Package Explorer window (in the empty space) and select Import.
- Select General > Existing Projects into Workspace. Click Next.
- Click Browse to select the root directory of ${WSROOT}/code/marketcetera-platform/source. Deselect 'webapp', click OK, then Finish.
- Projects are autobuilt. Wait until the status bar on the bottom right indicates that the build is complete.
- Run Photon:
- Right-Click "org.marketcetera.photon" in the Package Explorer.
- Select Run As > Eclipse Application .
Once you have executed Photon and ORS at least once, the run button (green with white triangle on the toolbar) will have a dropdown menu attached to it, from which you can select to re-run either photon or the ORS. (Or both: start the ORS, then Photon.)
If you have more than one app running within Eclipse, you use the buttons right over the console to kill the app whose console is shown (the red Stop button), or switch the visible console to another app (the Display Selected Console icon).
Remove "-consoleLog" from the default MacOS configuration
Strangely the Info.plist files in the org.eclipse.platform.launchers features contain the "consoleLog" command line switch for the Eclipse-based executables. This switch which is useful in debugging, causes many unneccesary messages to be printed to the console in Photon. To remove this switch edit the following two files in your target platform directory:
- features/org.eclipse.equinox.executable_3.3.0.v20070606-7C--E9IgKLWLDUE/bin/carbon/macosx/x86/Eclipse.app/Contents/Info.plist
- features/org.eclipse.equinox.executable_3.3.0.v20070606-7C--E9IgKLWLDUE/bin/carbon/macosx/ppc/Eclipse.app/Contents/Info.plist
and remove the line:
<string>-consoleLog</string>
Command-line PDE build
Edit the file $PHOTON_SVN_DIR/plugins/org.marketcetera.photon.build/build.properties and change the values of two properties:
- buildDirectory -- set this to be the value of $PHOTON_SVN_DIR
- baseLocation -- set this to be the value of $RCP_TARGET_DIR
Then, to run the build from the command line:
%> cd $PHOTON_SVN_DIR %> java -jar $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.0.0.v20070606.jar \ -application org.eclipse.ant.core.antRunner \ -buildfile $ECLIPSE_HOME/plugins/org.eclipse.pde.build_3.3.0.v20070612/scripts/productBuild/productBuild.xml \ -Dbuilder=$PHOTON_SVN_DIR/plugins/org.marketcetera.photon.build/
When it finishes there should be a directory named I.<versionnum> containing Photon builds for several plaftorms.
