Building RKWard from Source

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. For building on Windows, see RKWard_on_Windows/Packaging.

Note: For instructions on compiling the KDE 4 versions of RKWard (before RKWard 0.7.0), please refer to an older version of this page.

Getting the source code

Refer to Available source packages or Getting the source from git.

Installing required dependencies

RKWard requires:

If you can’t find the required packages for your distribution, take a look at Binaries_and_Build_Scripts for distribution specific information, or contact us for help.

On Debian based systems (such as Ubuntu) the following will get all the dependencies installed (and hopefully the package names will be similar on other distributions):

apt-get install libkf5webkit-dev libkf5texteditor-dev kdoctools-dev r-base-dev cmake extra-cmake-modules

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 rkward-0.7.2.tar.gz (here, version 0.7.2 is used as an example, change it accordingly). Then, the recommended steps to build from source are:

tar xzf rkward-0.7.2.tar.gz    # extracts to "rkward-0.7.0" directory
cd rkward-0.7.2
mkdir build                    # dedicated build directory is recommended, but not required
cd build
cmake .. [options]             # see *CMake options* below
make -j 5                      # the j parameter specifies the number of parallel units to compile;
                               # on systems with many cores, a higher value will speed up the build
sudo make install

CMake options (configuring)

The first paramter to cmake is the path to the rkward sources. 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 in this setup.

A number of parameters may be specified to control the build process. Some commonly needed are:

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

Further generic options are listed on http://www.cmake.org/Wiki/CMake_Useful_Variables .

Installation

As a last step, you have to run make install. Otherwise RKWard will be missing important menu-options, may behave strangely, or may not run at all. As this will require admin permissions, use: sudo make install

Make sure you have set the correct path in cmake (the -DCMAKE_INSTALL_PREFIX option).

Running

For now it’s recommended to run RKWard from the command-line for debug-output. For the few available command-line options see

rkward --help

Troubleshooting

The most common source of problems are

  1. Missing some of the build requirements
  2. Wrong / missing parameters to cmake

So please re-read the corresponding sections, first. If you’re still in trouble, let us know, we’ll be happy to help you.

For some systems, Binaries_and_Build_Scripts has more information.