Showing results for 
Search instead for 
Did you mean: 

Looking for efficient compilation process

Occasional Visitor

Looking for efficient compilation process

I'm curently trying to optimize the way we produce executables on Unix. Some OS are really fast during the link phase, some other really aren't, especialy Linux (and HP-UX 10.20, but his is another story...)

For instance, on AIX 4.3.3, our whole application takes approximately 8 hours to compile entirely. On Solaris, it takes 11 hours (quite same configuration than AIX). On Linux (Redhat 7.1), it takes nearly 48 hours, even though this OS is ported on our (supposed) best server (PIII 1.1 Ghz).

The compilations are static, using archive files (libXXX.a, lots of), and gcc 2.96, with no particular options. Are there some options, or way of compiling (except shared libraries, due to management and history of our product) that may speed up the link (Producing just a .o file is fast on our Linux machine, it's ok)?

Compared with AIX, we've set up prelink (prelink of the libXXX.a into libxxx.o), which divided the compilation time by 16. I've tried the same on Linux, but got lots of undefined symbols, for the linker tried to link with every .o file in the "prelink" archive file (libXXX.o).

Thanks for any help.

Kodjo Agbenu
Honored Contributor

Re: Looking for efficient compilation process


I have heard that gcc is neither the fastest, nor the most efficient compiler on Intel architecture.

If you want performance, try the compiler provided by Intel (I don't remember the URL).

Another tip : if you are using GNU Make on a multi-processor machine, you can use "-j" option to parallelize compilation amoung CPUs.

On a 4-way machine :

make -j 4 ...

Good luck.

Learn and explain...
Occasional Visitor

Re: Looking for efficient compilation process

Hello, Kodjo,

Thanks for the information, i'll investigate on Intel Side for any other compiler.

But my problem seems to be dependent on ld, not on gcc. Producing .o from .c files is rather fast enough on our Linux platform (in fact, it's even the fastest, compared with the other systems i'm using...)

And I don't use make. I know, I should, but we use big house-made scripts which were written years ago, when dinosaurs were leading the planet... ;-)

First of all, we compile .c file to get .o file, and then we launch something like that:
gcc -o myprog file1.o -llib1 -llib2 ... -lm

It works fine, but very slowly..