R libraries in non-standard locations

I prefer to use Knime on a linux machine that is located in a data center that has direct access to large data sets that I work with. Some of the software libraries I use on this linux machine is installed in non-standard path locations. Adding these non-standard library locations to a user’s environment variables is normally handled by using the Environment Modules (http://modules.sourceforge.net). For example when I use R from the command line (R_Root/bin/R) it has access to necessary libraries like X11 and png that are added using the ‘modules load’ function.

When using R with Knime I set the R path in the Knime preferences to the R_Root/lib64/R/ directory, but the necessary library environment variables do not seem to be inherited by Knime and running an R script results in a failure.

My question: Is there a way to configure Knime to use the libraries necessary for R when they are stored in non-standard locations?

Can you provide an example of the error you are receiving when running the R nodes from within KNIME AP?

The Modules program is not something we have come across in other support cases, so there may be a solution involving that project, TBD.

One option that has been used for other customer when R needs to find external libraries is setting the LD_LIBRARY_PATH variable, and assigning it the values of the directories where theses libraries exist. For example /usr/local/lib sometimes isn’t included, so specifying this location via LD_LIBRARY_PATH allows R to load it when launched by KNIME.

1 Like

Thanks for your response.

To simplify matters I am using a R Source (Table) node.
If I select Configure the node opens with no error.
If I attempt to load a single R package: library(ggplot2). I get the following:

ERROR: Could not execute internal command.ERROR: R evaluation failed.: "options(device='png')
png("/tmp/knime_test52084/rtmp-dialog-52087/rsnippet-plot.png",width=400.0,height=300.0)"ERROR: R evaluation failed.: "options(device='png')
png("/tmp/knime_test52084/rtmp-dialog-52087/rsnippet-plot.png",width=400.0,height=300.0)"ERROR: eval failed, request status: error code: 127> library(ggplot2)
ERROR: Could not execute internal command.ERROR: R evaluation failed.: "dev.off()"ERROR: R evaluation failed.: "dev.off()"ERROR: eval failed, request status: error code: 127

Also, I did add some library paths to my LD_LIBRARY_PATH variable . I then used the Extract System Properties to see if these are inherited by Knime, but they don’t appear in this nodes output. I understand that this node may not be reporting all libraries that Knime has access to.