Skip to content

[Rcpp-devel] RInside and MinGW (Windows)

7 messages · Dirk Eddelbuettel, Jose Quesada

#
Hello,

I am trying to build an application that uses RInside on Windows
and I get linking problems (undefined references to RInside).
The application builds and links fine on Linux and MAC.

I tried to link against both libRinside.a and libRinside.dll. The linking
paths are correct and I am also linking against R, blas and lapack (DLLs
though).
In my installation of R 3.4 in Windows I only see DLLs for R, blas and
lapack.
Am I supposed to build R myself so to obtain the .lib or .a files?

I use CMake and I used the examples on the RInside repository as a
reference.
I am trying to build it with MinGW32 (Windows 10).

Has anybody used RInside in Windows? Am I missing something? Thanks for the
help.

Best,
Jose
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20171127/866fb75a/attachment.html>
#
On 27 November 2017 at 14:28, Jose wrote:
| Hello,
| 
| I am trying to build an application that uses RInside on Windows
| and I get linking problems (undefined references to RInside).
| The application builds and links fine on Linux and MAC.
| 
| I tried to link against both libRinside.a and libRinside.dll. The linking
| paths are correct and I am also linking against R, blas and lapack (DLLs
| though).
| In my installation of R 3.4 in Windows I only see DLLs for R, blas and
| lapack.
| Am I supposed to build R myself so to obtain the .lib or .a files?
| 
| I use CMake and I used the examples on the RInside repository as a
| reference.
| I am trying to build it with MinGW32 (Windows 10).
| 
| Has anybody used RInside in Windows? Am I missing something? Thanks for the
| help.

Yes of course. See the CRAN checks.

The key point, of course, is that _you need Rtools_ and not any random MinGW
compiler you may have.  Sort your ${PATH} accordingly and everyhting should work.

Dirk
 
| Best,
| Jose
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
#
Hi Dirk,

Thanks for your email.

I forgot to mention that I am using Rtool's MinGW and the PATH variable
includes C:\Rtools\bin and C:\Rtools\mingw_32\bin.
Also, I had to copy some dlls from the original MinGW (which is the one
that I had before)
in order to be able to compile with the Rtool's MinGW. The original MinGW
is not
included in the PATH variable. I am not sure if both MinGWs are the same
version
or how to check that if that actually matters.

Best,
Jose





2017-11-27 16:02 GMT+01:00 Dirk Eddelbuettel <edd at debian.org>:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20171127/7f9af583/attachment.html>
#
On 27 November 2017 at 17:22, Jose wrote:
| Hi Dirk,
| 
| Thanks for your email.
| 
| I forgot to mention that I am using Rtool's MinGW and the PATH variable
| includes C:\Rtools\bin and C:\Rtools\mingw_32\bin.
| Also, I had to copy some dlls from the original MinGW (which is the one
| that I had before)
| in order to be able to compile with the Rtool's MinGW. The original MinGW
| is not
| included in the PATH variable. I am not sure if both MinGWs are the same
| version
| or how to check that if that actually matters.

I have built RInside on Windows in the past. Including all the way down to
building the Qt examples (which at the time required building Qt locally with
Rtools).

I have not done so in quite some time as I don't work much on Windows.  There
is no reason to believe it would no longer work -- RInside is on CRAN, and is
being tested on the usual three (or four) operating systems:

https://cloud.r-project.org/web/checks/check_results_RInside.html

Dirk
#
I had no reason to believe it would not work neither.
I was able to make it work. I re-installed R and RTools
from the scratch and cleaned up the project. So, I am not sure
what I was missing really. One thing though, I am fine linking just
against the DDLs and I need to have a variable R_HOME pointing
to the R root in order to be able to run the app. It works smoothly in
Windows
all the R related code.

Thanks for all the help.

Best,
Jose

2017-11-27 17:48 GMT+01:00 Dirk Eddelbuettel <edd at debian.org>:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20171128/723c15dd/attachment.html>
#
On 28 November 2017 at 16:03, Jose wrote:
| I had no reason to believe it would not work neither.
| I was able to make it work. I re-installed R and RTools
| from the scratch and cleaned up the project. So, I am not sure
| what I was missing really. One thing though, I am fine linking just
| against the DDLs and I need to have a variable R_HOME pointing
| to the R root in order to be able to run the app. It works smoothly in
| Windows
| all the R related code.

We can always do with better/newer/updated/current HOWTOs and walk-through.
Maybe you can start with a blog post or step-by-step guide.

And yes, last time I tried I also needed to physically copy some DLLs which
seems distateful.  But I may well be missing another Windows trick ...

| Thanks for all the help.

Thank you for persisting, and reporting success back here to the list.

Dirk
#
We can always do with better/newer/updated/current HOWTOs and walk-through.
Maybe you can start with a blog post or step-by-step guide.

I totally agree, unfortunately I never got around starting a blog which is
bad
because I have struggled with some interesting problems that could be worth
sharing.
(at least I have added this info in the manual of my tool).

And yes, last time I tried I also needed to physically copy some DLLs which
seems distateful.  But I may well be missing another Windows trick ...

The DDLs are needed in run time. I didn't need them to build the tool the
second time.
I believe something was messed up with the two different MinGW versions.

| Thanks for all the help.

Thank you for persisting, and reporting success back here to the list.

Best,
Jose

2017-11-28 16:16 GMT+01:00 Dirk Eddelbuettel <edd at debian.org>:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20171128/26e21a9c/attachment.html>