<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
I've now finished compiling my full project for ARM (core, opencv,
camera1394, hokuyo, tf, joy, image_transport), and there is a couple of
point I noticed after my initial post. See below.<br>
<br>
On 07/09/10 14:55, Cedric Pradalier wrote:
<blockquote cite="mid:4C371C41.8030205@mavt.ethz.ch" type="cite">
  <pre wrap="">Hi,

I'd like to suggest the 2 micro-patch to help cross-compiling ros.

======== ROS BUILD ========
I now use more the rostoolchain.cmake and I really think that's the way 
forward. Mine looks like that:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm-angstrom-linux-gnueabi)
set(GUMSTIXTOP [...]/overo-oe)
set(GUMSTIXFS [...]/overo-dev)
set(CMAKE_C_COMPILER
     
${GUMSTIXTOP}/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gcc-sysroot)
set(CMAKE_CXX_COMPILER
     
${GUMSTIXTOP}/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-g++-sysroot)
set(CMAKE_FIND_ROOT_PATH ${GUMSTIXFS})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

The CMAKE_FIND... directives are conflicting with the 
_rosbuild_add_rostest and _rosbuild_add_pyunit in 
rosbuild/private.cmake. This can be corrected by applying the following 
patch:
-  find_file(_file_name ${file} ${PROJECT_SOURCE_DIR} /)
+  find_file(_file_name "${file}" "${PROJECT_SOURCE_DIR}" / 
NO_CMAKE_FIND_ROOT_PATH)
in both function. This will force find_file to ignore the 
CMAKE_FIND_ROOT_PATH for these functions. This is fine since they seem 
to be used only to refer to local files.

  </pre>
</blockquote>
This actually also affect rosbuild_add_executable in public.cmake.<br>
<br>
<blockquote cite="mid:4C371C41.8030205@mavt.ethz.ch" type="cite">
  <pre wrap="">======== OpenCV ========
[...]</pre>
</blockquote>
<big><br>
</big><br>
<big>======== TF ========</big><br>
In package tf, in tf/CMakeLists.txt, the -ssse3 is not prefixed by a
system type. I've changed it by copy-pasting from opencv (I guess it
could be done nicer with a OR :)):<br>
<br>
rosbuild_add_compile_flags(pytf_py -g -Wno-missing-field-initializers)<br>
if(CMAKE_COMPILER_IS_GNUCXX)<br>
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES arm*)<br>
        # We can use only -O2 because the -O3 causes gcc crash<br>
        set(X86 0)<br>
    endif()<br>
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES powerpc*)<br>
        set(X86 0)<br>
    endif ()<br>
    <br>
    <br>
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64*)<br>
        set(X86_64 1)<br>
    endif()<br>
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64*)<br>
        set(X86_64 1)<br>
    endif()<br>
    <br>
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i686*)<br>
        set(X86 1)<br>
    endif()<br>
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i386*)<br>
        set(X86 1)<br>
    endif()<br>
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES x86*)<br>
        set(X86 1)<br>
    endif()<br>
        <br>
    if(X86 OR X86_64)<br>
        rosbuild_add_compile_flags(pytf_py -msse3)<br>
    endif()<br>
endif()<br>
<br>
======== libtheora ========<br>
In libtheora, I need to add  -host arm-gumstix-linux-gnu --disable-asm
to autogen.sh<br>
but I'm not sure how to do it using the rostoolchain information. <br>
<br>
Again, HTH<br>
<pre class="moz-signature" cols="80">-- 
Dr. Cedric Pradalier
<a class="moz-txt-link-freetext" href="http://www.asl.ethz.ch/people/cedricp">http://www.asl.ethz.ch/people/cedricp</a>
</pre>
</body>
</html>