[Insight-users] How to Cross-Compile ITK for Raspberry Pi

Luis Ibanez luis.ibanez at kitware.com
Thu Dec 27 16:59:27 EST 2012


On Thu, Dec 27, 2012 at 3:24 PM, Bradley Lowekamp <blowekamp at mail.nih.gov>wrote:

> Luis,
>
> Congratulations on getting ITK on the Raspberry Pi.
>
> I am not too familiar with cross-compilation. Is it possible to use and
> link link against the systems libtiff library?
>
> Brad
>
>
-----------------------------------


Yes, it is possible.

Here are the required steps;

A) Install the libtiff-dev libraries in the Raspberry Pi

                  sudo apt-get install libtiff-dev

The libraries go to the directory:
/usr/lib/arm-linux-gnueabihf

and the headers (tiff.h) go to the directory
/usr/include/


B) rsync (copy) those directories in the host
    (the Linux Latop in this case):

cd /home/ibanez/bin/RaspberryPi

mkdir usr/lib
cd usr/lib

rsync -rl pi at raspberrypi:/usr/lib/arm-linux-gnueabihf .

cd /home/ibanez/bin/RaspberryPi/usr
rsync -rl pi at raspberrypi:/usr/include .


C)  Configure with CMake as before:

ccmake -C ~/Uploads/TryRunResults.cmake
-DCMAKE_TOOLCHAIN_FILE=/home/ibanez/bin/RaspberryPi/CMakeToolChain/Toolchain-RaspberryPi.cmake
/home/ibanez/src/RaspberryPi/ITK


In CCMake Select  ITK_USE_SYSTEM_TIFF   ON


D)  Provide the paths in the local host to the two
      directories that we copied (rsync) from the Raspberry Pi:

TIFF_INCLUDE_DIR     /home/ibanez/bin/RaspberryPi/usr/include
TIFF_LIBRARY
/home/ibanez/bin/RaspberryPi/usr/lib/arm-linux-gnueabihf/libtiff.so



E)  Make


----


This actually, might be a good way of getting around the
bootstrapping problem with mkg3states in the TIFF library.
http://www.itk.org/Wiki/ITK/Cross_Compiling#Dealing_with_TIFF_bootstrapping



     Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121227/1e3e2bd2/attachment.htm>


More information about the Insight-users mailing list