How to build the software

This page just explains how to build the software needed for OpenSPIM. For an overview of the source code, please have a look at this page.

= QuickStart =

First, make sure you have your camera driver installed!

If you have access to the OpenSPIM DropBox, just download & run the OpenSPIM development environment installer. This will set up everything you need and perform the initial build.

If you do not have access to the DropBox, please follow the following instructions.

= Manual setup =

First, make sure you have your camera driver installed!

You need Git
First of all, you need to make sure that you have the version control software Git installed. If in doubt, just install Git for Windows.

Cloning the Micro-Manager and support sources
Wherever you like, e.g. in your home directory, call these commands:


 * 1) git clone git://fiji.sc/micromanager1.4 micromanager
 * 2) cd micromanager
 * 3) git checkout -t origin/openspim
 * 4) cd ..
 * 5) git clone git://fiji.sc/mmanager-3rdparty 3rdpartypublic
 * 6) cd 3rdpartypublic
 * 7) git checkout -t origin/openspim

Building Micro-Manager
First, make sure that the environment variable JAVA_HOME is set and points to a valid JDK (you can add environment variables by right-clicking on the "Start" menu button, choosing "Open Windows Explorer", opening the context menu of "My Computer", selecting "Properties" and in the "Advanced mode" click on the "Environment variables" button. You need to restart the Visual Studio after adding the environment variable).

After installing Visual Studio Express 2008, continue as described on the uManager Wiki.

Why Microsoft Visual C++?
There exists a free and Open Source alternative to Microsoft Visual C++: GNU C++.

Unfortunately, it is impossible to build µManager on Windows with the GNU C++ compiler. The reason is that Microsoft Visual C++ uses an Application Binary Interface (ABI) which predates, and is incompatible with, the standard defined by the C++ consortium, but GNU C++ abides by the standard. All of the shared libraries provided by vendors were compiled for Microsoft Visual C++, though, so linking using GNU C++ is impossible.

= Debugging =

Look at the CoreLog
Whatever you do, first have a look at the file CoreLog .txt, located in the directory Micro-Manager was started from (this is not necessarily the directory where it is installed, beware!).

When Micro-Manager does not list the driver

 * 1) Make sure the .dll is present in dist/mm/Win32/
 * 2) Use the Dependency Walker to detect missing dependencies

Micro-Manager just crashes when I connect
Micro-Manager's memory management is not very safe on the driver side. Try to start Fiji with less memory reserved for Java, e.g. --mem=512m.

If that does not help, try to find out what's in, and if that fails, too, you might have more luck.

Using Visual Studio's interactive debugger
Start Fiji, and before starting Micro-Manager use Visual Studio's Debug>Attach to Process... to attach to the process. After that, you may set breakpoints (optional) and then start Micro-Manager in Fiji.

Using Eclipse to debug MicroManager/SPIM Acquisition

 * 1) Make sure you have Eclipse installed.
 * 2) Add Fiji's JRE to Eclipse:
 * 3) Window -> Preferences; under Java, select Installed JREs and click Add...
 * 4) Use Standard VM.
 * 5) Set the JRE Home to fiji/java//jdk1.6.0_24 (or similar). Eclipse should fill in the rest.
 * 6) Click Finish.
 * 7) Check the checkbox next to the newly-added JRE.
 * 8) Create a new project for Micro-Manager Studio:
 * 9) File -> New -> Java Project...
 * 10) Uncheck "Use Default Location"
 * 11) Point Location to fiji/3rdparty/micromanager/mmstudio
 * 12) Eclipse should auto-configure all sorts of useful things.
 * 13) Click Next.
 * 14) On the Libraries tab, click Add External JARs...
 * 15) From fiji/3rdparty/micromanager/dist/jars:
 * 16) * bsh.jar
 * 17) * commons-math-2.0.jar
 * 18) * ij.jar
 * 19) * MMCoreJ.jar
 * 20) * MMAcqEngine.jar
 * 21) * swing-layout-1.0.4.jar
 * 22) * swingx-0.9.5.jar
 * 23) Click Finish.
 * 24) Create a project for SPIMAcquisition:
 * 25) File -> New -> Java Project...
 * 26) Uncheck "Use Default Location"
 * 27) Point Location to fiji/3rdparty/micromanager/plugins/SPIMAcquisition
 * 28) Let Eclipse auto-configure things.
 * 29) Click Next.
 * 30) On the Projects tab, click Add... and select the mmstudio project added above.
 * 31) On the Libraries tab, click Add External JARs...
 * 32) From fiji/3rdparty/micromanager/dist/jars:
 * 33) * ij.jar
 * 34) * MMCoreJ.jar
 * 35) Click Finish.
 * 36) Depending on your workspace settings, you may need to reduce the enforced JRE level for both projects:
 * 37) Right click on each project and go to Properties.
 * 38) Select Java Compiler.
 * 39) Enable project-specific settings and set the Compiler Compliance Level to 1.6 (depending on the JDK used by FIJI).
 * 40) Click Apply then OK.
 * 41) Set up the debug configuration:
 * 42) Run -> Debug Configurations...
 * 43) Create a fresh launch configuration
 * 44) Use SPIMAcquisition as the project.
 * 45) For the Main class, click Search... and find ij.ImageJ
 * 46) On the Arguments tab, under VM arguments, pass the following:   (modifying as appropriate).
 * 47) On the Classpath tab, select SPIMAcquisition, then Add External JARs...
 * 48) From fiji/3rdparty/micromanager/dist/jars:
 * 49) * MMAcqEngine.jar
 * 50) Click Apply.
 * 51) Click Debug to make sure everything works.

= Further reading =

A birds-eye view of the OpenSPIM source code