View previous topic :: View next topic |
Author |
Message |
cnot n00b
Joined: 17 Dec 2003 Posts: 16
|
Posted: Thu Jun 17, 2004 5:55 am Post subject: gentoo 2004.1 gcc produces very slow code! |
|
|
I installed gemtoo 2004.1 on an opteron machine. Most things are working OK but I noticed that floating point C code compiled with gcc-3.3.3 runs very slowly. I also have access to a Suse-9 machine so I did some simple tests. I compiled the code on the gentoo machine and the suse machine and compared run times. The code compiled on the Suse machine runs 35% quicker than the code compiled on the gentoo machine when both executables are run on the gentoo machine.
Any ideas? |
|
Back to top |
|
|
Jazz Guru
Joined: 16 Nov 2003 Posts: 543 Location: Melbourne, Australia
|
Posted: Thu Jun 17, 2004 6:23 am Post subject: |
|
|
35%, hmm that looks kinda acurate..
And how exactly did u perform these tests ? under what kernel, Gcc version, and exactly what executable are we talking about here ?
I think its a bit of exxaggeration, eh ! _________________ In 2010, M$ Windows will be a quantum processing emulation layer for a 128-bit mod of a 64-bit hack of a 32-bit patch to a 16-bit GUI for an 8-bit operating system written for a 4-bit processor from a 2-bit company that can't stand 1 bit of competition. |
|
Back to top |
|
|
the_sphynx Apprentice
Joined: 19 May 2004 Posts: 156 Location: Thornton, CO
|
Posted: Thu Jun 17, 2004 6:24 am Post subject: |
|
|
What CFLAGS and MAKEOPTS do you use in your /etc/make.conf file? _________________ Folding@Home User 285941 |
|
Back to top |
|
|
cnot n00b
Joined: 17 Dec 2003 Posts: 16
|
Posted: Thu Jun 17, 2004 6:55 am Post subject: |
|
|
Jazz wrote: | 35%, hmm that looks kinda acurate..
And how exactly did u perform these tests ? under what kernel, Gcc version, and exactly what executable are we talking about here ?
I think its a bit of exxaggeration, eh ! |
Well, 35% is fairly accurate... THe suse compiled and linked code ran in 21 sec while the gentoo equivalent took 30 sec. Compiled and linked on different machines but run on the gentoo machine.
The kernel: 2.6.3
gcc 3.3.3
The executable was produced by gcc using a small test program written in c. The code is our proprietary code so I can't show this. However, we make our living running numerical computations using our proprietary code so we are very familiar with how to compile and build executables.
/etc/make.conf
CFLAGS=-O2
MAKEOPTS=-j2
Why do you think the make.conf settings would make a difference?
I should add that I installed gcc 3.4 as a test and the executable produced byt this ran at the same speed as the Suse produced executable. |
|
Back to top |
|
|
the_sphynx Apprentice
Joined: 19 May 2004 Posts: 156 Location: Thornton, CO
|
Posted: Thu Jun 17, 2004 7:04 am Post subject: |
|
|
The reason that I believe that it could be your make.conf is because the Opteron is a VERY fast processor. Here is my make.conf:
Code: |
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
|
I am not really sure about the Opteron, but I am sure that there is an arch for according to gcc so I would check into that. _________________ Folding@Home User 285941 |
|
Back to top |
|
|
RAPUL l33t
Joined: 29 Dec 2002 Posts: 664 Location: Valencia (SPAIN)
|
Posted: Thu Jun 17, 2004 7:50 am Post subject: Hmmm.. |
|
|
Ok, so you are compiling a program by your own, not emerging something.
So you are right then /etc/make.conf does not matter.
Can you post how do you compile that propietary program? Or just the Makefile if it is not secret also... _________________ Entropy rulz world.
Redundancy sux.
World is full of redundancy.
World sux. |
|
Back to top |
|
|
cnot n00b
Joined: 17 Dec 2003 Posts: 16
|
Posted: Thu Jun 17, 2004 8:02 am Post subject: Makefile |
|
|
THe makefile is very simple, here it is:
----------------------------------
CFLAGS = -O2
CC=gcc
LIBS =
OBJS = main.o \
comp1.o \
comp2.o
all:: test
test:$(OBJS)
\: ;
$(CC) -o $@ $(OBJS) $(LIBS) -lm
\: ;
------------------------------------------------
Thanks for any help with this. |
|
Back to top |
|
|
deltaden n00b
Joined: 09 Aug 2003 Posts: 8
|
Posted: Sun Jun 20, 2004 2:49 am Post subject: |
|
|
well, if I remember correctly, Suse isn't using standard kernel and gcc version for their AMD64 distrib. Their version of GCC 3.3 is a "special" one with some backport from gcc 3.4, wich seems coherent with what you are saying. The reason is that the 3.3 branch was closed before they wer able to include some important optimisations, but choose to inculde it in their distrib...
Can the explanation be that the maintainers from the amd64 kernel and the gcc branch are working for them ???
I'm not so sure, but I remember reading some infos about that. |
|
Back to top |
|
|
cnot n00b
Joined: 17 Dec 2003 Posts: 16
|
Posted: Mon Jun 21, 2004 1:54 am Post subject: |
|
|
OK, could very well explain why the 2.3.3 produces slow code on the AMD64.
I took the plunge and installed gcc 3.4, recompiled glibc and so far so good! The computational speed is now as expected and I have not had any crashes so far. |
|
Back to top |
|
|
|