Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
compile gcc on raspberry pi with distcc?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Thu Aug 10, 2017 11:30 am    Post subject: compile gcc on raspberry pi with distcc? Reply with quote

Hi

I would like to know if someone uses distcc to compile gcc on an raspberry pi.
I know some packages may not compile when using distcc but I havent found
any information regarding gcc. I would also like to know if you compile it using
overclocked cpu and whether you use all cores on the raspberry pi or a reduced number.

I need to upgrade my gcc from 4.x.x to 5.x.x and I already tried to compile with distcc
but gcc seems to stuck somewhere right after the configuring (24hours without any progress). When I disable distcc it currently
compiles fine. I will wait until it hopefully finishes.
Back to top
View user's profile Send private message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Thu Aug 10, 2017 2:42 pm    Post subject: Reply with quote

This time gcc compiled successfully without distcc.
Code:

/boot/config.txt
#overclock
arm_freq=900
core_freq=333
sdram_freq=450
over_voltage=2
force_turbo=1

qlop -gtHv gcc
gcc-5.4.0-r3: Thu Aug 10 09:20:04 2017: 4 hours, 59 minutes, 29 seconds
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8710
Location: ~Brussels - Belgique

PostPosted: Thu Aug 10, 2017 3:09 pm    Post subject: Reply with quote

Hi!,

distcc is only used during the stage1 (compile xgcc with the host), the stages 2 and 3 use the previous stage's xgcc.

distcc is thus not so useful for gcc, and you need to adjust your MAKEOPTS in order to not saturate the CPU and memory.

I can compile gcc on my Raspberry Pi model A (256 Mb) with the filesystem on NFS, it takes about 27 hours.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Thu Aug 10, 2017 5:43 pm    Post subject: Reply with quote

xaviermiller wrote:
...about 27 hours.

Wow, ok I'll not complain anymore about 5 hours!
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10590
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Aug 10, 2017 6:07 pm    Post subject: Reply with quote

xaviermiller wrote:
I can compile gcc on my Raspberry Pi model A (256 Mb) with the filesystem on NFS, it takes about 27 hours.
That might be faster than my original Gentoo machine (a 90 MHz Pentium 1 with 80 MiB of RAM), but not much. I'll never complain again either. ;)

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Thu Aug 10, 2017 6:53 pm    Post subject: Reply with quote

dasPaul,

You could cheat a little and build it in a suitable chroot on an amd64 platform with the aid of qemu.
Its described on the wiki.
An AMD Phenom 1090T is about half the speed of a Pi 3 when it building arm64 code with the aid of qemu.

gcc can be difficult to cross compile, so I don't recommend that.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 665

PostPosted: Thu Aug 10, 2017 7:13 pm    Post subject: Reply with quote

NeddySeagoon wrote:
dasPaul,
... An AMD Phenom 1090T is about half the speed of a Pi 3 when it building arm64 code with the aid of qemu.


NeddySeagoon, sounded a little funny to me, I'm curious if you meant half the time or half the speed. Is the duration of the build twice as long or half as long?

Thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Thu Aug 10, 2017 9:08 pm    Post subject: Reply with quote

russK,

Half the speed. The build time with QEMU emulating an Pi 3 in arm64 is about double what it is doing a native build on the Pi itself.
There are some crude benchmarks using glibc.

However the Pi has 1G RAM and the Phenom 16G so for bigger packages, it can be the only way to get the build to complete.

Hmm, that doesn't seem right somehow .... I just built firefox-55 in the arm64 chroot much faster that the Pi does it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Mon Aug 14, 2017 4:17 pm    Post subject: Reply with quote

just one more question, after I emerged gcc-5.4.0 and rebuild libtool I
want to rebuild @system and @world. I know this is not absolutely necessary but
I have some astronomy apps that behave very weird after the update.

My question is now Ive already emerged the new gcc and switched to it.
When I issue
Code:
 emerge --ask --emptytree --verbose @system

then I see it want to emerge gcc again. Can I exclude it or
is it really needed to emerge that again?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Mon Aug 14, 2017 5:08 pm    Post subject: Reply with quote

dasPaul,

Its safe to exclude gcc. Its already been built with itself.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Mon Aug 14, 2017 5:33 pm    Post subject: Reply with quote

nice, thanks.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Mon Aug 14, 2017 5:49 pm    Post subject: Reply with quote

dasPaul,

The gcc build system is a bit unusual as build systems go. Its in tree steps.

1. Build gcc with any random compiler on the system.
2. Using the gcc from step 1, build gcc again.
3. Using gcc from step 2 build gcc again and compare it with the gcc from step 2 (it should be identical)

If the compare passes, build all the other languages and install.

It follows that there is only ever one gcc output at the end of stage 1, so distcc can't be used.
Also, that the gcc installed on your system has already been built with itself.

Notice that the news item about gcc says
Code:
For gentoolkit-0.3.1 or higher:
# revdep-rebuild --library 'libstdc++.so.6' -- --exclude gcc

That's the essential rebuld. It excludes gcc too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mDup
Apprentice
Apprentice


Joined: 14 Apr 2006
Posts: 212

PostPosted: Mon Aug 14, 2017 11:54 pm    Post subject: Reply with quote

My experience with qemu is that it works cool and fast on a say a 2x6core amd64 machine with -j13 ... -but- the slow part is 'configure' which uses one CPU.
Perhaps there is a way to cache configure. So now I build native (albeit with NBD disk) on arm64 and overall I am rather happy with results.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Tue Aug 15, 2017 8:10 am    Post subject: Reply with quote

mDup,

A long time ago there was confcache that did for configure what ccache does for C and C++
However, it had more problems than ccache, so it was dropped from Gentoo.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum