Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scipy-0.11.0 not compiling
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
logical_guy
Apprentice
Apprentice


Joined: 18 Sep 2007
Posts: 268

PostPosted: Thu Nov 22, 2012 12:03 pm    Post subject: scipy-0.11.0 not compiling Reply with quote

Well, I've been trying since last night to compile scipy-0.11.0 and it always fails at this part:

Code:
creating build-2.7/temp.linux-x86_64-2.7/build-2.7
creating build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7
creating build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy
creating build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack
creating build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack/src
compile options: '-Iscipy/fftpack/src -Ibuild-2.7/src.linux-x86_64-2.7 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c'
x86_64-pc-linux-gnu-gcc: scipy/fftpack/src/zrfft.c
x86_64-pc-linux-gnu-gcc: scipy/fftpack/src/zfft.c
x86_64-pc-linux-gnu-gcc: build-2.7/src.linux-x86_64-2.7/scipy/fftpack/src/dst.c
x86_64-pc-linux-gnu-gcc: scipy/fftpack/src/drfft.c
x86_64-pc-linux-gnu-gcc: scipy/fftpack/src/zfftnd.c
x86_64-pc-linux-gnu-gcc: build-2.7/src.linux-x86_64-2.7/scipy/fftpack/_fftpackmodule.c
x86_64-pc-linux-gnu-gcc: build-2.7/src.linux-x86_64-2.7/scipy/fftpack/src/dct.c
x86_64-pc-linux-gnu-gcc: build-2.7/src.linux-x86_64-2.7/fortranobject.c
/usr/bin/x86_64-pc-linux-gnu-gfortran -Wall -Wl,-O1 -Wl,--as-needed -shared build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack/_fftpackmodule.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/zfft.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/drfft.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/zrfft.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/zfftnd.o build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack/src/dct.o build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack/src/dst.o build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/fortranobject.o -L/usr/lib64 -Lbuild-2.7/temp.linux-x86_64-2.7 -ldfftpack -lfftpack -lpython2.7 -lgfortran -o build-2.7/lib.linux-x86_64-2.7/scipy/fftpack/_fftpack.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/../../../../x86_64-pc-linux-gnu/bin/ld: build-2.7/temp.linux-x86_64-2.7/libdfftpack.a(zffti1.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
build-2.7/temp.linux-x86_64-2.7/libdfftpack.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/../../../../x86_64-pc-linux-gnu/bin/ld: build-2.7/temp.linux-x86_64-2.7/libdfftpack.a(zffti1.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
build-2.7/temp.linux-x86_64-2.7/libdfftpack.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: Command "/usr/bin/x86_64-pc-linux-gnu-gfortran -Wall -Wl,-O1 -Wl,--as-needed -shared build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack/_fftpackmodule.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/zfft.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/drfft.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/zrfft.o build-2.7/temp.linux-x86_64-2.7/scipy/fftpack/src/zfftnd.o build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack/src/dct.o build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/scipy/fftpack/src/dst.o build-2.7/temp.linux-x86_64-2.7/build-2.7/src.linux-x86_64-2.7/fortranobject.o -L/usr/lib64 -Lbuild-2.7/temp.linux-x86_64-2.7 -ldfftpack -lfftpack -lpython2.7 -lgfortran -o build-2.7/lib.linux-x86_64-2.7/scipy/fftpack/_fftpack.so" failed with exit status 1
 * ERROR: sci-libs/scipy-0.11.0 failed (compile phase):
 *   Building failed with CPython 2.7 in distutils_building() function
 *
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 5529:  Called distutils_src_compile 'config_fc' '--noopt' '--noarch'
 *   environment, line 1457:  Called python_execute_function 'distutils_building' 'config_fc' '--noopt' '--noarch'
 *   environment, line 3820:  Called die
 * The specific snippet of code:
 *                       die "${failure_message}";
 *
 * If you need support, post the output of `emerge --info '=sci-libs/scipy-0.11.0'`,
 * the complete build log and the output of `emerge -pqv '=sci-libs/scipy-0.11.0'`.
 * The complete build log is located at '/var/tmp/portage/sci-libs/scipy-0.11.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sci-libs/scipy-0.11.0/temp/environment'.
 * Working directory: '/var/tmp/portage/sci-libs/scipy-0.11.0/work/scipy-0.11.0'
 * S: '/var/tmp/portage/sci-libs/scipy-0.11.0/work/scipy-0.11.0'


This is my emerge --info:

Code:
Portage 2.1.11.31 (default/linux/amd64/10.0/desktop, gcc-4.5.4, glibc-2.15-r3, 3.5.7-gentoo x86_64)
=================================================================
System uname: Linux-3.5.7-gentoo-x86_64-Intel-R-_Core-TM-_i5-2520M_CPU_@_2.50GHz-with-gentoo-2.1
Timestamp of tree: Thu, 22 Nov 2012 09:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.5
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo gamerlay sunrise gentoo-haskell
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -mno-avx"
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/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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 -mno-avx"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="fPIC"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="fPIC"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://mirror.bytemark.co.uk/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB hi"
MAKEOPTS="-j7"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/gamerlay /var/lib/layman/sunrise /var/lib/layman/haskell"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 bash-completion beagle berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dga dri dts dvd dvdr dvdread emboss encode exif fam ffmpeg firefox flac fortran gdbm gif gpm gstreamer gtk iconv ipv6 java jpeg lcms ldap libnotify lm_sensors mad mmx mng modules mono mp3 mp4 mpeg mudflap multilib ncurses nls nptl nsplugin ogg openal opengl openmp pam pango pcre pdf png pnm policykit ppds pppd qt3-support qt3support qt4 quicktime readline sdl session spell sse sse2 ssl ssse3 startup-notification svg tcpd thinkpad threads tiff truetype udev udisks unicode upower usb v4l v4l2 vaapi vim-syntax vorbis wifi wxwidgets x264 xcb xml xv xvid zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB hi" NETBEANS_MODULES="*" PHP_TARGETS="php5-3" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="intel v4l vesa fbdev" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sci-libs/scipy-0.11.0 was built with the following:
USE="(multilib) -doc -test -umfpack"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -shared"



gfortran info:

Code:
 $ gfortran -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4/gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.4/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.4/work/gcc-4.5.4/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.4 p1.0, pie-0.4.7'
Thread model: posix
gcc version 4.5.4 (Gentoo 4.5.4 p1.0, pie-0.4.7)


I have no idea how to proceed, as googling doesn't throw up any ideas. Neither does searching in the forums.

Really need help on this. Thanks, guys.
Back to top
View user's profile Send private message
m_lan
n00b
n00b


Joined: 29 Mar 2012
Posts: 16
Location: Poland, Warsaw

PostPosted: Fri Nov 23, 2012 12:24 pm    Post subject: Reply with quote

Maybe try installing via pip? (http://pypi.python.org/pypi/pip)
I think Python Package Index has newer versions, for example it has matplotlib 1.2.x which is compatible with python3.

Another suggestion is to upgrade gcc to 4.6.3. I dont know if this would help, but i have this version installed and scipy works fine.
Back to top
View user's profile Send private message
logical_guy
Apprentice
Apprentice


Joined: 18 Sep 2007
Posts: 268

PostPosted: Fri Nov 23, 2012 10:11 pm    Post subject: Reply with quote

Thanks for your reply.

I want to avoid unmasking if I can, so I'll think about the gcc-4.6.3 bit.

About pip, I'll do some research on it as well and see what it's about. Hopefully then I'll have a better idea of the best way forward.
Back to top
View user's profile Send private message
verchiel
n00b
n00b


Joined: 25 Nov 2012
Posts: 15

PostPosted: Sun Nov 25, 2012 3:54 pm    Post subject: Reply with quote

I am facing the same issue, and I might add that GCC 4.6.3 returns with the same errors.

I have now successfully compiled SciPy running pip. Just don't forget to have swig installed as it is needed. So thanks to m_lan so far! :)

I originally wanted to compile SAGE though, and as it depends on SciPy it still wants to install it from the ebuild. Can pip also tell emerge that is has installed a certain package? I could not find any information on this, unfortunately. Masking the package would not help. :(
Back to top
View user's profile Send private message
defensor
n00b
n00b


Joined: 23 Apr 2008
Posts: 6

PostPosted: Wed Nov 28, 2012 8:26 pm    Post subject: Reply with quote

Same problem here. I really don't know what the problem is.
Back to top
View user's profile Send private message
pneula
n00b
n00b


Joined: 16 Jan 2009
Posts: 37

PostPosted: Thu Nov 29, 2012 9:59 am    Post subject: Reply with quote

Just the same here, very annoying. Pip made it for me too.

I guess this is related to Python 2 vs 3 issues. I also got matplotlib working by installing it with pip even though I couldn't import it from a succesful portage installation.
Back to top
View user's profile Send private message
logical_guy
Apprentice
Apprentice


Joined: 18 Sep 2007
Posts: 268

PostPosted: Thu Nov 29, 2012 11:25 am    Post subject: Reply with quote

So does pip use different compiler options to portage for python?
Back to top
View user's profile Send private message
dark_dimius
n00b
n00b


Joined: 12 Mar 2008
Posts: 3

PostPosted: Thu Nov 29, 2012 2:28 pm    Post subject: Reply with quote

fixed compiling by running
FFLAGS="-O2 -fPIC -march=native" python setup.py build
in build dir
Back to top
View user's profile Send private message
defensor
n00b
n00b


Joined: 23 Apr 2008
Posts: 6

PostPosted: Thu Nov 29, 2012 6:19 pm    Post subject: Reply with quote

Is there a way to use that trick by using portage?
Back to top
View user's profile Send private message
verchiel
n00b
n00b


Joined: 25 Nov 2012
Posts: 15

PostPosted: Fri Nov 30, 2012 9:35 pm    Post subject: Reply with quote

Well I even tried adding -fPIC to both CFLAGS and FFLAGS in my global make.conf with no success... I read about it solving several compiling issues though.

Did you successfully compile using emerge then, dark_dimius?

edit: more information on the -fPIC CFLAG can be found here: http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3#doc_chap6
as well is here: http://devmanual.gentoo.org/archs/amd64/index.html
and even in more detail: http://www.gentoo.org/proj/en/hardened/pic-internals.xml

Neither of these could help me solve the issue though... I still have no clue what to do to pass the parameter for the library build. :/
Back to top
View user's profile Send private message
verchiel
n00b
n00b


Joined: 25 Nov 2012
Posts: 15

PostPosted: Fri Nov 30, 2012 11:32 pm    Post subject: Reply with quote

SOLVED:

Have a look at http://sergiosdj.wordpress.com/2008/06/24/how-to-personalize-a-packages-cflags-in-gentoo/

To summarize the solution:
You need to set the FFLAGS for the specific ebuild. In your /etc/portage/, you will find env/. There you create the directory sci-libs/ and a file scipy inside of it (in general: /etc/portage/env/<category>/<package>). There just add the -fPIC to FFLAGS
:
Code:
FFLAGS="$FFLAGS -fPIC"


I actually added it to all three, i.e., FFLAGS, CFLAGS and CXXFLAGS, just to make sure. Simply adding it to FFLAGS should be fine though.
The merge process now succeeded, providing a huge list of file collisions. I hope that will be fine. ^^

Thanks a lot everyone for your help on this and especially dark_dimius for the hint!
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sat Dec 01, 2012 12:50 am    Post subject: Reply with quote

:roll: This problem is being handled here.
As it's an eclass problem, any workarounds might break other things, once this gets fixed.
Back to top
View user's profile Send private message
verchiel
n00b
n00b


Joined: 25 Nov 2012
Posts: 15

PostPosted: Sat Dec 01, 2012 2:01 am    Post subject: Reply with quote

Thank you VoidMage, I added a link to this thread to the bug report.

My workaround should not result in breakage. You may easily remove it any time you recompile SciPy.
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