Login  Register

Re: Compiling Clarity for a Mac

Posted by ctrueden on May 02, 2011; 6:04pm
URL: http://imagej.273.s1.nabble.com/JAVA-error-messages-tp3684729p3684733.html

Hi Mark,

It looks like there are some issues with the Clarity CMake configuration on
Mac OS X.

I gave it a try and got pretty far, but ultimately couldn't get it to build,
either. Best would be to write to the authors of Clarity for further
assistance.

For what it's worth, here is what I did:

1) Compiling Clarity requires the fftw v3 library, which you can install
using MacPorts:
  * Install MacPorts from http://www.macports.org/
  * From Terminal, execute: sudo port install fftw-3

2) After downloading and unpacking the source archive, go to Terminal and
run:
  * cd Clarity-1.0
  * mkdir build
  * cd build
  * ccmake ..

3) On the CMake configuration screen, press C to configure. It should
automatically locate your fftw installation as:
  * FFTW_INCLUDE_DIR   /opt/local/include
  * FFTW_LIBRARY   /opt/local/lib/libfftw3.dylib

If CMake didn't find it, make sure you followed step #1 above correctly.

4) Because Mac OS X builds with gcc, you'll need to follow step 9 of the
Clarity build directions:
  * Press T to toggle advanced mode
  * Navigate down to CMAKE_EXE_LINKER_FLAGS
  * Press Enter to edit the field
  * Type: -lpthread -lgomp

5) Press C to configure again. Then press G to generate the Makefile. Press
E to ignore the warning (it's a notification to the Clarity developers that
their CMakeLists.txt file is not 100% correct).

6) Before you can build, you have to edit one of the source files to correct
a problem:
  * nano ../src/ImagePadSpatialShift.cxx

In the editor, change "#include <malloc.h>" to "#include <malloc/malloc.h>"
Save and quit with Ctrl+O, Enter, Ctrl+X

7) Now you can try building:
  * make

My build gets to 77%, then has a linker error attempting to link
libClarity.dylib to fftw3. My advice, as I said above, is to write an email
to the Clarity developers and see if they can be of further assistance.

-Curtis

On Mon, May 2, 2011 at 12:22 PM, Mark Adelman (Work) <
[hidden email]> wrote:

> I am trying to expand the range of deconvolution tools available to me
> (ideally under ImageJ) for use with wide field fluorescence microscopy
> Z-series.  It has been suggested to me that I try to compile Clarity (
> http://cismm.cs.unc.edu/resources/software-manuals/clarity-deconvolution-library/)
> for use on my MacBook.  Am a total rookie when it comes to programming,
> compiling source code, etc.  Have tried to follow the instructions for
> compiling Clarity using CMake, but I keep getting hung up with error
> messages, etc.  Has anyone compiled Clarity for use on the Mac?  Could
> someone point me to some instructions that will be intelligible to a
> beginner like me?  I've done a lot of web browsing but none of the pages
> I've found seem to be pitched 'low enough' for me.  Thanks in advance for
> any help.
>
> Mark Adelman
>