top bar

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

(update instructions to make sure it compiles correctly and simplify java installation)
(fix formatting)
Line 1: Line 1:
== Preparation ==
+
= Preparation =
  
=== Install JDK ===
+
== Install JDK ==
  
 
If you are building the Micro-Manager Java GUI, Java 1.6 or 1.7 is recommended[http://imagej.1557.x6.nabble.com/Java-error-when-compiling-a-plugin-tp5004378p5004386.html]. The simplest way is to use [https://launchpad.net/~webupd8team/+archive/java webupd8team PPA]:
 
If you are building the Micro-Manager Java GUI, Java 1.6 or 1.7 is recommended[http://imagej.1557.x6.nabble.com/Java-error-when-compiling-a-plugin-tp5004378p5004386.html]. The simplest way is to use [https://launchpad.net/~webupd8team/+archive/java webupd8team PPA]:
Line 15: Line 15:
 
{{Note|It may be worth trying to use [[#OpenJDK instead of Sun JDK]]}}
 
{{Note|It may be worth trying to use [[#OpenJDK instead of Sun JDK]]}}
  
=== Install ImageJ ===
+
== Install ImageJ ==
  
 
Ensure you don't have the Ubuntu package installed:
 
Ensure you don't have the Ubuntu package installed:
Line 34: Line 34:
 
</pre>}}
 
</pre>}}
  
=== Install Build Programs and Libraries ===
+
== 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:
Line 46: Line 46:
 
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]]
  
=== Fetch 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 68: Line 68:
 
{{MessageBox|1=Commandline|2=<pre>
 
{{MessageBox|1=Commandline|2=<pre>
  
sudo cp 3rdpartypublic/classext/bsh-2.0b4.jar 3rdpartypublic/classext/swingx-0.9.5.jar /usr/local/ImageJ/plugins/
+
cd ~/mm/3rdpartypublic/classext
 +
sudo cp bsh-2.0b4.jar swingx-0.9.5.jar /usr/local/ImageJ/plugins/
 
</pre>}}
 
</pre>}}
  
== Building Micro-Manager ==
+
= Building Micro-Manager =
  
=== Create the Autotools files ===
+
== Create the Autotools files ==
  
 
<code>configure</code> uses the bundled version of ImageJ:
 
<code>configure</code> uses the bundled version of ImageJ:
Line 81: Line 82:
 
cd ~/mm/micro-manager1.4
 
cd ~/mm/micro-manager1.4
 
./mmUnixBuild.sh
 
./mmUnixBuild.sh
./configure --with-imagej=/usr/local/ImageJ --with-javaincl=/usr/lib/jvm/java-7-oracle/include/
+
./configure --with-imagej=/usr/local/ImageJ \
 +
            --with-javaincl=/usr/lib/jvm/java-7-oracle/include/
 
</pre>}}
 
</pre>}}
  
=== Compile ===
+
== Compile ==
  
 
{{MessageBox|1=Commandline|2=<pre>
 
{{MessageBox|1=Commandline|2=<pre>
Line 91: Line 93:
 
</pre>}}
 
</pre>}}
  
=== Install ===
+
== Install ==
  
 
{{MessageBox|1=Commandline|2=<pre>
 
{{MessageBox|1=Commandline|2=<pre>
Line 99: Line 101:
 
</pre>}}
 
</pre>}}
  
== Post Install ==
+
= Post Install =
  
=== Create the startup script ===
+
== Create the startup script ==
  
 
Micro-Manager requires the path to <code>/usr/lib/micro-manager</code>. Create the 4 line Bash script below in <code>/usr/local/ImageJ</code> and save it as, say, <code>mmscript</code>.
 
Micro-Manager requires the path to <code>/usr/lib/micro-manager</code>. Create the 4 line Bash script below in <code>/usr/local/ImageJ</code> and save it as, say, <code>mmscript</code>.
Line 124: Line 126:
 
</pre>}}
 
</pre>}}
  
== Running Micro-Manager ==
+
= Running Micro-Manager =
  
 
Start ImageJ with your new script:
 
Start ImageJ with your new script:
Line 135: Line 137:
 
Run <code>Plugins > Micro-Manager > Micro-Manager Studio</code>
 
Run <code>Plugins > Micro-Manager > Micro-Manager Studio</code>
  
== Appendix ==
+
= Appendix =
  
=== Dependencies ===
+
== Dependencies ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 168: Line 170:
 
|}
 
|}
  
=== OpenJDK instead of Sun JDK ===
+
== OpenJDK instead of Sun JDK ==
  
 
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.in</code> file to find <code>jni.h</code>[https://bugzilla.redhat.com/show_bug.cgi?id=498964#c2] and possibly apply other fixes.
 
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.in</code> file to find <code>jni.h</code>[https://bugzilla.redhat.com/show_bug.cgi?id=498964#c2] and possibly apply other fixes.
  
 
{{Programming_Sidebar}}
 
{{Programming_Sidebar}}

Revision as of 05:06, 19 November 2013

Preparation

Install JDK

If you are building the Micro-Manager Java GUI, Java 1.6 or 1.7 is recommended[1]. The simplest way is to use webupd8team PPA:

Commandline

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get install oracle-java7-installer

Alternatively, you can download and run jdk-7*-linux-*.bin per the JDK Ubuntu instructions. Download the latest jdk-7*-linux-*.bin from the archives (you must click "Accept License Agreement").

Note
It may be worth trying to use #OpenJDK instead of Sun JDK

Install ImageJ

Ensure you don't have the Ubuntu package installed:

Commandline

sudo apt-get purge 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 rm -rf /usr/local/ImageJ/jre # we don't need the Java runtime
sudo chmod a+Xr /usr/local/ImageJ

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/

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 \
            --with-javaincl=/usr/lib/jvm/java-7-oracle/include/

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/micro-manager:/usr/local/ImageJ
java -mx1200m \
     -Djava.library.path=/usr/local/lib/micro-manager:/usr/local/ImageJ \
     -Dplugins.dir=/usr/local/ImageJ \
     -cp /usr/local/ImageJ/ij.jar:/usr/lib/jvm/java-7-oracle/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 N/A - manually fetch from Oracle website
Optional Dependencies:
Firewire Camera Library libdc1394-*-dev
Open Source Computer Vision Library libopencv-dev

OpenJDK instead of Sun JDK

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.in file to find jni.h[2] and possibly apply other fixes.

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