Contents

Purpose

The purpose of this page is to give you step-by-step instructions to compile and install RKWard from sources.

Note: These are generic instructions, which should work on most systems. However, for many systems, more detailed instructions, or even ready-made binary packages are available. See Binaries_and_Build_Scripts.

Building RKWard

Requirements

The names of the required packages differ from distribution to distribution. Some are called "kdelibs4", some "libkde4", on Debian and Ubuntu the name is "kdelibs5". For the headers you will generally need packages called "kdelibs4-dev", "libkde4-devel" or similar.

Compilation

IMPORTANT: You will need to have the R shared library installed. This is typically located in a place like /usr/lib/R/lib/libR.so. Unfortunately, some distributions do not yet ship their R binary with the shared library. In those (rare) cases, you'll have to compile and install R on your own with the option --enable-R-shlib.

Suppose the source is obtained as (here rkward-0.5.3.tar.gz is used as an example, change it accordingly):

Path to sources

The cmake command needs to know the path to rkward sources. Typically this where the CMakeLists.txt file exists. Since, in the example above, the build directory was created inside the extracted source directory, CMakeLists.txt exists in the directory immediately above; hence '..' is the appropriate path.

CMake options (configuring)

The cmake command offers a number of parameters to control the build process. Some commonly needed are:

-DCMAKE_INSTALL_PREFIX

set the installation base directory. Generally -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` should be correct.

If you set the prefix to /usr/local (the default if you don't pass -DCMAKE_INSTALL_PREFIX), you will probably need to add this directory to the KDEDIRS environment variable: export KDEDIRS="/usr/local:$KDEDIRS" (you may want to add this line to your ~/.bashrc to avoid running it on every login)

-DCMAKE_BUILD_TYPE

type of build. Useful settings include -DCMAKE_BUILD_TYPE=Release and -DCMAKE_BUILD_TYPE=debugfull

In some cases you may want to set the following options:

-DR_EXECUTABLE

path to the R executable. You may want to set this, if you have multiple versions of R installed, or R is not in your path. Example: -DR_EXECUTABLE=/usr/bin/R

-DR_LIBDIR

directory where R packages should be installed. This option is mainly of interest to packagers.

When installing as a normal user (i.e., w/o root access), this needs to be explicitely specified. Generally this is the R_LIBS_USER variable from the Renviron file which can be identified from withing R using:

For example, on a i386 Debian with R 2.9, ~/R/i486-pc-linux-gnu-library/2.9 is the default. Create the directory manually, if it doesn't exist: mkdir -p ~/R/i486-pc-linux-gnu-library/2.9 . Then, using -DR_LIBDIR=$HOME/R/i486-pc-linux-gnu-library/2.9 should work.