HDF5-1.8.5, Mac OS X Server 10.6.4, PGI Fortran 9.0

I’m trying to compile HDF5-1.8.5 on Mac OS X Server 10.6.4 with PGI Fortran 9.0 and gcc-4.2.1 and/or gcc-4.0.1. I’m trying for a 32-bit compile and thus using the 32-bit pgfortran and the “-m32” switch on gcc.

The compilation fails consistently with the following error:
/usr/bin/ranlib: object: .libs/libhdf5_fortran.a(H5f90global.o) malformed object (LC_SEGMENT command 0 filesize field greater than vmsize field)
ar: internal ranlib command failed

Some searches for this error haven’t turned up anything useful. There are a few threads in this forum, but nothing that seems relevant.
Does anyone here have any insight on this error or on compiling HDF5 on OS X?


Please try pgf90 instead of pgfortran. The HDF5 still takes pgf90 and has not yet configured for pgfortran.


I, unfortunately, still get the same error using pgf90 rather than pgfortran.

What is your configuration line:

This is mine:
./configure FC=pgf90 CC=“gcc -m32” CXX=“g++ -m32”

Which version of PGI compiler do you use? How do you set you path to PGI? Please make sure you do make clean first.


The full command I was using:
./configure --prefix=/Users/corey/tmp/local/hdf5-1.8.5-patch1 --enable-fortran --with-zlib=/Users/corey/tmp/local/zlib-1.2.5 --with-szlib=/Users/corey/tmp/local/szip-2.1 --with-default-api-version=v16

I noticed you don’t have the --enable-fortran flag in yours which skips the compilation of libhdf5_fortran and thus the problem. I didn’t specifically set the CXX to include the -m32 flag. I tried that, but still get the error.

PGI compiler version:
pgf90 9.0-4 32-bit target on Apple OS/X

HDF5 version:

corey$ echo $PATH

$PATH is set in my .bash_profile.

Also, I am running “make clean” before attempting different compiling options.


This may be a bug related to newer libtool. We are investigating and will let you know asap.
Thank you,


Please contact trs@pgroup.com for this bug. We will provide a workaround for you. Refer to trs#17261.

Thanks for reporting to us.

The similar problem with libtool. Builds ok on MacOS 10.5.8, reports “malformed object (LC_SEGMENT command 0 filesize field greater than vmsize field)” on MacOS 10.6. PGI 10.8.

Hi Vladimir,

Hongyon is out this week on Winder Break, but in looking at TPR#17261, she suggests using the flag “-Mnomod” to work around the libtool bug.

Note she also found a typo in one of our configuration files that ships with the 2010 MacOSX compilers. Please update your “fnativerc” file (found in your PBI bin directory) to add a “$” before “APPENDMOD” in the section for the f901 command.




Hope this helps,

Hi, Mat,

The mentioned flag solved the issue, thanks!

Will the problem be fixed? As I see 11.10 has the same issue.


Hi Valdimir,

Changing the compiler version shouldn’t matter since the problem is with libtool. I’ll ask Hongyon next week if Apple has an updated libtool that fixes the problem.

  • Mat

Hi Mat,

Thank you for the clarification!