Hi Rob, ________________________________________ From: Hdf-forum [[email protected]] on behalf of Rob Latham [[email protected]] Sent: Monday, January 5, 2015 7:10 AM To: [email protected] Subject: Re: [Hdf-forum] HDF5 cross-compile error: configure:23533: error: cannot run test program while cross compiling
On 01/01/2015 10:52 PM, Ernest L Williams wrote: > Hi > > I am trying to cross-compile hdf5 for a different architecture: > I get the following error in the configuration stage: > ======================================= > configure:23533: error: cannot run test program while cross compiling > ======================================== HDF5 uses AC_TRY_RUN in way too many places. It makes cross compiling a gigantic pain. I have managed to work-around this in my "buildroot" environment. I am using the buildroot tools to build an embedded linux target and tool-chain. The buildroot developers gave me some tricks to handle the "AC_TRY_RUN" Workaround: set a pile of environment variables. Most of the tests are obvious: checking for example if you are not running on an HP-UX machine with a buggy compiler from 1998 (I think I have exaggerated that slightly... but only slightly) Fortunately, they do not seem to be adding any *new* instances of AC_TRY_RUN, so once you set up all the needed environment variables, you'll be set for the next several release cycles. I hope they will start supporting cross-builds. autotools definitely has the infrastructure. :) To get you started, here's a shell script (attached) I use with lots of the necessary environment variables set. Richard Hedges got me most of the way a few years back (in the 1.6 days), and so I pay it forward to you. I did this for Blue Gene, so usual caveats apply: I have no idea what the right values should be for your environment. Oh, note the one odd step: you have to make one c file in normal mode, then re-configure everything for cross compiling. Now, here is the most non portable part: The automatic generation of "C" files with a machine dependent executable. :( ================================== ERROR ======================================= /bin/sh: ./H5make_libsettings: /lib/ld64-uClibc.so.0: bad ELF interpreter: No such file or directory ================================================================================= These "C" files should be generated via autotools "configure" and then some portable shell script such as PERL ? In any, case how important are the following files for using the API only: (1) H5lib_settings.c (2) H5Tinit.c In my case, since my embedded target is "x86_64-buildroot-linux-uclibc" which is very similar to my build host --> ":x86_64-unknown-linux-gnu" I just copied those files into the buildroot environment but this would not work for such as an ARM target :( Thanks, Ernesto ==rob -- Rob Latham Mathematics and Computer Science Division Argonne National Lab, IL USA _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
