Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compiling gcc
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Mon Apr 12, 2021 1:21 pm    Post subject: Compiling gcc Reply with quote

Hello and thank you for your time to read this, and help.
I have been stuck for hours, compiling time for sys-devel/gcc has been very long.
Anyone can help ? Thank you.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Mon Apr 12, 2021 1:23 pm    Post subject: Reply with quote

Sorry, but what's the problem?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Mon Apr 12, 2021 1:28 pm    Post subject: Reply with quote

Portage niceness is 12.

Quote:
See https://bugs.gentoo.org/333639 for more info.
>>> Running pre-merge checks for net-wireless/blueman-2.1.4
>>> Emerging (1 of 89) sys-devel/gcc-10.3.0::gentoo

I am stuck with emerge for hours in Gcc.

I have i5-4200M (2.5 - 3.1 GHz), 8 gigs of ram.


Last edited by RIA77 on Mon Apr 12, 2021 1:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Mon Apr 12, 2021 1:30 pm    Post subject: Reply with quote

You can post your emerge --info? Without information is hard to help you
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Mon Apr 12, 2021 1:31 pm    Post subject: Reply with quote

Quote:
Portage 3.0.18 (python 3.8.9-final-0, default/linux/amd64/17.1/hardened, gcc-9.3.0, glibc-2.32-r5, 4.19.0-14-amd64 x86_64)
=================================================================
System uname: Linux-4.19.0-14-amd64-x86_64-Intel-R-_Core-TM-_i5-4200M_CPU_@_2.50GHz-with-glibc2.2.5
KiB Mem: 8084044 total, 1434020 free
KiB Swap: 262140 total, 261872 free
Timestamp of repository gentoo: Sun, 11 Apr 2021 18:00:01 +0000
Head commit of repository gentoo: f3e0bbeab9d908ef77a652d405751e146393194b
sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
app-shells/bash: 5.0_p18::gentoo
dev-lang/perl: 5.32.1::gentoo
dev-lang/python: 2.7.18-r5::gentoo, 3.7.10_p1::gentoo, 3.8.9::gentoo, 3.9.4::gentoo
dev-lang/rust: 1.47.0-r2::gentoo
dev-util/cmake: 3.17.4-r1::gentoo
sys-apps/baselayout: 2.7::gentoo
sys-apps/openrc: 0.42.1::gentoo
sys-apps/sandbox: 2.20::gentoo
sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake: 1.16.2-r1::gentoo
sys-devel/binutils: 2.34-r2::gentoo
sys-devel/gcc: 9.3.0-r2::gentoo
sys-devel/gcc-config: 2.3.2-r1::gentoo
sys-devel/libtool: 2.4.6-r6::gentoo
sys-devel/make: 4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc: 2.32-r5::gentoo
Repositories:

gentoo
location: /var/db/repos/gentoo
sync-type: rsync
sync-uri: rsync://rsync.gentoo.org/gentoo-portage
priority: -1000
sync-rsync-extra-opts:
sync-rsync-verify-metamanifest: yes
sync-rsync-verify-max-age: 24
sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS=""
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS=""
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4 --with-bdeps y --complete-graph y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS=""
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""
GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo rsync://rsync.gtlib.gatech.edu/gentoo https://gentoo.osuosl.org/ http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/ https://mirrors.rit.edu/gentoo/ http://mirrors.rit.edu/gentoo/ ftp://mirrors.rit.edu/gentoo/ rsync://mirrors.rit.edu/gentoo/ http://gentoo.mirrors.tds.net/gentoo http://gentoo.cs.utah.edu/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4 -l4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl amd64 bzip2 crypt cups dbus elogind gtk hardened iconv ipv6 libglvnd libtirpc multilib ncurses networkmanager nls nptl openmp pam pcre pcre16 pie pulseaudio readline seccomp split-usr ssl ssp unicode wifi xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_7" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel i965 nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Mon Apr 12, 2021 1:41 pm    Post subject: Reply with quote

How long have you been compiling? You have set portage TMPDIR on tmpfs? Are you doing anything else while compiling?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Mon Apr 12, 2021 1:57 pm    Post subject: Reply with quote

I have been stuck approx 90 minutes.
I can't mount TMPDIR on tmpfs, I don't have enough RAM, only 8 gigabytes.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Mon Apr 12, 2021 2:09 pm    Post subject: Reply with quote

In my i7-4930K_CPU (6 core 12 threads) with 32GB of ram and MAKEOPTS set to -j13
Code:
     Mon Mar  8 09:59:37 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 46 minutes and 57 seconds.

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21628

PostPosted: Mon Apr 12, 2021 3:19 pm    Post subject: Reply with quote

OP has blank CFLAGS, so some tools may be built without optimization. That will likely have some negative performance impact.

RIA77: please use code tags for posting generated output.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Mon Apr 12, 2021 4:17 pm    Post subject: Reply with quote

Hu wrote:
OP has blank CFLAGS, so some tools may be built without optimization. That will likely have some negative performance impact.

You right, I hadn't noticed.
Anyway a couple of hours doesn't seem too wrong.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Mon Apr 12, 2021 5:12 pm    Post subject: Reply with quote

fedeliallalinea wrote:
In my i7-4930K_CPU (6 core 12 threads) with 32GB of ram and MAKEOPTS set to -j13
Code:
     Mon Mar  8 09:59:37 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 46 minutes and 57 seconds.

Nice machine ! If you have a mind to test something, you could recompile gcc with MAKEOPTS="-j12" and proof whether it is (a little bit) faster (withoutdoing something else on this machine).

I would be also very interested in the result.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Mon Apr 12, 2021 5:54 pm    Post subject: Reply with quote

pietinger wrote:
Nice machine ! If you have a mind to test something, you could recompile gcc with MAKEOPTS="-j12" and proof whether it is (a little bit) faster (withoutdoing something else on this machine).

I would be also very interested in the result.

Now the system is under working but as soon as it ends I'll try it and post the result
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Mon Apr 12, 2021 7:16 pm    Post subject: Reply with quote

fedeliallalinea wrote:
[...] but as soon as it ends I'll try it and post the result

Thank you very much (in advance).
Greetings,
Peter
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Mon Apr 12, 2021 7:22 pm    Post subject: Reply with quote

Hu wrote:
OP has blank CFLAGS, so some tools may be built without optimization. That will likely have some negative performance impact.

RIA77: please use code tags for posting generated output.


Thank you. How to optimize use on my CPU ?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Mon Apr 12, 2021 7:37 pm    Post subject: Reply with quote

Use safe use flag -march=native -O2 -pipe
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Mon Apr 12, 2021 7:46 pm    Post subject: Reply with quote

I am confused

"-O2 -pipe -march=x86-64 -mtune=native" is wrong ?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Mon Apr 12, 2021 9:52 pm    Post subject: Reply with quote

RIA77 wrote:
"-O2 -pipe -march=x86-64 -mtune=native" is wrong ?

No, it is not wrong. It is only (very) slow because your -march dont allow your compiler (gcc) to compile optimized code for your CPU. With -mtune you allow a little bit of optimizing. But the code must run on every march-architecture. See more here:
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html =>
Quote:
-mtune=cpu-type

Tune to cpu-type everything applicable about the generated code, except for the ABI and the set of available instructions. While picking a specific cpu-type schedules things appropriately for that particular chip, the compiler does not generate any code that cannot run on the default machine type unless you use a -march=cpu-type option. For example, if GCC is configured for i686-pc-linux-gnu then -mtune=pentium4 generates code that is tuned for Pentium 4 but still runs on i686 machines.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Mon Apr 12, 2021 9:58 pm    Post subject: Reply with quote

P.S.: BTW: Your kernel is (very) old. You should upgrade ;-) Stable kernel in Gentoo is now 5.10.27 (as today).
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Tue Apr 13, 2021 1:39 am    Post subject: Reply with quote

Not sure if kernel version matters way too much...
BTW how long is too long?

My Core2 Quad takes 2 hours and my i7 takes about an hour, both with 8GB RAM. You should be somewhere between so it's nothing to be worried about until it hits the 2 hour mark. Also depends on how much stuff you're also running in the meantime.

Another thing I noticed:
emerge --info wrote:
Code:
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4 --with-bdeps y --complete-graph y"
MAKEOPTS="-j4 -l4"

IMHO to allow forward progress on one of the two, I'd rather have individual packages finish instead of slot fill throughput. Make/MAKEOPTS seems to do okay in slot filling and I've frequently seen emerge only have one build queued at a time so there seems to be a lot of dependencies anyway. My suggestion is to limit --jobs to 2, and not use --load-average. However set MAKEOPTS to "-j5 -l5" and allow more jobs to fill lulls due to disk or some other delay. This of course is not best for all situations and build jobs but I think it gives better package throughput.

Big question is: Is your machine doing something else at the same time? Are there actually 4 gcc processes running or less than that? What's the typical load average during building?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Tue Apr 13, 2021 4:25 am    Post subject: Reply with quote

Interesting thread:
My i7-2600 4 core 8 thread w/16 GB
Code:
genlop -i sys-devel/gcc-10.2.0-r5
 * sys-devel/gcc

   Total builds: 1
   Global build time: 1 hour, 1 minute and 47 seconds.

   * sys-devel/gcc-10.2.0-r5
   Install date: Mon Mar  8 12:46:18 2021
   USE=""
   CFLAGS="-march=native -pipe -O2"   CXXFLAGS="-march=native -pipe -O2"   LDFLAGS="-Wl,-O1 -Wl,--as-needed"


while my Athlon 7850 2 core w/4 GB (not optimized)
Code:
genlop -i sys-devel/gcc-10.2.0-r5
 * sys-devel/gcc

   Total builds: 1
   Global build time: 2 hours, 12 minutes and 7 seconds.

   * sys-devel/gcc-10.2.0-r5
   Install date: Tue Mar 16 19:13:18 2021
   USE=""
   CFLAGS="-march=i686 -O2"   CXXFLAGS="-march=i686 -O2"   LDFLAGS="-Wl,-O1 -Wl,--as-needed"


In other words, patience is in order.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30908
Location: here

PostPosted: Tue Apr 13, 2021 5:25 am    Post subject: Reply with quote

fedeliallalinea wrote:
pietinger wrote:
Nice machine ! If you have a mind to test something, you could recompile gcc with MAKEOPTS="-j12" and proof whether it is (a little bit) faster (withoutdoing something else on this machine).

I would be also very interested in the result.

Now the system is under working but as soon as it ends I'll try it and post the result

No very important difference
Code:
     Mon Mar  8 09:59:37 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 46 minutes and 57 seconds.

     Tue Apr 13 00:36:26 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 44 minutes and 23 seconds.

First result with -j13 second with -j12
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Apr 13, 2021 8:26 am    Post subject: Reply with quote

RIA77,

Build tiwes vary, depending on what else is going on.
Code:
# genlop -t gcc

     Sun Jan  3 19:42:59 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 1 minute and 39 seconds.

     Wed Feb 24 01:35:17 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 9 hours, 35 minutes and 50 seconds.


That's two installs on an 8G Pi4. The first one is a binary install.
The second one, it built for itself but 9 hours is an unusually long build time. I was either doing something else or it was pushed into swapping.
Its usually around 4 hours. with no Xorg running.

8G RAM and MAKEOPTS="-j4" and large C++ projects will use swap if much else is going on.
If swap is in use, reducing MAKEOPTS will help.

You may want to set MAKEOPTS on a per package basis.
_________________
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
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Tue Apr 13, 2021 8:59 am    Post subject: Reply with quote

NeddySeagoon wrote:
Build tiwes vary, depending on what else is going on.

Wow! A Dvorak keyboard user!
Quote:
The second one, it built for itself but 9 hours is an unusually long build time.

On most of my systems, gcc takes about 6 hours, so I do not think that this is unusual long.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Tue Apr 13, 2021 9:18 am    Post subject: Reply with quote

fedeliallalinea wrote:
Code:
     Mon Mar  8 09:59:37 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 46 minutes and 57 seconds.

     Tue Apr 13 00:36:26 2021 >>> sys-devel/gcc-10.2.0-r5
       merge time: 44 minutes and 23 seconds.

First result with -j13 second with -j12

Thanks a lot, fedeliallalinea !

I asked because of an old recommendation: take cores + 1 for MAKEOPTS; but it is actually better to use only the number of cores (as maximum; depeding also to your amount of RAM).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Apr 13, 2021 9:22 am    Post subject: Reply with quote

mv,

Well spotted!

gcc is not the longest package to build.. qtwebkit. rust and chromium are worse.
_________________
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 Installing Gentoo All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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