top bar

Difference between revisions of "Building MM on Windows"

(Building the full source in one step)
(Building the full source in one step)
Line 104: Line 104:
 
   \projects\3rdpartypublic  ---- various open source libraries
 
   \projects\3rdpartypublic  ---- various open source libraries
 
   \projects\micromanager    ---- the latest and greatest source code in the world
 
   \projects\micromanager    ---- the latest and greatest source code in the world
 
  
 
Double check the environment variable JAVA_HOME points to your jdk, e.g.
 
Double check the environment variable JAVA_HOME points to your jdk, e.g.
Line 125: Line 124:
  
 
   buildscripts\Buildx64 FULL
 
   buildscripts\Buildx64 FULL
 +
 +
The final step of the build makes the installer using InnoSetup, the current builds scripts assume it's installed in:
 +
 +
  \projects\3rdparty\Inno_Setup_5\iscc.exe
  
 
== Additional Info ==
 
== Additional Info ==

Revision as of 15:27, 20 May 2011

Preparation

First make sure you have enough hard disk space. I don't know how much you will need but I would think if you have about 5GB you should be fine.

Directory structure for the source code

When you unzip the source code or download from the repository, the default directory for the entire source code should be "projects/micromanager". This directory should reside in the parent directory root of your choice. The root directory will be referred to as <root>. In the root directory you need to create a 3rdparty directory where you need to place needed software packages, and all SDKs needed for your hardware. You can download the development microManager source code via subversion at https://valelab.ucsf.edu/svn/micromanager2/trunk/

Required tools and applications

To build the entire application from the source code, you will need to install the following tools:

  1. Microsoft Developer Studio 2008 or 2010 Visual C++.
  2. JDK (Java developer's kit) standard edition, version 1.5 or later (Download from http://java.sun.com/javase/downloads/index.jsp.)
  3. ImageJ 1.44n9 or later (Download from http://rsb.info.nih.gov/ij/download.html and install with the setup executable. Easiest is to install in “c:/Program Files/ImageJ” to avoid changing paths later.)
  4. Beanshell 2.0.4 or later (Download bsh-2.0b4.jar from http://www.beanshell.org/download.html and place in <root>/3rdparty/Beanshell and copy to the plugins folder of the ImageJ folder installed in step 3.)
  5. Apache ANT (Download from http://ant.apache.org/. For installation this should work, if the directory is c:\ant
  6. A subversion client, for example: http://www.open.collab.net/downloads/subversion or

Assuming you've installed Java JDK 6.0 update 20, set the following "environment variables" goto My Computer / Properties / Advanced / Environment Variables / System variables and add the following new entries  :

ANT_HOME=C:\ant
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20
PATH=%PATH%;%ANT_HOME%\bin

Required open source libraries

In addition to software tools you will need to install the following software packages in the <root>/3rdparty directory:

  • SWIG version 1.3.4. Place it in "<root>/3rdparty/SWIG-1.3.40" subdirectory (Download from http://www.swig.org/download.html -> all releases, extract to <root>/3rdparty and install with swig.exe.)
  • The INPOUT32 library. Place it in "<root>/3rdparty/inpout32" subdirectory. (Download from http://www.logix4u.net/, extract, and build the library files. After building the inpout32 project you need to copy the inpout32.dll to <root>/micromanager1.3/bin, because this dll is required at run-time.)
  • Boost 1.42. Download Boost and place it in the "<root>3rdparty/boost" subdirectory. The easy way to do this is as follows:


1. In a command prompt, cd to <root>3rdparty, if this directory is not already a subversion working copy, issue the following command (assuming you've got subversion in your command path):

       svn co http://svn.boost.org/svn/boost/tags/release/Boost_1_42_0/ .

2. After boost has been downloaded, to build the bjam tool, in the <root>/3rdparty/boost directory issue:

        bootstrap

3. After the bjam.exe tool is built, issue:

        .\bjam --build-type=complete 

This step will take a while so go make yourself a cup of tea ;)


4. The result will be a set of libraries with the library type and threading model encoded in the library name, all headers will be in <root>\3rdparty\boost\boost and the libraries will be in <root>\3rdparty\boost\stage\lib

Device libraries and SDK's

Some device adapter require the installation of manufacturer's SDKs in order to build. All SDKs should be installed in the <root>/3rdparty directory. The actual names of SDK directories should match the paths in the corresponding header files in the Micro-manager source code for device adapters.

If you don't want to build one or more device adapters (because you don't have the SDK), you should remove corresponding projects from the master solution: MMCoreJ_wrap.sln.

Setting up library paths

The project files in the repository should have the correct path settings.

To deal with the flood of text in the Output window, in the Solution Explorer right-click and build one project at a time.

If you get an error:

       Target(FOO) does not match the Linker's OutputFile property value (BAR) ...

You could right-click > properties > Linker > General > Output File and strip the leading "mmgr_dal_" from the filename to satisfy it.

Building the C++ layer: MMCore and device adapters

You can build C++ part of the project by opening MMCoreJ_wrap.sln in MSDEV and running the full build. This will build the MMCore, Java wrappers and all device adapters. You can remove any device adapter project from the solution if you don't have the corresponding SDK or if you don't need to build it.

Building the Java layer: Micro-Manager Studio

Java layer of the Micro-Manager can be build using the standard ANT utility with build.xml project file, located in the <root>/micro-manager-1.3/mmstudio directory. Before running the build the project file build.xml must be modified to specify paths for external libraries: ImageJ and BeanShell.

<!-- EDIT PATHS BELOW TO MATCH YOUR SYSTEM -->

<!-- Specify the system path to the ImageJ root directory -->
<property name="ImageJPath" value="C:/Program Files/ImageJ"/>

<!-- Specify the system path to the beanshell jar -->
<property name="beanshell" value="C:/projects/3rdparty/BeanShell/bsh-2.0b4.jar"/>

<!-- DO NOT MODIFY FROM THIS POINT ON -->

In the mmstudio directory from the commandline, run:

     ant -buildfile build.xml cleanMMStudio compileMMStudio buildMMStudio

Building the full source in one step

To build the entire Micro-Manager project for Windows with a single command, µManager 1.4 provides a batch file in the source repository in buildscripts. You need to have the installed tools and libraries described above: ant, Java JDK, boost, zlib and some java jar stuff.

The precise versions of the libraries we use can be downloaded from:

 https://valelab.ucsf.edu/svn/3rdpartypublic/

Let's assume the following directory structure:

 \projects\3rdpartypublic  ---- various open source libraries
 \projects\micromanager    ---- the latest and greatest source code in the world

Double check the environment variable JAVA_HOME points to your jdk, e.g.

  C:\Program Files\Java\jdk

From the C++ source, you can build the 32 bit version with the free 'Express' version of Visual Studio, though per my understanding, you need at least the 'Professional' version to build the 64 bit binaries. As of this writing, we are using the 2008 version of Visual studio. It's been built and tested preliminarily with Visual Studio 2010 also.


To build the 32 bit binary, open a command prompt and type

 cd \projects\micromanager
 buildscripts\Build 

The 64 bit binary is built as follows:

 buildscripts\Buildx64

If you've got all the tools and libraries installed correctly, these scripts will build everything and automatically install µManager onto your system. By default, the builds are incremental, if you want to clean the binaries (don't know why this is ever necessary, except perhaps in the case of virus infections) specify FULL, e.g.

 buildscripts\Buildx64 FULL

The final step of the build makes the installer using InnoSetup, the current builds scripts assume it's installed in:

 \projects\3rdparty\Inno_Setup_5\iscc.exe

Additional Info

how to restore a mac and other useful advices

© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact