Discussion:
[Rcpp-devel] RInside and MinGW (Windows)
Jose
2017-11-27 13:28:35 UTC
Permalink
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
Dirk Eddelbuettel
2017-11-27 15:02:53 UTC
Permalink
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-***@lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Jose
2017-11-27 16:22:31 UTC
Permalink
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
Post by Dirk Eddelbuettel
| 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
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
Dirk Eddelbuettel
2017-11-27 16:48:24 UTC
Permalink
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
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Jose
2017-11-28 15:03:12 UTC
Permalink
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
Post by Dirk Eddelbuettel
| 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
https://cloud.r-project.org/web/checks/check_results_RInside.html
Dirk
--
Dirk Eddelbuettel
2017-11-28 15:16:19 UTC
Permalink
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
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Jose
2017-11-28 16:13:02 UTC
Permalink
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
Post by Dirk Eddelbuettel
| 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
--
Loading...