Cannot build rpy2 on pypy3

Issue #427 new
Maciek Brynski
created an issue
mbrynski@jupyter:/tmp/pypy3-v5.8.0-linux64/rpy2$ hg log | head
changeset:   3309:fba649f473c4
branch:      version_2.9.x
tag:         tip
parent:      3299:b3b57690b329
user:        Laurent Gautier <lgautier@gmail.com>
date:        Sun Sep 10 17:55:03 2017 -0400
summary:     Update version for tidyr

mbrynski@jupyter:/tmp/pypy3-v5.8.0-linux64/rpy2$ ../bin/pypy3 setup.py install

...

building 'r_utils' library
running install_lib
running build_py
running build_ext
building 'rpy2.rinterface._rinterface' extension
cc -pthread -DNDEBUG -O2 -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/usr/share/R/include -I/tmp/pypy3-v5.8.0-linux64/include -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-3.5/./rpy/rinterface/_rinterface.o
In file included from ./rpy/rinterface/_rinterface.c:114:0:
./rpy/rinterface/na_values.c: In function ‘NAInteger_tp_new’:
./rpy/rinterface/na_values.c:217:11: error: ‘PyLongObject’ has no member named ‘ob_digit’
       self->ob_digit[i] = ((PyLongObject *)py_value)->ob_digit[i];
           ^
./rpy/rinterface/na_values.c:217:53: error: ‘PyLongObject’ has no member named ‘ob_digit’
       self->ob_digit[i] = ((PyLongObject *)py_value)->ob_digit[i];
                                                     ^
./rpy/rinterface/_rinterface.c: In function ‘Sexp_rcall’:
./rpy/rinterface/_rinterface.c:1719:21: warning: assignment from incompatible pointer type [enabled by default]
       argNameString = Rf_mkCharCE(PyBytes_AsString(pybytes), CE_UTF8);
                     ^
./rpy/rinterface/_rinterface.c:1720:7: warning: passing argument 1 of ‘Rf_installChar’ from incompatible pointer type [enabled by default]
       SET_TAG(c_R, installChar(argNameString));
       ^
In file included from ./rpy/rinterface/_rinterface.h:9:0,
                 from ./rpy/rinterface/_rinterface.c:52:
/usr/share/R/include/Rinternals.h:808:6: note: expected ‘SEXP’ but argument is of type ‘const char *’
 SEXP Rf_installChar(SEXP);
      ^
error: command 'cc' failed with exit status 1

Comments (10)

  1. Maciek Brynski reporter

    New error :)

    cc -pthread -shared build/temp.linux-x86_64-3.5/./rpy/rinterface/_rinterface.o -L/usr/lib/R/lib -Lbuild/temp.linux-x86_64-3.5 -R/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -lr_utils -o build/lib.linux-x86_64-3.5/rpy2/rinterface/_rinterface.pypy3-58-x86_64-linux-gnu.so -Wl,--export-dynamic -fopenmp
    cc: error: unrecognized command line option ‘-R’
    error: command 'cc' failed with exit status 1
    
  2. Laurent Gautier

    Did you copy/paste the line and dropped part of it on the way ?

    On CPython, the corresponding line is looking like:

    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.5-7CCmgg/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/./rpy/rinterface/_rinterface.o -L/usr/local/lib -L/usr/local/packages/R/3.4/lib/R/lib -Lbuild/temp.linux-x86_64-3.5 -Wl,--enable-new-dtags,-R/usr/local/lib -Wl,--enable-new-dtags,-R/usr/local/packages/R/3.4/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n -lr_utils -o build/lib.linux-x86_64-3.5/rpy2/rinterface/_rinterface.cpython-35m-x86_64-linux-gnu.so -Wl,--export-dynamic -fopenmp
    
  3. Maciek Brynski reporter

    I think thats all

    running build_ext
    building 'rpy2.rinterface._rinterface' extension
    cc -pthread -DNDEBUG -O2 -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/usr/share/R/include -I/tmp/pypy3-v5.8.0-linux64/include -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-3.5/./rpy/rinterface/_rinterface.o
    In file included from ./rpy/rinterface/_rinterface.c:114:0:
    ./rpy/rinterface/na_values.c: In function ‘NAInteger_tp_new’:
    ./rpy/rinterface/na_values.c:208:10: warning: assignment from incompatible pointer type [enabled by default]
         self = PyLong_FromLong((long)(NA_INTEGER));
              ^
    ./rpy/rinterface/_rinterface.c: In function ‘Sexp_rcall’:
    ./rpy/rinterface/_rinterface.c:1719:21: warning: assignment from incompatible pointer type [enabled by default]
           argNameString = Rf_mkCharCE(PyBytes_AsString(pybytes), CE_UTF8);
                         ^
    ./rpy/rinterface/_rinterface.c:1720:7: warning: passing argument 1 of ‘Rf_installChar’ from incompatible pointer type [enabled by default]
           SET_TAG(c_R, installChar(argNameString));
           ^
    In file included from ./rpy/rinterface/_rinterface.h:9:0,
                     from ./rpy/rinterface/_rinterface.c:52:
    /usr/share/R/include/Rinternals.h:808:6: note: expected ‘SEXP’ but argument is of type ‘const char *’
     SEXP Rf_installChar(SEXP);
          ^
    ./rpy/rinterface/_rinterface.c: In function ‘newSEXP’:
    ./rpy/rinterface/_rinterface.c:2917:29: warning: comparison between pointer and integer [enabled by default]
           if (item_tmp && (item != NA_INTEGER)) {
                                 ^
    cc -pthread -shared build/temp.linux-x86_64-3.5/./rpy/rinterface/_rinterface.o -L/usr/lib/R/lib -Lbuild/temp.linux-x86_64-3.5 -R/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -lr_utils -o build/lib.linux-x86_64-3.5/rpy2/rinterface/_rinterface.pypy3-58-x86_64-linux-gnu.so -Wl,--export-dynamic -fopenmp
    cc: error: unrecognized command line option ‘-R’
    error: command 'cc' failed with exit status 1
    
  4. Maciek Brynski reporter

    Sorry for late answer.

    [root@ip-10-0-0-51 rpy2]# gcc --version
    gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    [root@ip-10-0-0-51 rpy2]# R CMD config --ldflags
    -Wl,--export-dynamic -fopenmp -Wl,-z,relro -L/usr/lib64/R/lib -lR -ltre -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n
    
  5. Log in to comment