This discussion is archived
11 Replies Latest reply: Sep 14, 2012 4:45 AM by 962179 RSS

ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215

960849 Newbie
Currently Being Moderated
Hi,

I'm able to build and install ROracle for R 32 but not for R 64. My problem seems to be related to the configuration script (configure.win) calling "x86_64-w64-mingw32-dlltool"in the case of the arch 64 build.

Versions Used: ROracle 1.1-4, R version 2.15.0, Rtools 2.15.

Following the install instructions, when running "R CMD INSTALL --build --merge-multiarch ROracle_1.1-4.tar.gz", all goes fine for the 32 bits install (all is working fine thereafter in R 32) but when trying to build the 64 bits version, I get the following error:

"
generating ocimingw.lib from ocimingw.def
x86_64-w64-mingw32-dlltool: not found
...
gcc.exe: error: ocimingw.lib: No such file or directory
ERROR: compilation failed for package 'ROracle'
"

So I tried to add "C:\Rtools\gcc-4.6.3\i686-w64-mingw32\bin" to PATH and rename "dlltool" within it to "x86_64-w64-mingw32-dlltool". But in this case, when trying to compile ROracle.dll file, it is said that the generated "ocimingw.lib" file is not recognized:

"
gcc -m64 -shared -s -static-libgcc -o ROracle.dll tmp.def rodbi.o rooci.o -L. oc
imingw.lib -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg
/extralibs64/local/lib -LC:/Users/.../R/R-215~1.0/bin/x64 -lR
ocimingw.lib: file not recognized: File truncated
collect2: ld returned 1 exit status
ERROR: compilation failed for package 'ROracle'
"

Moreover, in the file "configure.win" inside the package archive, it is said in the commentaries that "# oci.lib generated by 32-bit or 64-bit dlltool works on both versions". And last, the two dlltool.exe files (32 and 64) provided by Rtools 2.15 are exactly the same (I used WinDiff (x64) to check this).

Really disappointing, am I wrong somewhere ? I guess that the real problem may be related to Rtools and the MinGW W64 tools there provided but... ?

Thank you very much in advance.

Best Regards,

Mehdi
  • 1. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    961271 Newbie
    Currently Being Moderated
    I think you will find better advice from R-sig-db mailing list:

    https://stat.ethz.ch/mailman/listinfo/r-sig-db
  • 2. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    Sherry LaMonica Journeyer
    Currently Being Moderated
    You might try using the gcc --verbose flag to see if that reveals the cause of the error.                                                                                                                                                                                   
  • 3. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    339359 Newbie
    Currently Being Moderated
    Mehdi,

    Below we suggest a workaround that should allow you to proceed with building a usable version of ROracle-1.1.4 for 64 bit windows.
    We are working on an update to ROracle that addresses the problem you have found.

    To provide some context to the problem:

    RTools-2.15 has deprecated x86_64-w64-mingw32-dlltool. This tool was present in the previous distribution/versions of RTools.

    We use this tool in ROracle build process to generate a .lib file from OCI dll files. We did the .lib generation solely to try to accommodate
    ROracle into the CRAN windows build environment so we are able to provide ROracle as a binary distribution on windows platforms.
    However this mechanism did not pan out - not for any technical reason but rather due to OCI related licensing reasons. So ROracle continues
    to be a source code only distribution on CRAN for windows.

    We are working on reverting back to using OCI dll files directly, which will remove dependency on x86_64-w64-mingw32-dlltool
    and the latest changed to RTools-2.15 has forced us to make this change more quickly.

    In the meantime, please follow the steps below to work around dependency on x86_64-w64-mingw32-dlltool

    1. Modify Makvars.win in Roracle/src directory to use: "PKG_LIBS=-L. -loci" instead of "PKG_LIBS=-L. ocimingw.lib"
    2. Change configure.win in ROracle as follows:

    Delete the the following lines:

    # generate import library for mingW from ocimingw.def. oci.lib from msvc is

    # not compatible with it.
    # NOTE: If necessary one can use pexports.exe or dumpbin to generate the
    # oci.def file.
    # download pexports.exe and run "pexports ${ROCI_LIB}/oci.dll > ocimingw.def"
    # or run "dumpbin /exports oci.dll"
    #
    # oci.lib generated by 32-bit or 64-bit dlltool works on both versions
    #
    echo "generating ocimingw.lib from ocimingw.def"
    if [ $R_ARCH = '/x64' ]; then
    x86_64-w64-mingw32-dlltool input-def ./src/ocimingw.def  dllname OCI.DLL --output-lib ./src/ocimingw.lib -k
    else
    dlltool input-def ./src/ocimingw.def  dllname OCI.DLL --output-lib ./src/ocimingw.lib -k
    fi

    Add the following in its place:

    #
    # copy OCI libraries
    #
    echo "copying from" ${ROCI_LIB}
    cp ${ROCI_LIB}/oci.dll ./src
    cp ${ROCI_LIB}/orannzsbb11.dll ./src
    cp ${ROCI_LIB}/oraociei11.dll ./src

    Thank you
    ROracle maintainers
  • 4. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    960849 Newbie
    Currently Being Moderated
    Hi,

    Thank you very much for the whole information, the solution works fine !

    Best Regards,

    Mehdi
  • 5. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    960849 Newbie
    Currently Being Moderated
    Sorry, in fact, the installation was succesful but when using R 64 and trying to connect to the db, I get the following (common?) error code:

    Error in .oci.Connect(...) : ORA-12560: TNS:protocol adapter error

    Is it related to the fact that I use Oracle xe (so a 32 bits server). In this case, Instant Client 64 cannot be used ?

    My final goal is to be able to load data in R 64 in particular to take advantage of the greater memory management capabilities.

    Thank you in advance for your help,

    Mehdi
  • 6. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    339359 Newbie
    Currently Being Moderated
    Mehdi,

    What is the connection string used to connect? One can connect from 64-bit client to 32-bit client and vice versa. Connections mechanism to XE is documented at: http://docs.oracle.com/cd/E17781_01/server.112/e18804/connecting.htm#CHDHGDJG

    You can use the EZ connect string with host/port number or something like the following:
    con <- dbConnect(drv,"UID","PWD", "(DESCRIPTION=(ADDRESS= \
    (PROTOCOL=tcp)(HOST=YOUR_HOST)(PORT=1521))(CONNECT_DATA= \
    (SERVICE_NAME=XE)))");

    I am assuming that you used the default parameters to install XE.

    Thanks,
    ROracle Team
  • 7. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    960849 Newbie
    Currently Being Moderated
    Well, with the full command you provided with, it works.

    But I don't understand why the basic command I use works well in R 32 and not in R 64.

    I just typed:

    "drv<-dbDriver("Oracle")
    c_connection<-dbConnect(drv, "**", "****")
    "

    with ** and **** login and password, respectively.

    Again, this basic commands work fine in R 32 but I get the previously mentioned error code in R 64.

    But all is working fine with the full command so thank you very much for your help !

    Best Regards,

    Mehdi
  • 8. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    339359 Newbie
    Currently Being Moderated
    Mehdi,

    Is the connection on 32-bit machine made on the same machine where XE is installed? If so one may not need to use the connect string. Connect string is required for connecting from a remote. Remote machine can use the EZ connect string, connectstring that I specified and worked for you. One can also create an alias in tnsnames.ora and is described in teh NET manual or the link I provided earlier.

    Thanks,
    ROracle Team
  • 9. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    960849 Newbie
    Currently Being Moderated
    Yes, all the cases mentioned are running on the same machine: OS windows 7 64 bits with Oracle 11g xe (so 32 bits), with both 32 / 64 Instant Clients, and with R 2.15.0 32 / 64 using ROracle 1.1-4 package

    This is why it was disturbing, all is running on the same computer and the connection string has to be in a way "more precise" when running R 64.

    Maybe somewhere, the default parameters are not automatically set if nothing is precised, when ROracle "is running under R 64" ? Maybe it is on the side of "Instant Client" ?

    I just replaced "your_host" with "localhost" in the string you provided, and left the default port as it is (and of course with the correct UID and PWD).

    In the case of R32, I just don't have to specify any host nor any port, etc...

    Thank you very much for your help !

    Mehdi
  • 10. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    339359 Newbie
    Currently Being Moderated
    Mehdi,

    32-bit and 64-bit environments are treated as separate ORACLE_HOME installations. If the client and server use the same home then one does not need a connect string because Bequeth/IPC adpater will be used. To connect across different home installations, one must use a connect string.

    Thanks,
    ROracle Team
  • 11. Re: ROracle 1.1-4 install failure for R  64 only: R version 2.15.0, Rtools215
    962179 Newbie
    Currently Being Moderated
    Hi,

    I found a problem of installation for ROracle for R 32. I just solved it following the same steps suggested for the R 64 problem and thought it might be useful to mention.

    My setup is: ROracle 1.1-4, R version 2.15.0, Rtools 2.15. Steps followed:

    1) Downloaded and unzipped oracle instant client (basic, sdk) into c:\instantclient\i386\instantclient_11_2.
    2) Downloaded and installed DBI from within the R GUI.
    3) Downloaded and tried to install ROracle using: R CMD INSTALL --build ROracle_1.1-2.targ.gz

    Compilation goes through, but package installation fails at the step "testing if installed packages can be loaded": the following error box pops up

    "This application failed to start because oci.dll was not found. Re-installing the application may fix this problem."

    then ROracle installation terminates with the error messages

    "
    ** testing if installed package can be loaded
    Error in inDL(x, as.logical(local), as.logical(now), ...) :
    unable to load shared object 'C:/Programmi/R/R-2.15.0/library/ROracle/libs/i38
    6/ROracle.dll':
    LoadLibrary failure: Impossibile trovare il modulo specificato.

    Errore: loading failed
    Esecuzione interrotta
    ERROR: loading failed
    "

    I therefore unpacked the ROracle directory inside the .tar.gz file and applied the suggested changes to the files Makvars.win and configure.win (including copying the OCI libraries). This fixed it. Thank you for your help!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points