Product: TIBCO Spotfire®
Configuration of a TSSS instance on a Linux machine to use open-source R as its statistical engine.
TIBCO Spotfire Statistics Services (TSSS) installs with TIBCO Enterprise Runtime for R (TERR) as its default statistical engine. Additional configuration steps are required, if you wish to use an open-source R engine with TIBCO Spotfire Statistics Services (TSSS).
This article summarizes the steps to be followed for configuring a TSSS instance on a Linux machine to use open-source R as its statistical engine. It is assumed that a fully tested standalone TSSS instance (with TERR engine) is already available, and that the Linux server has internet access to the open-source R community's CRAN repository.
Note: each TSSS instance can only be configured to use one type of statistical engine (such as TERR or open-source R) at a time.
- Using a text editor, open the spserver.properties file from the location "<SPSERVER_HOME>/conf". (Here <SPSERVER_HOME> is the location where this TSSS instance is installed.)
- Set the following property:
engine.type=R
- Save and close the file.
- Now download the source file (*.tar.gz) for a compatible version of open-source R for Linux, from the open-source R community's CRAN repository (https://cran.r-project.org/). The version of open-source R compatible with this TSSS instance can be identified by opening a TERR Console session using its built-in TERR engine, then running this command in the TERR Console session:
getRversion()
This information is also available on the TSSS system requirements page.
- The downloaded file will be in zipped source-code form (e.g. "R-3.2.1.tar.gz", where 3.2.1 is the R version). On the server this TSSS instance is installed on, unzip and extract the source code with the following Linux shell command (adapted to use the name of the *.tar.gz file you downloaded, in place of the "R-3.2.1.tar.gz" example shown here):
tar -xvf R-3.2.1.tar.gz
- Now the extracted R source code needs to be compiled. Browse or cd to the extracted R directory and run the following Linux shell commands in sequence to compile the R source code:
./configure --enable-R-shlib --with-readline=no --with-x=no
make
make install
- These commands, in the same order, will configure, build and then install open-source R on the machine. A bin folder should now be available in the R directory. This bin folder will contain the R console executable.
- The next step is to install the rJava package in this open-source R instance. Before proceeding with this step, it must be verified that the Java environment for R is properly configured in the Linux environment. Most Linux operating systems come with a pre-installed OpenJDK package, but it might not be suitable for configuration of the rJava package. A better approach is to install the tested version of Java for R that is listed on the system requirements page for the TSSS version you have installed (see http://support.spotfire.com/sr.asp or https://docs.tibco.com).
- To make sure R is configured with full Java support (including the JDK), run the following Linux shell command as root to add Java support to R:
R CMD javareconf
This command will set all the Java related variables. Now we are ready to install the rJava package.
- Go to <R_installation_directory>/bin and launch an R Console session, by executing the following Linux shell command:
./R
- In the open-source R Console session, type the following command:
install.packages("rJava", install_path)
where install_path is the library path where open-source R running under Spotfire Statistics Services expects to find it. If you do not supply a path for this argument, you might encounter problems using rJava.
- Select a CRAN mirror, then wait while open-source R installs the rJava package directly from that CRAN mirror.
>> An important thing to note here is a change introduced in rJava version 0.9.9 (released in October, 2017) or later that causes TSSS to fail on Linux. So to install rJava version 0.9.9 or later, the below additional steps are to be performed:
1. Using a text editor, open the configuration file <SPSERVER_HOME>/init.d/spserver
2. Find the entry export CATALINE_OPTS
3. Immediately after this line, add the following two lines of code:
RJAVA_JVM_STACK_WORKAROUND=0
export RJAVA_JVM_STACK_WORKAROUND
4. Save and close the configuration file.
>> Alternatively, rJava version 0.9.8 can be used with no configuration. The older package version can be downloaded from the CRAN archive for that package.
- Add the path to the open-source R installation in the configuration file. Open the configuration file <SPSERVER_HOME>/init.d/spserver and set the property SPSERVER_RHOME=path-to-R.
- Restart Spotfire Statistics Services as a Linux service, by issuing the following Linux shell command:
<SPSERVER_HOME>/init.d/spserver restart
- The service should restart and be ready for use with the open-source R engine.
Note: Open-source R is available under separate open source software license terms and is not part of TERR. As such, open-source R is not within the scope of your license for TERR. Open-source R is not supported, maintained, or warranted in any way by TIBCO Software Inc. Download and use of open-source R is solely at your own discretion and subject to the free open source license terms applicable to open-source R.
https://stackoverflow.com/questions/50016291/how-to-set-java-headers-gen-for-r-to-install-rjava
https://linuxtechlab.com/install-java-9-linux/
https://docs.tibco.com/pub/sf_statsvcs/7.5.0/doc/html/TIB_sf_statsvcs_7.5.0_installation/GUID-C21FE2C3-0225-412F-8DFA-92F549CD867C.html
https://robots.thoughtbot.com/the-magic-behind-configure-make-make-install
Comments
0 comments
Article is closed for comments.