R integration: Cannot install Rserve

Hello,

Following this instruction to integrate R and Knime, I could not install Rserve on the local R instance.

I am trying to integrate Knime and R on windows 10.

I copied the error as follows:

"C:/rtools40/mingw32/bin/“gcc -I"C:/PROGRA~1/R/R-4.1.2/include” -DNDEBUG -DRSERVE_PKG -DWin32 -I. -Iinclude -Iinclude/Win32 -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c oc.c -o oc.o
oc.c:11:10: fatal error: openssl/rand.h: No such file or directory
#include <openssl/rand.h>
^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-4.1.2/etc/i386/Makeconf:238: oc.o] Error 1
ERROR: compilation failed for package ‘Rserve’

  • removing ‘C:/-----/Rpackages/Rserve’
    Warning in install.packages :
    installation of package ‘Rserve’ had non-zero exit status

@ehsanT what you should do is make sure RServe does run under R / Studio alone and will be started when library(“Rserve”) is called. Then you could tray the integration into KNIME.

In order to do a fresh installation you might try these steps if the ones from the R integration guide would not work. The latest Version 1.8-10 should be available as a Windows binary so there would be no need to compile:

https://CRAN.R-project.org/package=Rserve

For Windows:

install.packages("Rserve", repos = "https://cran.r-project.org", type="win.binary")

If this is not successful you could try and do a installation via the installr package like this:

# install.packages("installr")

library(installr)
install.packages.zip("https://cran.r-project.org/bin/windows/contrib/4.1/Rserve_1.8-10.zip")

or:

install.packages("https://cran.r-project.org/bin/windows/contrib/4.1/Rserve_1.8-10.zip", repos = NULL, type ="win.binary")

You might want to check the latest binary version on the Rserve website:


The same thing for MacOS would look like this:

install.packages("Rserve", repos = "https://cran.r-project.org", type="mac.binary")

Or you could do with the specific package version:

install.packages("https://cran.r-project.org/bin/macosx/contrib/4.1/Rserve_1.8-10.tgz", repos = NULL, type ="mac.binary")

Besides the official guide to R and KNIME integration I try to keep track of several ways and quirks around KNIME and R/RStudio here:

You could check the version and packages of your R installation in KNIME here:

2 Likes

Thank you @mlauber71 . It was fixed by running the first line of code.
:ok_hand:

1 Like