Installation/Linux: Difference between revisions

From MiToBo
Jump to navigationJump to search
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Using MiToBo with ImageJ on Linux ==
== Using MiToBo with ImageJ on a Linux-based system ==


=== Use MiToBo as shipped ===
==== Use MiToBo as shipped ====
Extract the zip file to a directory of your choice.<br>
Extract the zip file to a directory of your choice.<br>
You can use MiToBo right away using the ''run.sh'' and ''oprunner.sh'' scripts.<br>
You can use MiToBo right away using the ''run.sh'' and ''oprunner.sh'' scripts.<br>
Line 7: Line 7:
If an '''UnsatisfiedLinkError''' occurs, please read the '''Native libraries''' section below.
If an '''UnsatisfiedLinkError''' occurs, please read the '''Native libraries''' section below.


=== Use MiToBo with an existing ImageJ installation ===
==== Use MiToBo with an existing ImageJ installation ====


To use MiToBo with an existing ImageJ installation perform the following steps:
To use MiToBo with an existing ImageJ installation perform the following steps:


# copy the ''Mi_To_Bo.jar'' to be found in the 'plugins/' folder of the MiToBo zip file to your 'ImageJ/plugins/' directory
# copy the ''mitobo-plugins.jar'' to be found in the 'plugins/' folder of the MiToBo zip file to your 'ImageJ/plugins/' directory
# copy all jars in 'plugins/jars/' of the MiToBo zip file to your 'ImageJ/plugins/jars/' <span style="text-decoration: underline;">except</span> the ij.jar and any jars already existing in your 'ImageJ/plugins/jars/' directory<br/>('''Notice:''' MiToBo requires explicit versions of some jars, other versions may not work properly, see [[downloads|requirements]].)
# copy all jars in 'plugins/jars/' of the MiToBo zip file to your 'ImageJ/plugins/jars/' <span style="text-decoration: underline;">'''except'''</span> the ij.jar and any jars already existing in your 'ImageJ/plugins/jars/' directory<br/>('''Notice:''' MiToBo requires explicit versions of some jars, other versions may not work properly, see [[downloads|requirements]].)
# copy the ''MiToBo_Runner.txt'' from the 'macros/toolsets/' directory in the MiToBo zip file to your 'ImageJ/macros/toolsets/' directory;<br> then you can select the MiToBo toolset from the list of available sets by clicking on the arrows button on the right side of the ImageJ standard toolbar
# copy the ''MiToBo_Runner.txt'' from the 'macros/toolsets/' directory in the MiToBo zip file to your 'ImageJ/macros/toolsets/' directory;<br> then you can select the MiToBo toolset from the list of available sets by clicking on the arrows button on the right side of the ImageJ standard toolbar
# Make the native libraries in lib/ of the MiToBo zip file available to Java (see the '''Native libraries''' section below)
# Make the native libraries in lib/ of the MiToBo zip file available to Java (see the '''Native libraries''' section below)
Line 18: Line 18:
You can still use the ''run.sh'' and ''oprunner.sh'' scripts if you copy them to your 'ImageJ/' directory.
You can still use the ''run.sh'' and ''oprunner.sh'' scripts if you copy them to your 'ImageJ/' directory.


=== Native libraries ===
==== Native libraries ====


Some operators of MiToBo use native code via the Java Native Interface (JNI).<br>
Some operators of MiToBo use native code via the Java Native Interface (JNI).<br>
Line 34: Line 34:
:Configuring the LD_LIBRARY_PATH and running java with the -Djava.library.path option are equivalent.
:Configuring the LD_LIBRARY_PATH and running java with the -Djava.library.path option are equivalent.


* '''Building of MiToBo's native libraries:'''
<!--* '''Building of MiToBo's native libraries:'''
: MiToBo ships with precompiled native libraries for 32- and 64-Bit Linux. If you encounter problems with the Linux libraries you might try to compile MiToBo's native libraries by yourself:
: MiToBo ships with precompiled native libraries for 32- and 64-Bit Linux. If you encounter problems with the Linux libraries you might try to compile MiToBo's native libraries by yourself:
: 1. Download the zip file containing the sources of MiToBo and unpack the file to a directory of your choice.
: 1. Download the zip file containing the sources of MiToBo and unpack the file to a directory of your choice.
Line 45: Line 45:
: 4. Run ''make install'', which will build MiToBo's native libraries for your architecture and move them into the lib/lib32 or lib/lib64 directory. Note that this will overwrite the libraries in 'lib/lib32' and 'lib/lib64', respectively.
: 4. Run ''make install'', which will build MiToBo's native libraries for your architecture and move them into the lib/lib32 or lib/lib64 directory. Note that this will overwrite the libraries in 'lib/lib32' and 'lib/lib64', respectively.


:Note that when using these libraries also the CGAL libraries have to be available on the LD_LIBRARY_PATH upon execution of MiToBo operators.
:Note that when using these libraries also the CGAL libraries have to be available on the LD_LIBRARY_PATH upon execution of MiToBo operators.-->


<br>
<br>

Latest revision as of 15:39, 5 November 2015

Using MiToBo with ImageJ on a Linux-based system

Use MiToBo as shipped

Extract the zip file to a directory of your choice.
You can use MiToBo right away using the run.sh and oprunner.sh scripts.
Make sure that they have the 'x'-bit set before executing the scripts, i.e. do 'chmod u+x run.sh' and 'chmod u+x oprunner.sh' first.
If an UnsatisfiedLinkError occurs, please read the Native libraries section below.

Use MiToBo with an existing ImageJ installation

To use MiToBo with an existing ImageJ installation perform the following steps:

  1. copy the mitobo-plugins.jar to be found in the 'plugins/' folder of the MiToBo zip file to your 'ImageJ/plugins/' directory
  2. copy all jars in 'plugins/jars/' of the MiToBo zip file to your 'ImageJ/plugins/jars/' except the ij.jar and any jars already existing in your 'ImageJ/plugins/jars/' directory
    (Notice: MiToBo requires explicit versions of some jars, other versions may not work properly, see requirements.)
  3. copy the MiToBo_Runner.txt from the 'macros/toolsets/' directory in the MiToBo zip file to your 'ImageJ/macros/toolsets/' directory;
    then you can select the MiToBo toolset from the list of available sets by clicking on the arrows button on the right side of the ImageJ standard toolbar
  4. Make the native libraries in lib/ of the MiToBo zip file available to Java (see the Native libraries section below)

You can still use the run.sh and oprunner.sh scripts if you copy them to your 'ImageJ/' directory.

Native libraries

Some operators of MiToBo use native code via the Java Native Interface (JNI).
The 'lib/' directory in the zip file provides precompiled JNI-libraries for 32- (lib/lib32) and 64-Bit (lib/lib64) Linux systems.
For using the native code add the libraries appropriate for your system to the library path.
The path to the native libraries must be available to any java application which uses MiToBo operators that depend on these libraries.

  • The run.sh and oprunner.sh scripts both add the 'lib/lib32' or 'lib/lib64' directory (depending on your architecture)
    to the LD_LIBRARY_PATH, thus, you do not have to configure the LD_LIBRARY_PATH manually.
  • If you run ImageJ with MiToBo or the OpRunner in another way, the directories of native libraries can be passed to Java in any of the following two ways:
  • The LD_LIBRARY_PATH environment variable must contain the path to the native libraries used
  • The call to Java has to be augmented with an option to tell where native libraries reside:
  java -Djava.library.path=/path/to/libs1:/path/to/libs2[:...] ...
For example, you can run ImageJ with MiToBo on a 32-Bit system with the unzipped MiToBo structure, but not the run.sh script, with the following command:
  java -Djava.library.path=lib/lib32:/usr/lib -cp plugins/jars/ij.jar ij.ImageJ
Configuring the LD_LIBRARY_PATH and running java with the -Djava.library.path option are equivalent.