[Insight-users] Problem cross-compiling ITK 4.2.1 for MX53 (Ed Menard) [SOLVED]

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Dec 11 09:34:01 EST 2012


Hello,

HDF5 is a rather complex library. I don't know anything about the error you are now getting. But it may be that HDF5 does not work with cross compilation well.

You can take advantage of the ITKv4 Modular system and turn off the HDF5IO modules. From a clean directory begin with the following argument on the command line:

 ccmake ~/src/ITK-gerrit/ -DITK_BUILD_ALL_MODULES=OFF

This will enable you to turn on and ITK modules that you need or are known to work on you cross compilation platform.

Brad


On Dec 11, 2012, at 9:10 AM, Ed Menard <emenard at nvs-technologies.com> wrote:

> Hi Brad,
> 
> Yes, the error reported was related to the xxx64 methods...
> I pulled tag 4.3rc04 and it got past that problem.
> Unfortunately, a new problem appeared:
> 
> ...
> [ 87%] Building CXX object Modules/IO/HDF5/test/CMakeFiles/ITKIOHDF5TestDriver.dir/itkHDF5ImageIOStreamingReadWriteTest.cxx.o
> In file included from /home/lucid/InsightToolkit-4.3rc04/Modules/IO/ImageBase/include/itkImageFileReader.h:195,
>                  from /home/lucid/InsightToolkit-4.3rc04/Modules/IO/ImageBase/include/itkIOTestHelper.h:24,
>                  from /home/lucid/InsightToolkit-4.3rc04/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx:19:
> /home/lucid/InsightToolkit-4.3rc04/Modules/IO/ImageBase/include/itkImageFileReader.hxx: In member function 'void itk::ImageFileReader<TOutputImage, ConvertPixelTraits>::GenerateData() [with TOutputImage = itk::Image<float, 3u>, ConvertPixelTraits = itk::DefaultConvertPixelTraits<float>]':
> /home/lucid/InsightToolkit-4.3rc04/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx:134:   instantiated from here
> /home/lucid/InsightToolkit-4.3rc04/Modules/IO/ImageBase/include/itkImageFileReader.hxx:437: warning: cast from 'char*' to 'const float*' increases required alignment of target type
> /home/lucid/InsightToolkit-4.3rc04/Modules/IO/ImageBase/include/itkImageFileReader.hxx:437: warning: cast from 'char*' to 'const float*' increases required alignment of target type
> At global scope:
> cc1plus: warning: unrecognized command line option "-Wno-long-double"
> Linking CXX executable ../../../../bin/ITKIOHDF5TestDriver
> ../../../../lib/libitkhdf5-4.3.a(H5.c.o): In function `H5check_version':
> H5.c:(.text+0x2b4): undefined reference to `H5libhdf5_settings'
> ../../../../lib/libitkhdf5-4.3.a(H5T.c.o): In function `H5T_init_interface':
> H5T.c:(.text+0x13b8): undefined reference to `H5TN_init_interface'
> collect2: ld returned 1 exit status
> make[2]: *** [bin/ITKIOHDF5TestDriver] Error 1
> make[1]: *** [Modules/IO/HDF5/test/CMakeFiles/ITKIOHDF5TestDriver.dir/all] Error 2
> make: *** [all] Error 2
> lucid at ubuntu:~/ITK-MX53-4.3rc04$ 
> 
> --Ed
> 
> On Mon, Dec 10, 2012 at 11:56 AM, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
> I think that the following patch which has been included in the 4.3 release candidate should address the problem:
> 
> https://github.com/Kitware/ITK/commit/8e802e50259e4bd92e4ad761e434d46c639ab70d
> 
> Was the error reported related to the methods modified above not being available?
> 
> Brad
> 
> On Dec 10, 2012, at 1:45 PM, Ed Menard <emenard at nvs-technologies.com> wrote:
> 
>> Hi Vladmir,
>> 
>> Thanks for pointing me in the right direction...
>> Setting ITK_USE_SYSTEM_TIFF to ON did help, but then I found that the TIFF library built for my target system was an older version, and ITK still wouldn't compile...
>> 
>> No time at the moment to update/rebuild my cross-environment, so I dropped back to ITK 3.20.1, and that compiled successfully (with ITK_USE_SYSTEM_TIFF)...
>> 
>> Thanks for your help!
>> --Ed
>> 
>> On Sun, Dec 9, 2012 at 9:20 AM, Vladimir S. FONOV <vladimir.fonov at gmail.com> wrote:
>> Hello,
>> 
>> the problem comes from the fact that ITK bundles lib tiff  library source in Modules/ThirdParty/TIFF/src , which builds a binary program ( itkmkg3states from mkg3states.c) which is used to generate the source of tif_fax3sm.c 
>> 
>> In case of cross-platform build it means that Cmake have to figure out that itkmkg3states have to be build using your host compiler and not  cross-compiler (i.e building a binary for intel instead for arm). 
>> 
>> You can probably get around it by using libtiff which comes with iMX build environment ( set ITK_USE_SYSTEM_TIFF to ON)
>> 
>> On 2012-12-09, at 12:00 PM, insight-users-request at itk.org wrote:
>> 
>>> Here are the steps I performed:
>>> - Created an empty directory (ITK-MX53-4.2.1), peer with the sources
>>> (InsightToolkit-4.2.1)
>>> - Created a ToolChain-MX53.cmake file (including setting CMAKE_SYSTEM_NAME
>>> to Linux and other settings)
>>> - Copied ToolChain-MX53.cmake to ITK-MX53-4.2.1
>>> - From ITK-MX53-4.2.1 ran: cmake
>>> -DCMAKE_TOOLCHAIN_FILE=./Toolchain-MX53.cmake ../InsightToolkit-4.2.1
>>> - Copied the generated cmTryCompileExecXxx files to the target and ran them,
>>> and then copied TryRunResults.cmake to TryRunResults-MX53.cmake and updated
>>> with the obtained results
>>> - From ITK-MX53-4.2.1 ran: cmake -C ./TryRunResults-MX53.cmake
>>> ../InsightToolkit-4.2.1
>>> - Ran make
>> 
>> ---
>> Best regards,
>> 
>> Vladimir S. FONOV 
>> 
>> 
>> 
>> 
>> 
>> 
>> _____________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>> 
>> 
>> _____________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121211/0e5d1c4e/attachment-0001.htm>


More information about the Insight-users mailing list