Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Python, failed to build
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ups
n00b
n00b


Joined: 06 Sep 2018
Posts: 12

PostPosted: Sat Sep 08, 2018 1:27 pm    Post subject: Python, failed to build Reply with quote

I'm trying to update python to 3.6.5. Currently have two versions: 2.7.14 and 3.5.5, emerge -uDN python gives me

Quote:

i686-pc-linux-gnu-gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -march=native -O2 -pipe -fomit-frame-pointer -mfpmath=sse -fwrapv -std=c99 -Wextra -Wno-unused-result -Wno-un
used-parameter -Wno-missing-field-initializers -I./Include -I. -I/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Include -I/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5
-c /var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c -o build/temp.linux-i686-3.6/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.o
In file included from ./Include/Python.h:137:0,
from /var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:55:
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c: In function 'math_fsum':
./Include/pyfpe.h:164:64: warning: passing argument 1 of 'PyFPE_dummy' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
#define PyFPE_END_PROTECT(v) PyFPE_counter -= (int)PyFPE_dummy(&(v));
^
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1228:5: note: in expansion of macro 'PyFPE_END_PROTECT'
PyFPE_END_PROTECT(hi)
^~~~~~~~~~~~~~~~~
./Include/pyfpe.h:134:15: note: expected 'void *' but argument is of type 'volatile double *'
extern double PyFPE_dummy(void *);
^~~~~~~~~~~
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1120:29: warning: variable 'sum' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
PyObject *item, *iter, *sum = NULL;
^~~
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1121:22: warning: variable 'n' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
Py_ssize_t i, j, n = 0, m = NUM_PARTIALS;
^
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1121:29: warning: variable 'm' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
Py_ssize_t i, j, n = 0, m = NUM_PARTIALS;
^
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1122:40: warning: variable 'p' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
double x, y, t, ps[NUM_PARTIALS], *p = ps;
^
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1123:19: warning: variable 'special_sum' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
double xsave, special_sum = 0.0, inf_sum = 0.0;
^~~~~~~~~~~
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1123:38: warning: variable 'inf_sum' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
double xsave, special_sum = 0.0, inf_sum = 0.0;
^~~~~~~
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/mathmodule.c:1069:17: warning: variable 'p' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
double *p = *p_ptr;
^

In file included from /var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/cmathmodule.c:11:0:
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/clinic/cmathmodule.c.h: In function 'cmath_acos':
/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5/Modules/clinic/cmathmodule.c.h:45:1: internal compiler error: Segmentation fault


[...]

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_tkinter nis
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit pwd time

Failed to build these modules:
cmath


[...]

make: *** [Makefile:596: sharedmods] Error 1
* ERROR: dev-lang/python-3.6.5::gentoo failed (compile phase):
* emake failed
*
* If you need support, post the output of `emerge --info '=dev-lang/python-3.6.5::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/python-3.6.5::gentoo'`.
* The complete build log is located at '/var/tmp/portage/dev-lang/python-3.6.5/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-3.6.5/temp/environment'.
* Working directory: '/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5'
* S: '/var/tmp/portage/dev-lang/python-3.6.5/work/Python-3.6.5'

>>> Failed to emerge dev-lang/python-3.6.5, Log file:

>>> '/var/tmp/portage/dev-lang/python-3.6.5/temp/build.log'



grep -ri python /etc/portage:

Quote:
USE="emacs gtk java mbox python spell xemacs modemmanager zsh-completion -gnome-online-accounts"


Any workarounds?
Back to top
View user's profile Send private message
Cuong Nguyen
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jan 2018
Posts: 133

PostPosted: Sat Sep 08, 2018 2:05 pm    Post subject: Reply with quote

I've hit segmentation fault errors many times compiling all versions of python, especially when you use --enable-optimizations and pgo at high load-average ~10.0. My solution is re-run compiling again, eliminating running other processes on the build host.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14382

PostPosted: Sat Sep 08, 2018 3:57 pm    Post subject: Re: Python, failed to build Reply with quote

ups wrote:
Quote:
* If you need support, post the output of `emerge --info '=dev-lang/python-3.6.5::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/python-3.6.5::gentoo'`.
Please follow the instructions that the package manager printed.
Back to top
View user's profile Send private message
ups
n00b
n00b


Joined: 06 Sep 2018
Posts: 12

PostPosted: Sat Sep 08, 2018 4:13 pm    Post subject: Re: Python, failed to build Reply with quote

Hu wrote:
ups wrote:
Quote:
* If you need support, post the output of `emerge --info '=dev-lang/python-3.6.5::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/python-3.6.5::gentoo'`.
Please follow the instructions that the package manager printed.


Here it is:

Code:
Portage 2.3.40 (python 3.5.5-final-0, default/linux/x86/17.0/desktop/gnome/systemd, gcc-7.3.0, glibc-2.26-r7, 4.14.52-gentoo i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.52-gentoo-i686-Intel-R-_1.66GHz-with-gentoo-2.4.1
KiB Mem:     4016648 total,   3001496 free
KiB Swap:    2047996 total,   2001396 free
Timestamp of repository gentoo: Sat, 08 Sep 2018 09:45:02 +0000
Head commit of repository gentoo: a753e52d96f72ab54bd959982e39b26fafd21076
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Repositories:

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

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA Broadcom"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -mfpmath=sse"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/php/apache2-php7.1/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-A --keep-going"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY 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="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/ ftp://ftp.vectranet.pl/gentoo/ http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_BINHOST="http://tinderbox.dev.gentoo.org/default-linux/x86/"
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 a52 aac acl acpi alsa berkdb bluetooth branding bzip2 cairo cdda cdr cli colord crypt cups cxx dbus dri dts dvd dvdr eds emacs emboss encode evo exif fam flac fortran gdbm gif glamor gnome gnome-keyring gpm gstreamer gtk iconv introspection ipv6 java jpeg lcms ldap libnotify libsecret libtirpc mad mbox mng modemmanager modules mp3 mp4 mpeg nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio python qt5 readline sdl seccomp spell ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vorbis wxwidgets x264 x86 xattr xcb xemacs xml xv xvid zlib zsh-completion" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="sse2 sse mmx mmxext" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


and

Code:
[ebuild  NS   ] dev-lang/python-3.6.5 [2.7.14-r1, 3.5.5] USE="gdbm ipv6 ncurses readline sqlite ssl (threads) xml -build -examples -hardened -libressl {-test} -tk -wininst"
emerge -pqv '=dev-lang/python-3.6.5::gentoo'  110.88s user 1.71s system 63% cpu 2:56.13 total


[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 22688
Location: here

PostPosted: Sun Sep 09, 2018 8:55 am    Post subject: Reply with quote

You try compile package with only cflgas setted to -march=native -O2 -pipe
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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