Open topic with navigation

TIBCO GridServer® 7.1.0

# The R Driver

The R Driver enables you to write Services in R, and access them from R or from applications in other languages such as Java, C++, or .NET. Applications written in R can also access Services deployed in GridServer.

## Prerequisites

| • | Install and start the TIBCO GridServer® Manager.

| • | Install and start an Engine (Windows or UNIX).

| • | Download and extract the TIBCO GridServer® SDK for Windows or UNIX.

| • | Set the environment variable `DSDRIVER_DIR` to the path of the config directory in the SDK.

| — | For Windows:

`set DSDRIVER_DIR=GRIDSERVERSDK-Windows\config`

| — | For UNIX:

`export DSDRIVER_DIR=GridServerSDK-Linux/config/`

| • | Install TERR 6.0.

| • | Set `TERR_HOME` and `R_HOME` to the `TERR` install folder.

| — | For Windows:

`set TERR_HOME=C:\TIBCO\terr60`

`set R_HOME=C:\TIBCO\terr60`

| — | For UNIX:

`export TERR_HOME=/opt/qa/TIBCO/terr60`

`export R_HOME=/opt/qa/TIBCO/terr60`

| • | Install Ant 1.9 or later and set `ANT_HOME` to the Ant install folder.

| • | Add `%TERR_HOME%\bin` and `%ANT_HOME%\bin` to the system path.

| — | For Windows:

`set PATH=%PATH%;%TERR_HOME%\bin`

`set PATH=%PATH%;%ANT_HOME%\bin`

| — | For UNIX:

`export PATH=$TERR_HOME/bin:$PATH`

`export PATH=$ANT_HOME/bin:$PATH`

- For Windows, add the directory `cppdriver/bin/vc15` to the `PATH` environment variable:

  `set PATH=%PATH%;GridServerSDK-Windows\cppdriver\bin\vc15\x64`

- For UNIX, set the `LD_LIBRARY_PATH` environment variable to include the applicable directory in the lib directory.

  For example, to use GCC3.4 libraries, set the variable to `cppdriver/lib/gcc34`:

  `export LD_LIBRARY_PATH=GridServerSDK-Linux/cppdriver/lib/linux64/gcc34/`

## Installation

| 1. | Run the following command to build and upload Grid libraries:

| — | For Windows, go to `GridServerSDK-Windows/tools/bin` and run `createTERRGL.bat`:

`createTERRGL.bat --terrHome=``%TERR HOME%``--64 --complete`

| — | For UNIX, go to `GridServerSDK-Linux/tools/bin` and run `./createTERRGL.sh`:

`./createTERRGL.sh --terrHome=$TERR_HOME --64 --complete`

| 2. | Install `rdriver` and `rlogger`:

| — | For Windows:

`TERR.exe CMD INSTALL ".\GridServerSDK-Windows\rdriver\rdriver"`

`TERR.exe CMD INSTALL ".\GridServerSDK-Windows\rdriver\rlogger"`

| — | For UNIX:

`$TERR_HOME/bin/TERR CMD INSTALL $SDK/rdriver/rdriver`

`$TERR_HOME/bin/TERR CMD INSTALL $SDK/rdriver/rlogger`

| 3. | Change directories to

| — | For Windows:

`GridServerSDK-Windows/examples/service/r/pscl`

| — | For UNIX:

`GridServerSDK-Linux/examples/service/r/pscl`

| 4. | Modify the `build.xml` to change `/bin/Rscript` to `/bin/TERRscript`.

| 5. | Edit the `build.properties` in the `pscl` folder. Set the `dsos` property to `Win64`, save the file. Run `ant`. This builds the Win64 version of the `Rextras` and `Rpscl` Grid Libraries.

| 6. | Repeat the step 5 and set the `dsos` value to `linux64`. This builds the Linux64 version of the `Rextras` and `Rpscl` Grid Libraries.

| 7. | Upload the four Grid Libraries, created earlier, (two `Rextras` and two `Rpscl`) to the Manager and deploy them. Deploy the Rextras first, then Rpscl.

| 8. | Change directories to

| — | For Windows:

`GridServerSDK-Windows/examples/service/r/picalculator`

| — | For UNIX:

`GridServerSDK-Linux/examples/service/r/picalculator`

| 9. | Run `ant` to build and deploy the `Rcalculator` Grid Library.

| 10. | Run `runTERR.bat`. (This is only for Windows.)

| 11. | Edit Service Type registry`RPICalculatorExample` on the UI and select `functionInterface` as `UNWRAP_RETURN`.

| 12. | For Windows, run `runJava.bat` and for UNIX, run `runJava.sh`.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO GridServer®

Copyright © 2001-2022. TIBCO Software Inc. All Rights Reserved.