malformed object issue for 32-bit compile on Max OS/X

I’m trying for a 32-bit compile for some libraries, such as netcdf, mpich2, etc., on Mac OS X 10.8.0 with PGI 10.3.

The compilation fails consistently with the following error:

/usr/bin/ranlib: object: .xxx/yyy.a(zzz.o) malformed object (LC_SEGMENT command 0 filesize field greater than vmsize field)
ar: internal ranlib command failed

According an earlier post, I tried the flag “-Mnomod” to work around the libtool bug, but it didn’t work for me, I still got the same error.

For example

./configure --prefix=$HOME/netcdf/netcdf-3.6.1_Darwin_pgi_i386 CC=pgcc CXX=pgcpp FC=pgf90 FCFLAGS=-Mnomod CFLAGS=-Mnomod CPPFLAGS=-DpgiFortran

Do I have to update “fnativerc” to add a “$” before “APPENDMOD” in the section for the f901 command at the same time?

And is there anything still missing?



Hi Jerry,

Yes, you will need to add $ for APPENDMOD. That was a typo, $ was missing.



Thanks for your reply.

Is it possbile to override the default ‘fnativerc’ with my own ‘fnativerc’ file located at home direcotry. Because I don’t have write access to the PGI bin direcotry, I need to ask administrator to do it.

PS, I didn’t find any information about -Mnomod option in user manual, what does it use for?



I would suggest asking the admin to change the file because it would also benefit other users as well. If you’d rather find other solution, please email, asking to forward your e-mail to me, then we will provide you with other workaround.


Thanks a lot :)

Both of two solutions works fine.

I still want to know whether if it is possible to use a custom settings to override the default settings in the configuration files in PGI bin directory?

Because one of annoying thing is that admin always forgot to run makelocalrc to update GCCDIR & GCCINC in localrc file after updating OS kernel and make compiler failure.