build fails in latest release

Issue #234 resolved
idella5 created an issue

Build of rpy-2.5.0 (in gentoo) yielded

./rpy/rinterface/_rinterface.c:785:20: note: gstate was declared here
   PyGILState_STATE gstate;
                    ^
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -march=athlon64 -pipe -fomit-frame-pointer -Wall -O2 -fno-strict-aliasing /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work/rpy2-2.5.0-python2_7/temp.linux-x86_64-2.7/./rpy/rinterface/_rinterface.o -L/usr/lib64 -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -lpython2.7 -o /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work/rpy2-2.5.0-python2_7/lib/rpy2/rinterface/_rinterface.so -Wl,--export-dynamic -fopenmp -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lR
collect2: error: ld returned 1 exit status
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1

On basic investigation we have ascertained that the previous version (rpy-2.4.4) builds fine, the libR.so is there and found by the build of rpy-2.4.4 and is not being picked up in the new release of rpy-2.5.0. It appears subsequent to the revamped setup.py

Comments (14)

  1. Laurent Gautier

    Hi,

    Where is "there" ? (path to libR.so).

    Also, can you include more of the ouput ? (in particular the section where setup.py is printing the environment (CFLAGS, etc) used for the compilation.

  2. idella5 reporter
     * rpy2-2.5.0.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                             [ ok ]
     * checking ebuild checksums ;-) ...                                                                                                                                  [ ok ]
     * checking miscfile checksums ;-) ...                                                                                                                                [ ok ]
    >>> Unpacking source...
    >>> Unpacking rpy2-2.5.0.tar.gz to /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work
    >>> Source unpacked in /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work
    >>> Preparing source in /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work/rpy2-2.5.0 ...
    >>> Source prepared.
    >>> Configuring source in /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work/rpy2-2.5.0 ...
    >>> Source configured.
    >>> Compiling source in /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work/rpy2-2.5.0 ...
    
     * python3_3: running distutils-r1_run_phase python_compile
     * python3_4: running distutils-r1_run_phase python_compile
     * python2_7: running distutils-r1_run_phase python_compile
    /usr/bin/python3.3 setup.py build
    /usr/bin/python3.4 setup.py build
    /usr/bin/python2.7 setup.py build
    R version 3.1.1 (2014-07-10) -- "Sock it to Me"
    /usr/lib64/R/bin/R CMD config --ldflags
    /usr/lib64/R/bin/R CMD config --cppflags
    running build
    running build_py
    

    says much of it I believe.

     ~/cvsPortage/gentoo-x86/dev-python/rpy $ qlist dev-lang/R | grep libR.so
    /usr/lib64/R/lib/libR.so
    

    The build of the prior version finds it, the build of rpy-2.5.0 doesn't.

  3. Laurent Gautier

    I see.

    The printing of information for the compilation was also lost in the rewrite of setup.py.

    Can you try the following and return the lines ~5-9 in the console output:

    pip install https://bitbucket.org/lgautier/rpy2/get/version_2.5.x.tar.gz
    
  4. Laurent Gautier

    Odd that this is coming from rpy2 and not from thr way R in installed on your end.

    An immediate workaround is to have

    LD_LIBRARY_PATH=/usr/lib64/R/lib:${LD_LIBRARY_PATH}
    
  5. idella5 reporter

    But it is. R is just installed. It works fine in the build of 2.4.4 You've lost me. /usr/lib64/R/lib:${LD_LIBRARY_PATH} is hard coding to amd64 and therefore excludes x86. Also I presume you assume I know where and how to place this line. Sorry, I don't.

  6. Laurent Gautier

    Your linker does not know where libR.so is. I don'tbyhink rpy2 ever attempted at making an automatic resolution of this (you suggest that it did, my experience is that it did not - may be it did in your environment ?)

    Possible ways to address it are:

    • tell the linker about /usr/lib64/R/lib
    • link/copy libR.so to a place the linker knows about (presumably /usr/lib64 on one of you systems)
    • use LD_LIBRARY_PATH
  7. idella5 reporter

    (you suggest that it did, my experience is that it did not -

    It works fine in the build of 2.4.4 in which the linker found libR.so in the build.

    I can paste you a log where the linker found it.

    Between the 2 releases, it can no longer be found. The above makes for an effective one off build by editing the linker in the system environment. I'm trying to bump the ebuild to the current release. It need work out of the box and build effectively for any given user.

  8. Laurent Gautier

    I think that I found the issue, and fixed it.

    Can you try again

    pip install https://bitbucket.org/lgautier/rpy2/get/version_2.5.x.tar.gz
    

    ?

  9. idella5 reporter

    With patch

    testuser@archtester ~/cvsPortage/gentoo-x86/dev-python/rpy $ ebuild rpy-2.5.0.ebuild compile
    
    ->
    
    >>> Source compiled.
    

    C'est bon ca (add cedilla). Merci monsieur Gautier

  10. Log in to comment