FARSIGHT Tutorials/Building Software/Bio-Formats/Building C++ Bindings

From FarsightWiki
(Difference between revisions)
Jump to: navigation, search
Line 21: Line 21:
 
Execute the following command:
 
Execute the following command:
  
  svn co https://skyking.microscopy.wisc.edu/svn/java/trunk /path/to/loci
+
svn co https://skyking.microscopy.wisc.edu/svn/java/trunk /path/to/loci
  
 
Where /path/to/loci is the desired location of your LOCI Software source code checkout.
 
Where /path/to/loci is the desired location of your LOCI Software source code checkout.
Line 35: Line 35:
 
# Execute the command:
 
# Execute the command:
  
  ant tools
+
ant tools
  
 
Finally, you can compile the Bio-Formats C++ bindings:
 
Finally, you can compile the Bio-Formats C++ bindings:
Line 42: Line 42:
 
# Execute the command:
 
# Execute the command:
  
  ant -Djace.home=/path/to/jace
+
ant -Djace.home=/path/to/jace
  
 
Where /path/to/jace is the location of your Jace source code checkout. Do not use a relative path, and use forward slashes, even on Windows.
 
Where /path/to/jace is the location of your Jace source code checkout. Do not use a relative path, and use forward slashes, even on Windows.
Line 60: Line 60:
 
Afterwards, the build subdirectory will contain the following files:
 
Afterwards, the build subdirectory will contain the following files:
  
# libjace.so / libjace.jnilib / jace.dll : Jace shared library
+
# libjace.so / libjace.jnilib / jace.dll Jace shared library
# libbfjace.so / libbfjace.dylib / bfjace.dll : Bio-Formats C++ bindings
+
# libbfjace.so / libbfjace.dylib / bfjace.dll Bio-Formats C++ bindings
# jace-runtime.jar : Jace Java classes needed at runtime
+
# jace-runtime.jar Jace Java classes needed at runtime
# loci_tools.jar : Bio-Formats Java library needed at runtime
+
# loci_tools.jar Bio-Formats Java library needed at runtime
# showinf / showinf.exe : Example command line application
+
# showinf / showinf.exe Example command line application
  
Items 1-4 are necessary and required to deploy Bio-Formats with your C++ application. All other files, including the showinf program and various build files generated by CMake, are not needed.
+
Items 1-4 are necessary and required to deploy Bio-Formats with FARSIGHT. All other files, including the showinf program and various build files generated by CMake, are not needed.
  
If you prefer, instead of using the loci_tools.jar bundle, you can provide individual JAR files as appropriate for your application. For details, see:
+
You should verify that the bindings are working by executing the showinf command from the build subdirectory. If all goes well, you will see a message like:
  
  http://www.loci.wisc.edu/ome/formats-library.html
+
Creating JVM...
 +
JVM created.
 +
Arguments:
 +
        #0: ./showinf
 +
Please specify a filename on the command line.
  
Please direct questions to the Bio-Formats team at bioformats@loci.wisc.edu.
+
Once the bindings are functional, proceed to the [[FARSIGHT Tutorials/Building Software/Bio-Formats/Building ITK Plugin|Bio-Formats ITK plugin]].
 +
 
 +
Please direct questions to the [[http://www.loci.wisc.edu/ome/formats-contact.html Bio-Formats team]].

Revision as of 21:40, 12 June 2009

Contents

Overview

The Bio-Formats C++ bindings provide language bindings for calling into the Bio-Formats Java library from C++ in a cross-platform manner. As of this writing the bindings are functional with GCC on Linux and Mac OS X systems, as well as with Visual C++ 2005 and Visual C++ 2008 on Windows.


Prerequisites

The following packages should be installed in order:

  1. Installing CMake
  2. Installing Apache Ant
  3. Installing Subversion
  4. Installing Boost Thread
  5. Installing Java Development Kit
  6. Installing Visual C++ (Windows only)
  7. Downloading Jace


Downloading Bio-Formats

Execute the following command:

svn co https://skyking.microscopy.wisc.edu/svn/java/trunk /path/to/loci

Where /path/to/loci is the desired location of your LOCI Software source code checkout.

The above command assumes you have the svn command line tool for Subversion installed. It should also work fine to plug in the above information to any graphical Subversion client (e.g., TortoiseSVN).


Compiling the code

Once you have the required tools and libraries installed, you must first build the loci_tools.jar library:

  1. Change to the root directory of the checkout.
  2. Execute the command:
ant tools

Finally, you can compile the Bio-Formats C++ bindings:

  1. Change to the components/native/bf-cpp directory.
  2. Execute the command:
ant -Djace.home=/path/to/jace

Where /path/to/jace is the location of your Jace source code checkout. Do not use a relative path, and use forward slashes, even on Windows.

If all goes well, the build system will:

  1. Build the Jace Java and C++ libraries.
  2. Generate the Bio-Formats C++ proxy classes.
  3. Build the Bio-Formats C++ shared library.
  4. Build the showinf command line tool, for testing the functionality.

Please be patient, as the build may require several minutes to complete.


Build results

Afterwards, the build subdirectory will contain the following files:

  1. libjace.so / libjace.jnilib / jace.dll — Jace shared library
  2. libbfjace.so / libbfjace.dylib / bfjace.dll — Bio-Formats C++ bindings
  3. jace-runtime.jar — Jace Java classes needed at runtime
  4. loci_tools.jar — Bio-Formats Java library needed at runtime
  5. showinf / showinf.exe — Example command line application

Items 1-4 are necessary and required to deploy Bio-Formats with FARSIGHT. All other files, including the showinf program and various build files generated by CMake, are not needed.

You should verify that the bindings are working by executing the showinf command from the build subdirectory. If all goes well, you will see a message like:

Creating JVM...
JVM created.
Arguments:
        #0: ./showinf
Please specify a filename on the command line.

Once the bindings are functional, proceed to the Bio-Formats ITK plugin.

Please direct questions to the [Bio-Formats team].

Personal tools