________________________________________ From: Albert Cheng [[email protected]] Sent: Tuesday, January 6, 2015 12:31 PM To: Williams Jr., Ernest L. Cc: HDF Users Discussion List Subject: Re: [Hdf-forum] HDF5 cross-compile error: configure:23533: error: cannot run test program while cross compiling
Hi Ernest, Let us say you do the compiling in machine A. Can you “remote execute” the generated a.out in machine B? ========= ELW =============== The answer is no. This is because machine B is a powerPC and machine A is an INTEL x86 CPU. Again, I need a cross compiler. ======================================== If so, let us say it is called “Blaunch”. You can try these steps in a fresh hdf5 source directory. 1. cp configure Bconfigure # just to keep configure original in case 2. env RUNSERIAL=“Blaunch” bin/yodconfigure Bconfigure 3. env RUNSERIAL=“Blaunch” Bconfigure 4. env RUNSERIAL=“Blaunch” gmake # you can use make if it is gmake compatible Let me know if they work for you. -Albert Cheng THG staff On Jan 6, 2015, at 12:41 PM, Ernest L Williams <[email protected]<mailto:[email protected]>> wrote: On 01/06/2015 09:28 AM, Albert Cheng wrote: Hi Ernest, Let me see if I understand your need correctly. You would like to: configure and compile the HDF5 library in machine A but the binary generated does not run in machine A but runs in platform B. Is that right? That is correct but there is another caveat. Machine A and machine B are different architectures. If we were talking about java code then I would not have an issue. However, we are talking C-code. Machine A for example is INTEL x86 Machine B is PowerPC I need to perform a cross compile. I don't have a problem cross compiling the SZIP package. However, I do have the problem compiling the HDF5 package. Since, your group use the GNU autotools for building packages and support for cross compiling should be achievable. If the hdf5 code has been written with portability in mind, this would make supporting cross compiling easier as well. Do you have a means to launch binary generated in machine A to run in platform B? E.g., machine A $ Bcc program.c -o a.out machine A $ Blaunch ./a.out and Blaunch passes back the exit code of ./a.out run in platform B. If so, we already have a means to do that for HDF5 library, using $RUNSERIAL and yodconfigure. This is created to handle the case of building and running HDF5 software in the compute clusters environments in which binary are generated in a frontend machine and executed in the backend compute nodes. You can see details of it in release_docs/INSTALL_parallel, section 2.4.1 Building serial HDF5 for Red Storm For my particular application; I am not using compute clusters. Cheers, Ernest Try it out to see if it meets your need. -Albert Cheng THG staff On Jan 5, 2015, at 12:41 PM, Ernest L. Williams Jr. <[email protected]<mailto:[email protected]>> wrote: On 01/05/2015 10:29 AM, Elena Pourmal wrote: Hi Rob, On Jan 5, 2015, at 9:10 AM, Rob Latham <[email protected]><mailto:[email protected]> wrote: 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. 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) You are not exaggerating! Our configure needs a major cleanup! 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 other HDF folks will chime in if I am wrong, but the major problem with cross-compiling is h5detect. Configure runs h5detect to generate H5Tinit.c which is platform specific. You may get the wrong H5Tinit.c if h5detect doesn’t run on the right platform (architecture). The other problem is "H5lib_settings.c" If these files are really needed, they could be generated with autotools and PERL. Cheers, Ernest Elena 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. ==rob -- Rob Latham Mathematics and Computer Science Division Argonne National Lab, IL USA <bgq-hdf5build18.sh>_______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ 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
