top bar

Difference between revisions of "Linux installation from source (Ubuntu)"

(Fix outdated ./run command.)
(One needs to use Oracle JDK since sun-java6-jdk is no longer in the Ubuntu repository)
Line 14: Line 14:
 
</pre>}}
 
</pre>}}
  
=== Other Required Programs and Libraries ===
+
=== Install JDK ===
 +
 
 +
If you are building the Micro-Manager Java GUI, Java 1.6 is recommended[http://imagej.1557.x6.nabble.com/Java-error-when-compiling-a-plugin-tp5004378p5004386.html].  This has to be fetched from Oracle's website since their licensing prohibits redistribution in Linux repositories.  [http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR Download the latest jdk-6*-linux-*.bin] from the archives (you must click "Accept License Agreement").
 +
 
 +
It may be possible to also use the distro-friendly OpenJDK (<code>default-jdk</code>) without too much effort. To start, you would have to patch the Micro-Manager <code>configure</code> file to find <code>jni.h</code> and possibly apply other fixes.
 +
 
 +
=== Install Build Programs and Libraries ===
  
 
You will need a subversion client to checkout the source code, several libraries, and build tools.  Install them with:
 
You will need a subversion client to checkout the source code, several libraries, and build tools.  Install them with:
  
{{Note|Heavy editing in progress: some dependencies may be missing}}
 
 
{{MessageBox|1=Commandline|2=<pre>
 
{{MessageBox|1=Commandline|2=<pre>
  
Line 27: Line 32:
 
You may also need to install additional packages (for cameras and special hardware).  See the full list in [[#Dependencies]]
 
You may also need to install additional packages (for cameras and special hardware).  See the full list in [[#Dependencies]]
  
=== Source Repositories ===
+
=== Fetch Source Repositories ===
  
 
Create a directory for the the subversion repositories, such as <code>~/mm</code>.  Besides the source tree, additional binary dependencies are stored in the <code>3rdpartypublic</code> repository.  The build scripts in the source tree assume <code>3rdpartypublic</code> is in the same parent folder level:
 
Create a directory for the the subversion repositories, such as <code>~/mm</code>.  Besides the source tree, additional binary dependencies are stored in the <code>3rdpartypublic</code> repository.  The build scripts in the source tree assume <code>3rdpartypublic</code> is in the same parent folder level:
Line 148: Line 153:
 
| Simplified Wrapper and Interface Library || <code>swig</code>
 
| Simplified Wrapper and Interface Library || <code>swig</code>
 
|-
 
|-
| Sun Java SDK || <code>sun-java6-sdk</code>
+
| Sun Java SDK || <code>openjdk-6-jdk</code>
 
|-
 
|-
 
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Optional Dependencies:
 
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Optional Dependencies:
Line 154: Line 159:
 
| Firewire Camera Library || <code>libdc1394-*-dev</code>
 
| Firewire Camera Library || <code>libdc1394-*-dev</code>
 
|-
 
|-
| Open Source Computer Vision Library || (FIXME)
+
| Open Source Computer Vision Library || <code>libopencv-dev</code>
 
|}
 
|}
  
 
{{Programming_Sidebar}}
 
{{Programming_Sidebar}}

Revision as of 14:37, 23 August 2013

Preparation

Install ImageJ

Download the Linux version of ImageJ from the NIH website. From a terminal, unzip to /usr/local/ and test that it runs:

Commandline

cd ~/Downloads/
sudo unzip ij*-linux*.zip -d /usr/local/
sudo chmod +r /usr/local/ImageJ
cd /usr/local/ImageJ/
./jre/bin/java -jar ij.jar

Install JDK

If you are building the Micro-Manager Java GUI, Java 1.6 is recommended[1]. This has to be fetched from Oracle's website since their licensing prohibits redistribution in Linux repositories. Download the latest jdk-6*-linux-*.bin from the archives (you must click "Accept License Agreement").

It may be possible to also use the distro-friendly OpenJDK (default-jdk) without too much effort. To start, you would have to patch the Micro-Manager configure file to find jni.h and possibly apply other fixes.

Install Build Programs and Libraries

You will need a subversion client to checkout the source code, several libraries, and build tools. Install them with:

Commandline

sudo apt-get install subversion build-essential automake libtool \
                     libboost-all-dev zlib1g-dev swig

You may also need to install additional packages (for cameras and special hardware). See the full list in #Dependencies

Fetch Source Repositories

Create a directory for the the subversion repositories, such as ~/mm. Besides the source tree, additional binary dependencies are stored in the 3rdpartypublic repository. The build scripts in the source tree assume 3rdpartypublic is in the same parent folder level:

Commandline

mkdir ~/mm
cd ~/mm
svn co https://valelab.ucsf.edu/svn/micromanager2/trunk/ micro-manager1.4
svn co https://valelab.ucsf.edu/svn/3rdpartypublic/

This creates 2 new folders in the mm directory:

    ~/mm/micro-manager1.4
    ~/mm/3rdpartypublic

Add the Beanshell and SwingX to the ImageJ plugins directory:

Commandline

cd ~/mm/3rdpartypublic/classext
sudo cp bsh-2.0b4.jar swingx-0.9.5.jar /usr/local/ImageJ/plugins/

Create a new micro-manager directory in /usr/lib/

Commandline

sudo mkdir /usr/lib/micro-manager

Building Micro-Manager

Create the Autotools files

configure uses the bundled version of ImageJ:

Commandline

cd ~/mm/micro-manager1.4
./mmUnixBuild.sh
./configure --with-imagej=/usr/local/ImageJ

Compile

Commandline

make

Install

Commandline

sudo make install
sudo ldconfig

Post Install

Create the startup script

Micro-Manager requires the path to /usr/lib/micro-manager. Create the 4 line Bash script below in /usr/local/ImageJ and save it as, say, mmscript.

File: mmscript

#!/bin/bash
cd /usr/local/ImageJ
export LD_LIBRARY_PATH=.:/usr/local/lib:/usr/lib/micro-manager:/usr/local/ImageJ
java -mx1200m \
     -Djava.library.path=/usr/lib/micro-manager:/usr/local/ImageJ \
     -Dplugins.dir=/usr/local/ImageJ \
     -cp /usr/local/ImageJ/ij.jar:usr/local/jdk1.5.0_04/lib/tools.jar \
      ij.ImageJ

Make the script executable:

Commandline

sudo chmod +x mmscript

Running Micro-Manager

Start ImageJ with your new script:

Commandline

./mmscript &

Run Plugins > Micro-Manager > Micro-Manager Studio

Appendix

Dependencies

You need the following packages:
Name Equivalent Synaptic package name
Required Dependencies:
Subversion subversion
GNU C++ build-essential
GNU Autotools automake
GNU Libtool libtool
Boost libraries libboost-all-dev
zlib compression library zlib1g-dev
Simplified Wrapper and Interface Library swig
Sun Java SDK openjdk-6-jdk
Optional Dependencies:
Firewire Camera Library libdc1394-*-dev
Open Source Computer Vision Library libopencv-dev
© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact