top bar

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

(General remarks (Ubuntu))
m (Debian notice)
 
(41 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== General remarks (Ubuntu)==
+
Intallation notes to install micro-manager from source on Ubuntu systems. These instructions can also be used without modifications for installations on [http://debian.org Debian systems] (tested on Debian Wheezy and Debian Jessy).
  
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 programmes:
+
{{Note|This page has been updated for the build system changes of r13120, based on testing on Ubuntu 12.04 LTS.}}
  
* svn for obtaining the repository
+
See also: <code>doc/how-to-build.md</code> in the source tree.
* sun-java6-sdk or better/equivalent
+
* autoconf
+
* automake
+
* swig
+
* boost
+
* g++
+
* libtool
+
* libboost 1.2 or newer
+
* libdc1394
+
  
In addition, note that:
+
= Preparation =
  
* File versions might have changed, check before using the names given in the instructions.
+
== Install JDK ==
* Some operations have to be performed as "superuser" ("sudo …").
+
* Permissions of the new ImageJ directory might have to be set properly.
+
  
== General remarks (Gentoo) ==
+
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 OpenJDK:
  
The ImageJ ebuild can be downloaded from http://bugs.gentoo.org/112275. Digest and install the ebuild (see http://linuxreviews.org/gentoo/ebuilds/).
+
{{MessageBox|1=Commandline|2=<pre>
  
== Steps ==
+
sudo apt-get install openjdk-6-jdk
 +
</pre>}}
  
1. '''Installing ImageJ'''
+
(You can also use <code>openjdk-7-jdk</code>.)
  
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").
+
== Install ImageJ ==
  
2. '''Get Micro-Manager from the repository'''
+
[http://rsb.info.nih.gov/ij/download.html Download the Linux version of ImageJ] from the NIH website.  From a terminal, unzip to <code>/usr/local/</code>, and remove the embedded JRE, as we already have one installed.
  
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'''
+
cd ~/Downloads/
 +
sudo unzip ij*-linux*.zip -d /usr/local/
 +
sudo rm -rf /usr/local/ImageJ/jre
 +
sudo chmod a+Xr /usr/local/ImageJ
 +
</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".
+
== Install Build Programs and Libraries ==
  
4. '''Create a new micro-manager directory in /usr/lib'''
+
You will need a subversion client to checkout the source code, several libraries, and build tools.  Install them with:
  
"sudo mkdir /usr/lib/micro-manager"
+
{{MessageBox|1=Commandline|2=<pre>
  
5. '''mmUnixBuild.sh'''
+
sudo apt-get install subversion build-essential autoconf automake libtool \
 +
                    libboost-all-dev zlib1g-dev swig ant
 +
</pre>}}
  
From within "~/src/micromanager1.3", type "./mmUnixBuild.sh".
+
You may also need to install additional packages (for cameras and special hardware). See the full list in [[#Dependencies]]
  
6. '''Run configure'''
+
== Fetch Source Repositories ==
  
"./configure --with-imagej=/usr/local/ImageJ". You have to add the option (--with-imagej), because the default assumes a different localisation of ImageJ.
+
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:
  
7. '''Run make'''
+
{{MessageBox|1=Commandline|2=<pre>
 +
mkdir ~/mm
 +
cd ~/mm
 +
svn co https://valelab4.ucsf.edu/svn/micromanager2/trunk/ micro-manager1.4
 +
svn co https://valelab4.ucsf.edu/svn/3rdpartypublic/
 +
</pre>}}
  
"sudo make"
+
This creates 2 new folders in the <code>mm</code> directory:
 +
<pre>
 +
    ~/mm/micro-manager1.4
 +
    ~/mm/3rdpartypublic
 +
</pre>
  
8. '''Install as superuser'''
+
Subversion (svn) will likely complain saying that it cannot verify the https certificate. Typing **t** to temporarily trust the certificate allows to retrieve the repository.
  
"sudo make install"
+
Also, when retrieving large repository (like the 3rdpartypublic/ repository), svn can hung in the middle of the process, with an error message:
  
9. Run '''ldconfig'''
+
<pre>
 +
svn: REPORT de '/svn/3rdpartypublic/!svn/vcc/default':
 +
Could not read chunk delimiter: Secure connection truncated (https://valelab4.ucsf.edu)
 +
</pre>
  
"sudo ldconfig"
+
This can be [http://stackoverflow.com/questions/4031845/svn-resuming-aborted-checkout#13789596 solved] by typing:
  
10. '''The starting script'''
+
{{MessageBox|1=Commandline|2=
 +
<pre>
 +
svn cleanup 3rdpartypublic/
 +
svn update 3rdpartypublic/ # This command might be executed several times
 +
</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".
+
= Building Micro-Manager =
  
11. '''Running Micro-Manager'''
+
== Create the Autotools files ==
  
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.
+
{{MessageBox|1=Commandline|2=<pre>
  
== mmscript: ==
+
cd ~/mm/micro-manager1.4
 +
./autogen.sh
 +
./configure --enable-imagej-plugin=/usr/local/ImageJ
 +
</pre>}}
  
#!/bin/bash
+
== Download build dependencies ==
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
+
  
== script for Gentoo ==
+
{{MessageBox|1=Commandline|2=<pre>
  
Edit '/usr/bin/imagej' according to this:
+
make fetchdeps  # Required since SVN r14001-r14016
<code><pre>
+
</pre>}}
#!/bin/bash
+
  
export LD_LIBRARY_PATH=.:/usr/lib/micro-manager
+
== Compile ==
IJ_LIB=/usr/share/imagej/lib
+
  
if !([ "${IJ_HOME}" ]) ; then
+
{{MessageBox|1=Commandline|2=<pre>
IJ_HOME=${HOME}
+
 
fi
+
make
if [ -d ${IJ_HOME}/plugins ] ; then
+
</pre>}}
IJ_PLG=${IJ_HOME}
+
 
else
+
== Install ==
IJ_PLG=/usr/share/imagej/lib
+
 
fi
+
{{MessageBox|1=Commandline|2=<pre>
if !([ "$IJ_MEM" ]) ; then
+
 
IJ_MEM=128
+
sudo make install
fi
+
</pre>}}
if !([ "$IJ_CP" ]) ; then
+
 
IJ_CP=$(java-config -p imagej):$(java-config -O)/lib/tools.jar
+
= Post Install =
else
+
 
IJ_CP=$(java-config -p imagej):$(java-config -O)/lib/tools.jar:${IJ_CP}
+
== Editing the startup script ==
fi
+
 
$(java-config --java) \
+
A script named <code>mmimagej</code> will have been installed in <code>/usr/local/ImageJ</code>. You might want to edit its contents to pass extra flags to Java. You may also want to put this script in your <code>PATH</code>.
-Xmx${IJ_MEM}m -Dswing.aatext=true \
+
 
-Dawt.useSystemAAFontSettings=on\
+
= Running Micro-Manager =
-cp ${IJ_CP} \
+
 
-Duser.home=${IJ_HOME} \
+
Start Micro-Manager by typing:
-Dplugins.dir=${IJ_PLG} \
+
 
-Djava.library.path=/usr/lib/micro-manager \
+
{{MessageBox|1=Commandline|2=<pre>
ij.ImageJ "$@"
+
 
</pre>
+
/usr/local/ImageJ/mmimagej 2>&1 >/dev/null &
</code>
+
</pre>}}
 +
 
 +
To view the Core logging in the terminal while Micro-Manager is running, start simply as:
 +
 
 +
{{MessageBox|1=Commandline|2=<pre>
 +
 
 +
/usr/local/ImageJ/mmimagej
 +
</pre>}}
 +
 
 +
= Appendix =
 +
 
 +
== Dependencies ==
  
You could run the Micro-Manager in one go by issuing:
+
{| class="wikitable"
  imagej -run "Micro-Manager Studio"
+
|+ 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>autoconf</code>, <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>
 +
|-
 +
| OpenJDK || <code>openjdk-6-jdk</code> or <code>openjdk-7-jdk</code>
 +
|-
 +
|colspan="2"  style="background: #ddd; border-top: 1px solid gray; padding: 5px; text-align: center"| Optional Dependencies:
 +
|-
 +
| Python || <code>python-dev</code>, <code>python-numpy-dev</code>
 +
|-
 +
| Firewire Camera Library || <code>libdc1394-*-dev</code>
 +
|-
 +
| Open Source Computer Vision Library || <code>libopencv-dev</code>
 +
|-
 +
| GPhoto2 || <code>libgphoto2-2-dev</code>
 +
|-
 +
| FreeImagePlus (used by GPhoto device adapter) || <code>libfreeimage-dev</code>
 +
|-
 +
| libusb 0.1 || <code>libusb-dev</code>
 +
|-
 +
| Andor SDK 2/3 || N/A - request from Andor website
 +
|}
  
 
{{Programming_Sidebar}}
 
{{Programming_Sidebar}}

Latest revision as of 16:04, 16 September 2016

Intallation notes to install micro-manager from source on Ubuntu systems. These instructions can also be used without modifications for installations on Debian systems (tested on Debian Wheezy and Debian Jessy).

Note
This page has been updated for the build system changes of r13120, based on testing on Ubuntu 12.04 LTS.

See also: doc/how-to-build.md in the source tree.

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 OpenJDK:

Commandline

sudo apt-get install openjdk-6-jdk

(You can also use openjdk-7-jdk.)

Install ImageJ

Download the Linux version of ImageJ from the NIH website. From a terminal, unzip to /usr/local/, and remove the embedded JRE, as we already have one installed.

Commandline

cd ~/Downloads/
sudo unzip ij*-linux*.zip -d /usr/local/
sudo rm -rf /usr/local/ImageJ/jre
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 autoconf automake libtool \
                     libboost-all-dev zlib1g-dev swig ant

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://valelab4.ucsf.edu/svn/micromanager2/trunk/ micro-manager1.4
svn co https://valelab4.ucsf.edu/svn/3rdpartypublic/

This creates 2 new folders in the mm directory:

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

Subversion (svn) will likely complain saying that it cannot verify the https certificate. Typing **t** to temporarily trust the certificate allows to retrieve the repository.

Also, when retrieving large repository (like the 3rdpartypublic/ repository), svn can hung in the middle of the process, with an error message:

svn: REPORT de '/svn/3rdpartypublic/!svn/vcc/default': 
Could not read chunk delimiter: Secure connection truncated (https://valelab4.ucsf.edu)

This can be solved by typing:

Commandline
svn cleanup 3rdpartypublic/
svn update 3rdpartypublic/ # This command might be executed several times

Building Micro-Manager

Create the Autotools files

Commandline

cd ~/mm/micro-manager1.4
./autogen.sh
./configure --enable-imagej-plugin=/usr/local/ImageJ

Download build dependencies

Commandline

make fetchdeps   # Required since SVN r14001-r14016

Compile

Commandline

make

Install

Commandline

sudo make install

Post Install

Editing the startup script

A script named mmimagej will have been installed in /usr/local/ImageJ. You might want to edit its contents to pass extra flags to Java. You may also want to put this script in your PATH.

Running Micro-Manager

Start Micro-Manager by typing:

Commandline

/usr/local/ImageJ/mmimagej 2>&1 >/dev/null &

To view the Core logging in the terminal while Micro-Manager is running, start simply as:

Commandline

/usr/local/ImageJ/mmimagej

Appendix

Dependencies

You need the following packages:
Name Equivalent Synaptic package name
Required Dependencies:
Subversion subversion
GNU C++ build-essential
GNU Autotools autoconf, automake
GNU Libtool libtool
Boost libraries libboost-all-dev
zlib compression library zlib1g-dev
Simplified Wrapper and Interface Library swig
OpenJDK openjdk-6-jdk or openjdk-7-jdk
Optional Dependencies:
Python python-dev, python-numpy-dev
Firewire Camera Library libdc1394-*-dev
Open Source Computer Vision Library libopencv-dev
GPhoto2 libgphoto2-2-dev
FreeImagePlus (used by GPhoto device adapter) libfreeimage-dev
libusb 0.1 libusb-dev
Andor SDK 2/3 N/A - request from Andor website
© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact