I understand that HDF5 cannot be build as universal binary directly. We need to build e.g. i386 and ppc architecture separately and combined them using lipo.
Is there a write up on how one can go about doing that? i.e. best practice approach.
I understand that HDF5 cannot be build as universal binary directly. We need to build e.g. i386 and ppc architecture separately and combined them using lipo.
Is there a write up on how one can go about doing that? i.e. best practice approach.
In the past I only built universal binaries for HDF5 and HDF4 command line utilities (not libraries). I used different machines and didn't not use compiler flags on the same machine (but tried it both ways; unfortunately I couldn't make binaries built on 64-bit Intel to work on 32-bit Intel). Here is the procedure I followed:
0. Make sure that the same versions of GNU compilers are used on all desired platforms (I suspect this may be not required).
1. Build and install universal binaries for ZLIB and SZIP libraries for desired architectures (build static versions, and then use lipo to create universal binaries for libraries; test them)
2. For each architecture configure and build static HDF5 C library and utilities by using --disable-shared; link with the universal binaries for ZLIB and SZIP built in 1; for example,
./configure --disable-shared --with-zlib=/path_to_universal_zlib --with-szlib=/path_to_universal_szip --prefix=/<install_path>
make
make check
make install
3. Bring utilities installed under <install_path>/bin on each of the machines to a directory on a machine of your choice; I usually just tar them, ftp, then untar.
4. Use a script to combine utilities; put universal binaries in a separate directory. Here is an example of a rudimentary script to combine HDF5 utilities built for 32 and 64 Mac Intel
After building universal binaries, I tested them manually on each architecture. I also tried to replace binaries built in 2 with the new ones and run "make check" - tedious but it worked.
It is possible to create libraries too, but libraries require much more manual work to create proper public header files and testing is hard.
We stopped building universal binaries for the HDF5 utilities because we noticed that no one was using them and none of our funding agencies requested them. If there is enough interest we may reconsider our decision.
Is the CMake support now in working order? Because with CMake, you just have to set CMAKE_OSX_ARCHITECTURES and it will build universal. (Assuming results of 'try runs' are not used to decide things like endianess and pointer size.)
···
On Tue, 5 Jul 2011 12:39:57 +0400, Elena Pourmal said:
In the past I only built universal binaries for HDF5 and HDF4 command
line utilities (not libraries). I used different machines and didn't not
use compiler flags on the same machine (but tried it both ways;
unfortunately I couldn't make binaries built on 64-bit Intel to work on
32-bit Intel). Here is the procedure I followed:
--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
Not that easy. There is a program that is generated that is then run to get very specific details about floating point conversions and things like that during the build. The output from that program generates a source file that is included in the build of the library. For my own HDF5 1.6.9 repo I did all the necessary additions to actually make the source file that was produced universal binary compatible. I offered it for inclusion into the latest HDF5 sources but was declined. So about the best you can do is come up with a script that uses cmake to create 4 build trees for HDF5 and then lipo everything together at the end.
···
On Jul 5, 2011, at 12:09 PM, Sean McBride wrote:
On Tue, 5 Jul 2011 12:39:57 +0400, Elena Pourmal said:
In the past I only built universal binaries for HDF5 and HDF4 command
line utilities (not libraries). I used different machines and didn't not
use compiler flags on the same machine (but tried it both ways;
unfortunately I couldn't make binaries built on 64-bit Intel to work on
32-bit Intel). Here is the procedure I followed:
Is the CMake support now in working order? Because with CMake, you just have to set CMAKE_OSX_ARCHITECTURES and it will build universal. (Assuming results of 'try runs' are not used to decide things like endianess and pointer size.)
--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
___________________________________________________________
Mike Jackson www.bluequartz.net
Principal Software Engineer mike.jackson@bluequartz.net
BlueQuartz Software Dayton, Ohio
On Tue, 5 Jul 2011 12:24:59 -0400, Michael Jackson said:
Not that easy. There is a program that is generated that is then run to
get very specific details about floating point conversions and things
like that during the build. The output from that program generates a
source file that is included in the build of the library. For my own
HDF5 1.6.9 repo I did all the necessary additions to actually make the
source file that was produced universal binary compatible. I offered it
for inclusion into the latest HDF5 sources but was declined. So about
the best you can do is come up with a script that uses cmake to create 4
build trees for HDF5 and then lipo everything together at the end.
--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada