NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #281 (closed task: fixed)

Opened 2010-11-15T14:53:49-06:00

Last modified 2012-02-06T15:24:42-06:00

Create multi-platform version of SLIMPlugin.

Reported by: aivar Owned by: aivar
Priority: major Milestone: imagej2-b1-initial
Component: Spectral Lifetime Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Create and load dynamic native code libraries for all target platforms.

Change History

comment:1 Changed 2011-01-21T23:40:54-06:00 by aivar

  • Status changed from new to accepted
  • Type changed from defect to task
  • Component changed from slim to imagej-plugin-infrastructure
  • Milestone changed from biweekly-2011: Jan-03 to Jan-14 to biweekly-2011: Jan-17 to Jan-28

Investigated the Maven Nar plugin. This provides a way of building on multiple platforms and consolidating the resultant native libraries in a central Maven repository. It also provides native libraries for the current platform during development. However it is lacking in support for running platform-appropriate native libraries during application runtime.

Maven Nar install "installs produced artifacts in the local repository. The unpacking is done in the unpack goal of a dependent artifact upon first usage". In AbstractUnpackMojo it is again stated "unpacking happens in the local repository". The generated NarSystem doesn't actually do any unpacking, it merely appends a version specific string, such as "-2.0-SNAPSHOT", to the library name.

I created a Native Library Utility project to unpack Nar-generated native libraries from a Jar file. It uses open source code from Richard van der Hoff:

 http://docs.codehaus.org/display/MAVENUSER/Projects+With+JNI

 http://opensource.mxtelecom.com/maven/repo/com/wapmx/native/mx-native-loader/1.7/

It also uses a trick to add a directory to the java.library.path properties.

 http://nicklothian.com/blog/2008/11/19/modify-javalibrarypath-at-runtime/

comment:2 Changed 2011-02-14T18:31:21-06:00 by aivar

At the February 2011 Fiji Hackathon Johannes Schindelin told me about cross-compilation with gcc. This is a much better solution than having to build a Maven Nar for each platform we support, on a machine running that platform, and consolidate these in the repository.

I am currently using the Maven Native plugin and working on cross compilation within Maven, based on the information at  http://www.tricoder.net/blog/?p=197 .

comment:3 Changed 2011-02-14T18:36:47-06:00 by aivar

  • Milestone changed from biweekly-2011: Jan-17 to Jan-28 to biweekly-2011: Feb-14 to Feb-25

comment:4 Changed 2011-03-14T10:53:46-05:00 by aivar

  • Milestone changed from biweekly-2011: Feb-28 to Mar-11 to biweekly-2011: Mar-14 to Mar-25

Have a cross-compilation scheme that compiles for Windows and Linux on Linux (i.e. our Hudson/Jenkins build machine) and OSX on OSX, but haven't applied it to the SLIM Plugin.

Worked on being able to create Instrument Response Function, aka Prompt, aka Excitation within plugin, save/restore, display, initialize and edit cursors.

comment:5 Changed 2011-03-28T11:10:28-05:00 by aivar

Added Instrument Response Function functionality, although I'm not sure it's working quite right. Added an automatic fit with RLD followed by LMA capabiilty, had some difficulty with that breaking the ability to fix fit parameters. Discovered export to text was completely not working and dealing with multiple channels was broken also and fixed those.

I was diverted by all these major issues and haven't gotten the multiplatform release working yet.

comment:6 Changed 2011-08-01T11:15:35-05:00 by aivar

  • Milestone changed from biweekly-2011: Jul-18 to Jul-29 to biweekly-2011: Aug-29 to Sep-09

comment:7 Changed 2011-08-01T12:10:55-05:00 by curtis

  • Milestone changed from biweekly-2011: Aug-29 to Sep-09 to imagej-2.0-beta1

Milestone biweekly-2011: Aug-29 to Sep-09 deleted

comment:8 Changed 2011-12-02T20:33:44-06:00 by aivar

I have something that works but the build process is really ugly. I'll leave this open for improvements.

I also created a ticket #901 to specifically address just putting together an up-to-date version using these techniques.

comment:9 Changed 2011-12-05T12:35:07-06:00 by aivar

  • Component changed from ij-ext to slim

comment:10 Changed 2012-02-06T15:24:42-06:00 by aivar

  • Status changed from accepted to closed
  • Resolution set to fixed