Cross compile HDF5 for iPhone

Hello all,

I'm fairly new with HDF5, and we are experimenting with using it for some of
our products with large datasets. I've got it up and running inside our
applications on Mac OS X and linux. The next step is to see if we can get it
running on an iPhone app. The host system is OS X 10.6.2. So far I've been
unsuccessful.

I had to strip some of the tests from the "configure.in" file, as they
didn't allow for cross compiling. After doing that, I successfully got
./configure to run with the following command:

./configure --prefix=/usr/local/iphone --enable-cxx=yes
--host=arm-apple-darwin
CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
CFLAGS="-arch armv6 -pipe -std=c99 -O3 -miphoneos-version-min=2.0 -gdwarf-2
-mthumb -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk"
CXXFLAGS="-arch armv6 -pipe -O3 -miphoneos-version-min=2.0 -gdwarf-2 -mthumb
-isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk"
CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar

make starts working fine until I get to the point where it is trying to
create H5Tinit.c. It is trying to run H5detect, which I presume was built
for the armv6, and I get the following error:

LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo | \
        sed -e 's/-L/:/g' -e 's/ //g'`" \
     ./H5detect > H5Tinit.c || \
        (test $HDF5_Make_Ignore && echo "*** Error ignored") || \
        (rm -f H5Tinit.c ; exit 1)
/bin/sh: ./H5detect: Bad CPU type in executable
make[2]: *** [H5Tinit.c] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

The H5Tinit.c looks to be rather complicated, and not something that I'd
want to try to recreate by hand. Can anyone point me in the right direction?

Thanks!

Eric

So, how to boot-strap this is to somehow execute the H5detect program _on_ the iphone and save the output to H5init.c, which can then be put back into the source location on the host computer and the compilation can continue. SAVE that file. You will need it each time you run Make. In fact you will probably just need to disable that part of the build system where H5init.c is created.

  If you get it working, please post (or email me offlist) the generated file.

···

_________________________________________________________
Mike Jackson mike.jackson@bluequartz.net
BlueQuartz Software www.bluequartz.net
Principal Software Engineer Dayton, Ohio

On Jan 12, 2010, at 8:04 AM, Eric Reid wrote:

Hello all,

I'm fairly new with HDF5, and we are experimenting with using it for some of our products with large datasets. I've got it up and running inside our applications on Mac OS X and linux. The next step is to see if we can get it running on an iPhone app. The host system is OS X 10.6.2. So far I've been unsuccessful.

I had to strip some of the tests from the "configure.in" file, as they didn't allow for cross compiling. After doing that, I successfully got ./configure to run with the following command:

./configure --prefix=/usr/local/iphone --enable-cxx=yes --host=arm-apple-darwin CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 CFLAGS="-arch armv6 -pipe -std=c99 -O3 -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk" CXXFLAGS="-arch armv6 -pipe -O3 -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk" CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar

make starts working fine until I get to the point where it is trying to create H5Tinit.c. It is trying to run H5detect, which I presume was built for the armv6, and I get the following error:

LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo | \
        sed -e 's/-L/:/g' -e 's/ //g'`" \
     ./H5detect > H5Tinit.c || \
        (test $HDF5_Make_Ignore && echo "*** Error ignored") >> \
        (rm -f H5Tinit.c ; exit 1)
/bin/sh: ./H5detect: Bad CPU type in executable
make[2]: *** [H5Tinit.c] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

The H5Tinit.c looks to be rather complicated, and not something that I'd want to try to recreate by hand. Can anyone point me in the right direction?

Thanks!

Eric
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

So, how to boot-strap this is to somehow execute the H5detect program _on_ the iphone and save the output to H5init.c, which can then be put back into the source location on the host computer and the compilation can continue. SAVE that file. You will need it each time you run Make. In fact you will probably just need to disable that part of the build system where H5init.c is created.

  Yes, that's necessary. Also, the H5config.h that is generated by the configure script may need to be tweaked for the ARM architecture/iPhone environment.

If you get it working, please post (or email me offlist) the generated file.

  Send us a copy too, it might be useful in the future. :slight_smile:

  Quincey

···

On Jan 12, 2010, at 7:27 AM, Michael Jackson wrote:

_________________________________________________________
Mike Jackson mike.jackson@bluequartz.net
BlueQuartz Software www.bluequartz.net
Principal Software Engineer Dayton, Ohio

On Jan 12, 2010, at 8:04 AM, Eric Reid wrote:

Hello all,

I'm fairly new with HDF5, and we are experimenting with using it for some of our products with large datasets. I've got it up and running inside our applications on Mac OS X and linux. The next step is to see if we can get it running on an iPhone app. The host system is OS X 10.6.2. So far I've been unsuccessful.

I had to strip some of the tests from the "configure.in" file, as they didn't allow for cross compiling. After doing that, I successfully got ./configure to run with the following command:

./configure --prefix=/usr/local/iphone --enable-cxx=yes --host=arm-apple-darwin CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 CFLAGS="-arch armv6 -pipe -std=c99 -O3 -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk" CXXFLAGS="-arch armv6 -pipe -O3 -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk" CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar

make starts working fine until I get to the point where it is trying to create H5Tinit.c. It is trying to run H5detect, which I presume was built for the armv6, and I get the following error:

LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo | \
       sed -e 's/-L/:/g' -e 's/ //g'`" \
    ./H5detect > H5Tinit.c || \
       (test $HDF5_Make_Ignore && echo "*** Error ignored") || \
       (rm -f H5Tinit.c ; exit 1)
/bin/sh: ./H5detect: Bad CPU type in executable
make[2]: *** [H5Tinit.c] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

The H5Tinit.c looks to be rather complicated, and not something that I'd want to try to recreate by hand. Can anyone point me in the right direction?

Thanks!

Eric
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

... may I add "near" future :wink:

···

2010/1/12 Quincey Koziol <koziol@hdfgroup.org>

On Jan 12, 2010, at 7:27 AM, Michael Jackson wrote:

> So, how to boot-strap this is to somehow execute the H5detect program
_on_ the iphone and save the output to H5init.c, which can then be put back
into the source location on the host computer and the compilation can
continue. SAVE that file. You will need it each time you run Make. In fact
you will probably just need to disable that part of the build system where
H5init.c is created.

        Yes, that's necessary. Also, the H5config.h that is generated by
the configure script may need to be tweaked for the ARM architecture/iPhone
environment.

> If you get it working, please post (or email me offlist) the generated
file.

        Send us a copy too, it might be useful in the future. :slight_smile:

       Quincey

> _________________________________________________________
> Mike Jackson mike.jackson@bluequartz.net
> BlueQuartz Software www.bluequartz.net
> Principal Software Engineer Dayton, Ohio
>
> On Jan 12, 2010, at 8:04 AM, Eric Reid wrote:
>
>> Hello all,
>>
>> I'm fairly new with HDF5, and we are experimenting with using it for
some of our products with large datasets. I've got it up and running inside
our applications on Mac OS X and linux. The next step is to see if we can
get it running on an iPhone app. The host system is OS X 10.6.2. So far I've
been unsuccessful.
>>
>> I had to strip some of the tests from the "configure.in" file, as they
didn't allow for cross compiling. After doing that, I successfully got
./configure to run with the following command:
>>
>> ./configure --prefix=/usr/local/iphone --enable-cxx=yes
--host=arm-apple-darwin
CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
CFLAGS="-arch armv6 -pipe -std=c99 -O3 -miphoneos-version-min=2.0 -gdwarf-2
-mthumb -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk"
CXXFLAGS="-arch armv6 -pipe -O3 -miphoneos-version-min=2.0 -gdwarf-2 -mthumb
-isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk"
CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
>>
>> make starts working fine until I get to the point where it is trying to
create H5Tinit.c. It is trying to run H5detect, which I presume was built
for the armv6, and I get the following error:
>>
>> LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo | \
>> sed -e 's/-L/:/g' -e 's/ //g'`" \
>> ./H5detect > H5Tinit.c || \
>> (test $HDF5_Make_Ignore && echo "*** Error ignored") ||
\
>> (rm -f H5Tinit.c ; exit 1)
>> /bin/sh: ./H5detect: Bad CPU type in executable
>> make[2]: *** [H5Tinit.c] Error 1
>> make[1]: *** [all] Error 2
>> make: *** [all-recursive] Error 1
>>
>> The H5Tinit.c looks to be rather complicated, and not something that I'd
want to try to recreate by hand. Can anyone point me in the right direction?
>>
>> Thanks!
>>
>> Eric
>> _______________________________________________
>> Hdf-forum is for HDF software users discussion.
>> Hdf-forum@hdfgroup.org
>> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> Hdf-forum@hdfgroup.org
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Good afternoon,

I had a question about this particular thread. I'm trying to
cross-compile for an ARM Cortex-A8 target running Linux, and I'm failing
the various "configure" tests. Think I'm addressing some of the same
issues that you saw when building for another ARM environment.

Were you ever successful cross-compiling for your iPhone?

Regards,

Chris Norris
Firmware Engineer
Embla Systems, Inc.
(303) 962-1782

From: servisster at gmail.com (Dimitris Servis) [mailto:servisster at
gmail.com (Dimitris Servis)]
Sent: Tuesday, January 12, 2010 7:31 AM
Subject: [Hdf-forum] Cross compile HDF5 for iPhone

... may I add "near" future :wink:

2010/1/12 Quincey Koziol <koziol at hdfgroup.org>

>
>
> > So, how to boot-strap this is to somehow execute the H5detect

program

> _on_ the iphone and save the output to H5init.c, which can then be

put

back
> into the source location on the host computer and the compilation

can

> continue. SAVE that file. You will need it each time you run Make.

In

fact
> you will probably just need to disable that part of the build system
where
> H5init.c is created.
>
> Yes, that's necessary. Also, the H5config.h that is

generated

by
> the configure script may need to be tweaked for the ARM
architecture/iPhone
> environment.
>
> > If you get it working, please post (or email me offlist) the

generated

> file.
>
> Send us a copy too, it might be useful in the future. :slight_smile:
>
> Quincey
>
> > _________________________________________________________
> > Mike Jackson mike.jackson at bluequartz.net
> > BlueQuartz Software www.bluequartz.net
> > Principal Software Engineer Dayton, Ohio
> >
> >
> >> Hello all,
> >>
> >> I'm fairly new with HDF5, and we are experimenting with using it

for

> some of our products with large datasets. I've got it up and running
inside
> our applications on Mac OS X and linux. The next step is to see if

we

can
> get it running on an iPhone app. The host system is OS X 10.6.2. So

far

I've
> been unsuccessful.
> >>
> >> I had to strip some of the tests from the "configure.in" file, as
they
> didn't allow for cross compiling. After doing that, I successfully

got

> ./configure to run with the following command:
> >>
> >> ./configure --prefix=/usr/local/iphone --enable-cxx=yes
> --host=arm-apple-darwin
>

CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-

darwin9-gcc-4.0.1
> CFLAGS="-arch armv6 -pipe -std=c99 -O3 -miphoneos-version-min=2.0 -
gdwarf-2
> -mthumb -isysroot
>

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk"

···

-----Original Message-----
> On Jan 12, 2010, at 7:27 AM, Michael Jackson wrote:
> > On Jan 12, 2010, at 8:04 AM, Eric Reid wrote:
> CXXFLAGS="-arch armv6 -pipe -O3 -miphoneos-version-min=2.0 -gdwarf-2

-

mthumb
> -isysroot
>

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk"

> CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
> AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
> >>
> >> make starts working fine until I get to the point where it is

trying

to
> create H5Tinit.c. It is trying to run H5detect, which I presume was
built
> for the armv6, and I get the following error:
> >>
> >> LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo | \
> >> sed -e 's/-L/:/g' -e 's/ //g'`"
\
> >> ./H5detect > H5Tinit.c || \
> >> (test $HDF5_Make_Ignore && echo "*** Error ignored") ||
> \
> >> (rm -f H5Tinit.c ; exit 1)
> >> /bin/sh: ./H5detect: Bad CPU type in executable
> >> make[2]: *** [H5Tinit.c] Error 1
> >> make[1]: *** [all] Error 2
> >> make: *** [all-recursive] Error 1
> >>
> >> The H5Tinit.c looks to be rather complicated, and not something

that

I'd
> want to try to recreate by hand. Can anyone point me in the right
direction?
> >>
> >> Thanks!
> >>
> >> Eric
> >> _______________________________________________
> >> Hdf-forum is for HDF software users discussion.
> >> Hdf-forum at hdfgroup.org
> >> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
> >
> >
> > _______________________________________________
> > Hdf-forum is for HDF software users discussion.
> > Hdf-forum at hdfgroup.org
> > http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> Hdf-forum at hdfgroup.org
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.hdfgroup.org/pipermail/hdf-
forum_hdfgroup.org/attachments/20100112/5d0f4ae0/attachment-0001.html>

This e-mail may contain confidential and privileged material for the sole use of
the intended recipient. Any review or distribution by others is strictly
prohibited. If you are not the intended recipient, please contact the sender and
delete this e-mail.