top bar

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

(Differentiate between the dependency name and package name)
(Large cleanup: proper formatting, dependencies moved to appendix.)
Line 1: Line 1:
== General remarks ==
+
== Preparation ==
  
We assume installation of ImageJ in "/usr/local/ImageJ". If you have installed ImageJ using apt, replace this location with "/usr/share/imagej" wherever it appears below.  In addition to ImageJ and Micro-Manager, you need the following packages:
+
=== Required Programs and Libraries ===
  
{| class="wikitable"
+
{{Note|Heavy editing in progress: ImageJ install notes to be readded}}
! Dependency || Package Name in Synaptic repository
+
Install ImageJ
|-
+
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Build Dependencies:
+
|-
+
| Subversion || svn
+
|-
+
| GNU C++ || build-essential
+
|-
+
| GNU Autotools || automake
+
|-
+
| GNU Libtool || libtool
+
|-
+
| SWIG libraries || swig
+
|-
+
| Boost libraries || libboost
+
|-
+
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Runtime Dependencies:
+
|-
+
| Sun Java SDK || sun-java6-sdk
+
|-
+
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Optional Dependencies:
+
|-
+
| OpenCV || (FIXME)
+
|-
+
| Firewire Camera Library || libdc1394-*-dev
+
|}
+
  
In addition, note that:
+
You will need a subversion client to checkout the source code, several libraries, and build tools.  Install them with:
  
* File versions might have changed, check before using the names given in the instructions.
+
{{Note|Heavy editing in progress: some dependencies may be missing}}
* Some operations have to be performed as "superuser" ("sudo …").
+
{{MessageBox|1=Commandline|2=<pre>
* Permissions of the new ImageJ directory might have to be set properly.
+
  
== Steps ==
+
sudo apt-get install subversion build-essential automake libtool \
 +
                    libboost-all-dev zlib1g-dev swig sun-java6-sdk
 +
</pre>}}
  
1. '''Installing ImageJ'''
+
You may also need to install additional libraries (for cameras and special hardware). See the full list in [[#Dependencies]]
  
Get the Linux version of ImageJ from http://rsb.info.nih.gov/ij/download.html, move it to "/usr/local" and unpack it as described in http://rsb.info.nih.gov/ij/docs/install/linux.html. You will have a directory "/usr/local/ImageJ" with everything needed to run ImageJ (you can start ImageJ from the terminal: "cd /usr/local/ImageJ", followed by "./run").
+
=== Source Repositories ===
  
2. '''Get Micro-Manager from the repository'''
+
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:
  
Make a directory somewhere (e.g. "~/src"), move to it ("cd ~/src") and get Micro-Manager with the command "svn checkout https://valelab.ucsf.edu/svn/micromanager2/branches/micromanager1.3". This will download all the necessary files from the repository into "~/src/micromanager1.3/".
+
{{MessageBox|1=Commandline|2=<pre>
  
3. '''Beanshell and swingx'''
+
mkdir ~/mm
 +
cd ~/mm
 +
svn co https://valelab.ucsf.edu/svn/micromanager2/trunk/ micro-manager1.4
 +
svn co https://valelab.ucsf.edu/svn/3rdpartypublic/
 +
</pre>}}
  
Move to the new directory ("cd micromanager1.3") and copy beanshell and swingx from "~/src/micromanager1.3/classext" to the "plugins" directory of your ImageJ installation: "sudo cp classext/bsh-2.0b4.jar /usr/local/ImageJ/plugins" and "sudo cp classext/swingx-0.9.5.jar /usr/local/ImageJ/plugins".
+
This creates 2 new folders in the <code>mm</code> directory:
 +
<pre>
 +
~/mm/micro-manager1.4
 +
~/mm/3rdpartypublic
 +
</pre>
  
4. '''Create a new micro-manager directory in /usr/lib'''
+
Add the Beanshell and SwingX to the ImageJ plugins directory:
  
"sudo mkdir /usr/lib/micro-manager"
+
{{MessageBox|1=Commandline|2=<pre>
  
5. '''mmUnixBuild.sh'''
+
cd ~/mm/3rdpartypublic/classext
 +
sudo cp bsh-2.0b4.jar swingx-0.9.5.jar /usr/local/ImageJ/plugins
 +
</pre>}}
  
From within "~/src/micromanager1.3", type "./mmUnixBuild.sh".
+
Create a new micro-manager directory in /usr/lib
  
6. '''Run configure'''
+
{{MessageBox|1=Commandline|2=<pre>
  
"./configure --with-imagej=/usr/local/ImageJ". You have to add the option (--with-imagej), because the default assumes a different localisation of ImageJ.
+
sudo mkdir /usr/lib/micro-manager
 +
</pre>}}
  
7. '''Run make'''
+
== Building Micro-Manager ==
  
"sudo make"
+
=== Create the Autotools files ===
  
8. '''Install as superuser'''
+
<code>configure</code> uses the bundled version of ImageJ:
  
"sudo make install"
+
{{MessageBox|1=Commandline|2=<pre>
  
9. Run '''ldconfig'''
+
cd ~/mm/micro-manager1.4
 +
./mmUnixBuild.sh
 +
./configure --with-imagej=../3rdpartypublic/classext
 +
</pre>}}
  
"sudo ldconfig"
+
=== Compile ===
  
10. '''The starting script'''
+
{{MessageBox|1=Commandline|2=<pre>
  
Starting ImageJ with the scripts provided in the ImageJ directory (run, script, see 1 above) will start ImageJ, but Micro-Manager, although now in the plugins directory, will not work properly because the path to /usr/lib/micro-manager is missing. Write your own script containing the 4 lines given below ("mmscript"), save and move it to /usr/local/ImageJ. Make it executable with "sudo chmod +x mmscript".
+
make
 +
</pre>}}
 +
 
 +
=== Install ===
 +
 
 +
{{MessageBox|1=Commandline|2=<pre>
 +
 
 +
sudo make install
 +
sudo ldconfig
 +
</pre>}}
  
11. '''Running Micro-Manager'''
+
== Post Install
  
cd to "/usr/local/ImageJ" and start ImageJ with your new script ("./mmscript &"). In the plugins menu of ImageJ, start Micro-Manager –> Micro-Manager Studio.
+
=== Create the startup script ===
  
You could run the Micro-Manager in one go by issuing:
+
Starting ImageJ with the scripts provided in the ImageJ directory (run, script, see 1 above) will start ImageJ, but Micro-Manager, although now in the plugins directory, will not work properly because the path to /usr/lib/micro-manager is missing. Write your own script containing the 4 lines given below ("mmscript"), save and move it to /usr/local/ImageJ.
  imagej -run "Micro-Manager Studio"
+
  
 
{{MessageBox|1=File: mmscript|2=<pre>
 
{{MessageBox|1=File: mmscript|2=<pre>
Line 91: Line 89:
 
cd /usr/local/ImageJ
 
cd /usr/local/ImageJ
 
export LD_LIBRARY_PATH=.:/usr/local/lib:/usr/lib/micro-manager:/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 \
+
java -mx1200m \
 +
    -Djava.library.path=/usr/lib/micro-manager:/usr/local/ImageJ \
 
     -Dplugins.dir=/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
+
     -cp /usr/local/ImageJ/ij.jar:usr/local/jdk1.5.0_04/lib/tools.jar \
 +
      ij.ImageJ
 
</pre>}}
 
</pre>}}
 +
 +
Make the script executable:
 +
 +
{{MessageBox|1=Commandline|2=<pre>
 +
 +
sudo chmod +x mmscript
 +
</pre>}}
 +
 +
== Running Micro-Manager ==
 +
 +
Start ImageJ with your new script:
 +
 +
{{MessageBox|1=Commandline|2=<pre>
 +
 +
./mmscript &
 +
</pre>}}
 +
 +
Run <code>Plugins > Micro-Manager > Micro-Manager Studio</code>
 +
 +
== Appendix ==
 +
 +
=== Dependencies ===
 +
 +
{| class="wikitable"
 +
|+ You need the following packages:
 +
! Name || Equivalent Synaptic package name
 +
|-
 +
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Required Dependencies:
 +
|-
 +
| Subversion || <code>subversion</code>
 +
|-
 +
| GNU C++ || <code>build-essential</code>
 +
|-
 +
| GNU Autotools || <code>automake</code>
 +
|-
 +
| GNU Libtool || <code>libtool</code>
 +
|-
 +
| Boost libraries || <code>libboost-all-dev</code>
 +
|-
 +
| zlib compression library || <code>zlib1g-dev</code>
 +
|-
 +
| Simplified Wrapper and Interface Library || <code>swig</code>
 +
|-
 +
| Sun Java SDK || <code>sun-java6-sdk</code>
 +
|-
 +
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Optional Dependencies:
 +
|-
 +
| Firewire Camera Library || <code>libdc1394-*-dev</code>
 +
|-
 +
| Open Source Computer Vision Library || (FIXME)
 +
|}
  
 
{{Programming_Sidebar}}
 
{{Programming_Sidebar}}

Revision as of 13:42, 23 August 2013

Preparation

Required Programs and Libraries

Note
Heavy editing in progress: ImageJ install notes to be readded

Install ImageJ

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
Commandline

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

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

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=../3rdpartypublic/classext

Compile

Commandline

make

Install

Commandline

sudo make install
sudo ldconfig

== Post Install

Create the startup script

Starting ImageJ with the scripts provided in the ImageJ directory (run, script, see 1 above) will start ImageJ, but Micro-Manager, although now in the plugins directory, will not work properly because the path to /usr/lib/micro-manager is missing. Write your own script containing the 4 lines given below ("mmscript"), save and move it to /usr/local/ImageJ.

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 sun-java6-sdk
Optional Dependencies:
Firewire Camera Library libdc1394-*-dev
Open Source Computer Vision Library (FIXME)
© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact