Skip to content

Windows 7 64bit compilation error #2

@grandtiger

Description

@grandtiger

I followed the instruction, but got compilation error on Windows 7 64bit. Has anyone confirmed that rPython works on on 64bit PC with 64bit R? If so, then I must have missed something. Any suggestions on what else I should check?

BTW, I am using Anaconda python 3.4 distribution. My configure.win looks like the following:

#!/bin/sh

echo 'PKG_LIBS=-LC:/Anaconda3/libs -lpython34'  > src/makevars.win
echo 'PKG_CFLAGS=-I"C:/Anaconda3/include"'     >> src/makevars.win

I used RStudio, and here is the commands and outputs:

> library(devtools)
> install("C:/Downloads/rPython")
Installing rPython
"C:/R/R-31~1.2/bin/x64/R" --vanilla CMD INSTALL "C:/Downloads/rPython"  \
  --library="C:/R/R-3.1.2/library" --install-tests 

* installing *source* package 'rPython' ...
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture

gcc -m64 -shared -s -static-libgcc -o rPython.dll tmp.def pycall.o -LC:/Anaconda3/libs -lpython34 -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-31~1.2/bin/x64 -lR
c:/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: i386 architecture of input file `pycall.o' is incompatible with i386:x86-64 output
pycall.o:pycall.c:(.text+0x5): undefined reference to `__imp__Py_Initialize'
pycall.o:pycall.c:(.text+0x1a): undefined reference to `__imp__PyRun_SimpleStringFlags'
pycall.o:pycall.c:(.text+0x31): undefined reference to `__imp__Py_Finalize'
pycall.o:pycall.c:(.text+0x56): undefined reference to `__imp__PyRun_SimpleStringFlags'
pycall.o:pycall.c:(.text+0x8c): undefined reference to `__imp__PyImport_AddModule'
pycall.o:pycall.c:(.text+0x95): undefined reference to `__imp__PyModule_GetDict'
pycall.o:pycall.c:(.text+0xa8): undefined reference to `__imp__PyDict_GetItemString'
pycall.o:pycall.c:(.text+0xbe): undefined reference to `__imp__PyBytes_AsString'
collect2: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'rPython'
* removing 'C:/R/R-3.1.2/library/rPython'
Error: Command failed (1)

Just an update, I tried it on Windows XP 32bit (with Anaconda python 2.7) and the installation was successful. I'll try to run some code and see if everything is working.

> library(devtools)
> install("C:/Downloads/rPython")
Installing rPython
"C:/R/R-31~1.2/bin/i386/R" --vanilla CMD INSTALL "C:/Downloads/rPython"  \
  --library="C:/R/R-3.1.2/library" --install-tests 

* installing *source* package 'rPython' ...
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture

gcc -m32 -I"C:/R/R-31~1.2/include" -DNDEBUG     -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -I"C:/Anaconda/include"   -O3 -Wall  -std=gnu99 -mtune=core2 -c pycall.c -o pycall.o
gcc -m32 -shared -s -static-libgcc -o rPython.dll tmp.def pycall.o -LC:/Anaconda/libs -lpython27 -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-31~1.2/bin/i386 -lR
installing to C:/R/R-3.1.2/library/rPython/libs/i386
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (rPython)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions