Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143396 - dev-python/rpy emerge fails on lapack linking
Summary: dev-python/rpy emerge fails on lapack linking
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Sébastien Fabbro (RETIRED)
URL:
Whiteboard:
Keywords:
: 210706 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-09 15:22 UTC by Aarre Laakso
Modified: 2008-02-26 20:07 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed patch to fix lapack linking issue (rpy-0.99.2-lapack.patch,503 bytes, patch)
2007-04-27 20:02 UTC, Markus Dittrich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aarre Laakso 2006-08-09 15:22:19 UTC
laakshmi bin # emerge --info
Portage 2.1-r1 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-gentoo-r4 i686)
=================================================================
System uname: 2.6.17-gentoo-r4 i686 AMD Athlon(tm) processor
Gentoo Base System version 1.6.15
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O3 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=athlon-tbird -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac aim alsa apache2 apm arts avi bash-completion berkdb bitmap-fonts blas bzip2 canna cdparanoia cdr cjk cli crypt cups curl dlloader dri dv eds emacs emacs-w3 emboss encode esd examples exif ffmpeg fftw flac font foomaticdb fortran gd gdbm gif gnome gnuplot gpm graphviz gs gstreamer gtk gtk2 imagemagick imap imlib isdnlog java javascript jbig jpeg jpeg2k kde lapack leim libg++ libwww lm_sensors mad maildir mbox mikmod mmx motif mozilla mp3 mpeg msn mule mysql mysqli ncurses nls nptl offensive ofx ogg opengl oss pam pcre pdf pdflib perl php plotutils png pppd python qt qt3 qt4 quicktime readline reflection samba sasl sdl session spell spl ssl svg symlink tcltk tcpd tetex tidy tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis win32codecs wmf wxwindows xemacs xml xmms xorg xv xvid yahoo zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux userland_GNU video_cards_nvidia video_cards_vesa video_cards_fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

laakshmi bin # which R
/usr/bin/R
laakshmi bin # R --version
R version 2.3.1 (2006-06-01)
Copyright (C) 2006 R Development Core Team

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License.  For more information about
these matters, see http://www.gnu.org/copyleft/gpl.html.

laakshmi bin # emerge rpy
Calculating dependencies... done!
>>> Emerging (1 of 1) dev-python/rpy-0.99.2 to /
>>> checking ebuild checksums ;-)
>>> checking auxfile checksums ;-)
>>> checking miscfile checksums ;-)
>>> checking rpy-0.99.2.tar.gz ;-)
f>>> Unpacking source...
>>> Unpacking rpy-0.99.2.tar.gz to /var/tmp/portage/rpy-0.99.2/work
 * Applying rpy-0.99.2-version-detect.patch ...                                                                                    [ ok ]
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/rpy-0.99.2/work/rpy-0.99.2 ...
RHOMES= []
Setting RHOMES to  ['/usr/lib/R']
### Using R verion 2.3.1 installed at /usr/lib/R ###
RHOME= /usr/lib/R
copying src/rpymodule.c -> src/rpymodule2031.c
copying src/R_eval.c -> src/R_eval2031.c
copying src/io.c -> src/io2031.c
running build
running build_py
creating build
creating build/lib.linux-i686-2.4
copying rpy.py -> build/lib.linux-i686-2.4
copying rpy_io.py -> build/lib.linux-i686-2.4
copying rpy_version.py -> build/lib.linux-i686-2.4
copying rpy_tools.py -> build/lib.linux-i686-2.4
copying rpy_options.py -> build/lib.linux-i686-2.4
copying rpy_wintools.py -> build/lib.linux-i686-2.4
running build_ext
building '_rpy2031' extension
creating build/temp.linux-i686-2.4
creating build/temp.linux-i686-2.4/src
i686-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -march=athlon-tbird -O3 -pipe -fPIC -DWITH_NUMERIC -DRPY_SHNAME="_rpy2031" -DINIT_RPY=init_rpy2031 -UPRE_2_2 -I/usr/lib/R/include -Isrc -I/usr/include/python2.4 -c src/rpymodule2031.c -o build/temp.linux-i686-2.4/src/rpymodule2031.o -shared
i686-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -march=athlon-tbird -O3 -pipe -fPIC -DWITH_NUMERIC -DRPY_SHNAME="_rpy2031" -DINIT_RPY=init_rpy2031 -UPRE_2_2 -I/usr/lib/R/include -Isrc -I/usr/include/python2.4 -c src/R_eval2031.c -o build/temp.linux-i686-2.4/src/R_eval2031.o -shared
/usr/include/python2.4/Numeric/arrayobject.h:287: warning: 'PyArray_API' defined but not used
i686-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -march=athlon-tbird -O3 -pipe -fPIC -DWITH_NUMERIC -DRPY_SHNAME="_rpy2031" -DINIT_RPY=init_rpy2031 -UPRE_2_2 -I/usr/lib/R/include -Isrc -I/usr/include/python2.4 -c src/io2031.c -o build/temp.linux-i686-2.4/src/io2031.o -shared
/usr/include/python2.4/Numeric/arrayobject.h:287: warning: 'PyArray_API' defined but not used
i686-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -march=athlon-tbird -O3 -pipe -fPIC -DWITH_NUMERIC -DRPY_SHNAME="_rpy2031" -DINIT_RPY=init_rpy2031 -UPRE_2_2 -I/usr/lib/R/include -Isrc -I/usr/include/python2.4 -c src/setenv.c -o build/temp.linux-i686-2.4/src/setenv.o -shared
i686-pc-linux-gnu-gcc -pthread -shared -march=athlon-tbird -O3 -pipe build/temp.linux-i686-2.4/src/rpymodule2031.o build/temp.linux-i686-2.4/src/R_eval2031.o build/temp.linux-i686-2.4/src/io2031.o build/temp.linux-i686-2.4/src/setenv.o -L/usr/lib/R/bin -L/usr/lib/R/lib -LC -L\MinGW\lib;C -L\WinNT\System32;C -L\Windows\System32 -R/usr/lib/R/bin -R/usr/lib/R/lib -lR -lRlapack -o build/lib.linux-i686-2.4/_rpy2031.so
i686-pc-linux-gnu-gcc: unrecognized option `-R/usr/lib/R/bin'
i686-pc-linux-gnu-gcc: unrecognized option `-R/usr/lib/R/lib'
/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lRlapack
collect2: ld returned 1 exit status
error: command 'i686-pc-linux-gnu-gcc' failed with exit status 1

!!! ERROR: dev-python/rpy-0.99.2 failed.
Call stack:
  ebuild.sh, line 1539:   Called dyn_compile
  ebuild.sh, line 939:   Called src_compile
  ebuild.sh, line 1248:   Called distutils_src_compile
  distutils.eclass, line 38:   Called die

!!! compilation failed
!!! If you need support, post the topmost build error, and the call stack if relevant.

laakshmi bin #
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2006-08-10 15:25:52 UTC
I can't quite see why it is failing for you. It seem to me that you might have /usr/lib/R/lib/libRlapack.so missing? That should be there because you have lapack in your USE flags when you merged dev-lang/R
Comment 2 Aarre Laakso 2006-08-11 06:59:44 UTC
(In reply to comment #1)

There was no libRlapack.so on my system, even after un-merging and re-merging R. I also downloaded R 2.3.1 source and built it in a sandbox. Again, no libRlapack.so. I did, however, find a file /usr/lib/R/modules/lapack.so, and the following commands allowed me to emerge Rpy successfully:

laakshmi # ln -sf /usr/lib/R/modules/lapack.so /usr/lib/libRlapack.so
laakshmi # ln -sf /usr/lib/R/modules/lapack.so /usr/local/lib/libRlapack.so
laakshmi # emerge -va rpy

Perhaps upstream has changed the name of their shared library file?

> I can't quite see why it is failing for you. It seem to me that you might have
> /usr/lib/R/lib/libRlapack.so missing? That should be there because you have
> lapack in your USE flags when you merged dev-lang/R
> 

Comment 3 Alastair Tse (RETIRED) gentoo-dev 2006-08-11 10:20:10 UTC
this is pretty odd:

liquidx@qoo ~ $ equery belongs /usr/lib/R/lib/libRlapack.so
[ Searching for file(s) /usr/lib/R/lib/libRlapack.so in *... ]
dev-lang/R-2.3.1 (/usr/lib/R/lib/libRlapack.so)

liquidx@qoo ~ $ eaudit -us | grep dev-lang/R
W dev-lang/R 2.3.1 X jpeg lapack nls png readline -blas -debug -tcltk

those are the USE flags that i'm using.

do you have this in your /usr/lib/R/etc/Makeconf?

LAPACK_LIBS = -L$(R_HOME)/lib$(R_ARCH) -lRlapack

Comment 4 Kazuo Teramoto 2006-10-07 09:35:49 UTC
Same for me with R verion 2.4.0 the lapack lib is in /usr/lib64/R/modules/lapack.so
Comment 5 Mark Fenner 2007-03-20 16:47:23 UTC
Check out this discussion:

https://stat.ethz.ch/pipermail/r-sig-mac/2005-September/002275.html

I have other blas/lapack installed on my system which R uses and which rpy should use.  In particular, the better way for me to get rpy to compile is to:

--- setup.py   2005-09-28 17:49:55.000000000 -0400
+++ setup.py.new    2005-09-28 17:50:06.000000000 -0400
@@ -109,7 +109,7 @@
     else: # unix-like systems, this is known to work for Linux and Solaris
          include_dirs = [ os.path.join(RHOME.strip(), 'include'),
                           'src' ]
-        libraries=['R','Rlapack']
+        libraries=['R']
         library_dirs= r_libs
         runtime_libs = r_libs
         extra_compile_args=["-shared"]
         source_files = source_files + ["src/setenv.c"]
Comment 6 Markus Dittrich (RETIRED) gentoo-dev 2007-04-27 20:01:21 UTC
From looking at it briefly, it also seems to me that rpy should
get its own lapack useflag and link against the external lapack
library just like R itself. I'll post a patch below that does this
and works fine for me.

Best,
Markus
Comment 7 Markus Dittrich (RETIRED) gentoo-dev 2007-04-27 20:02:58 UTC
Created attachment 117442 [details, diff]
proposed patch to fix lapack linking issue

I forgot to mention that rpy-0.4.6 suffers from the same problem and
should be fixed as well.

Markus
Comment 8 Jukka Ruohonen 2007-06-29 16:04:30 UTC
Markus,

I inform that the patch you submitted works well for 0.99.2. Without it, the build fails at least on two of x86_64 machines.

Any chance this could be merged into the tree, as we have had a broken ebuild in the tree for two months now?

Thank you,

Jukka R.
Comment 9 Markus Dittrich (RETIRED) gentoo-dev 2007-06-30 12:20:22 UTC
Hi Jukka,

Thanks for the reminder.

Python folks, would you like me to apply this patch to the 
ebuild? rpy should be built against an external lapack library
instead of R's own (apparantly broken) version.

Thanks,
Markus
Comment 10 Dirkjan Ochtman (RETIRED) gentoo-dev 2007-09-12 06:54:13 UTC
I've committed an ebuild for rpy-1.0-RC3 to the sunrise overlay, which uses the proposed fix.

You can find it at:
http://overlays.gentoo.org/svn/proj/sunrise/reviewed/dev-python/rpy
Comment 11 Ali Polatel (RETIRED) gentoo-dev 2007-09-27 07:40:12 UTC
rpy-0.99-r1 fixes lapack linking issue. Sorry for the delay.
About rpy-1.0_RC3, I think it's a good idea to wait for 1.0 for sometime.
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2008-02-19 16:28:18 UTC
*** Bug 210706 has been marked as a duplicate of this bug. ***
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2008-02-19 16:29:24 UTC
Broken again due to the following commit.

*rpy-1.0.1 (17 Jan 2008)

  17 Jan 2008; Sébastien Fabbro <bicatali@gentoo.org>
  +files/rpy-lapack.patch, +files/rpy-testfiles.patch, metadata.xml,
  +rpy-1.0.1.ebuild:
  Version bump, added a test function, doc flag. lapack is not needed anymore
  because it links with the R module lapack, which always exists with R
  (system libs or internal). Added sci as herd maintainers and a
  longdescription
Comment 14 Sébastien Fabbro (RETIRED) gentoo-dev 2008-02-26 20:07:39 UTC
fixed in cvs. thanks.