Building RKWard From Source

From RKWard
(Difference between revisions)
Jump to: navigation, search
m
(Requirements)
 
(32 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
== Purpose ==
 
== Purpose ==
 
The purpose of this page is to give you step-by-step instructions to compile and install RKWard from sources.
 
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]].
 +
 +
'''Note''': For instructions on compiling the KDE 3 versions of RKWard (before RKWard 0.5.0), please refer to [https://sourceforge.net/apps/mediawiki/rkward/index.php?title=Building_RKWard_From_Source&oldid=1183 an older version of this page].
  
 
== Related pages ==
 
== Related pages ==
 
* [[Download_RKWard|Available source packages]]
 
* [[Download_RKWard|Available source packages]]
 
* [[Binaries_and_Build_Scripts|Distribution specific instructions and ready-made binary packages]]
 
* [[Binaries_and_Build_Scripts|Distribution specific instructions and ready-made binary packages]]
 +
* [[RKWard_Source_Repository|Getting the source from git]]
 
* [[General_FAQ]]
 
* [[General_FAQ]]
 +
* [[RKWard_on_Windows/Packaging]]
  
== Picking the right version of RKWard ==
+
== Building RKWard ==
Currently, RKWard is published in two different versions, one for KDE 3 based systems (RKWard versions numbered up to 0.4.9x), one for KDE 4 based systems (RKWard versions numbered 0.5.0 and above).
+
 
+
KDE 4 based system, here, means that you have only version 4 of the KDE '''libraries'''. You do not necessarily have to run a full KDE 4 desktop. In fact, on systems with both versions of kdelibs, either version of RKWard can be used.
+
 
+
Note that active development is focused on the KDE 4 series of RKWard. For the KDE 3 series, we only publish the most important bug fixes from time to time. Therefore, if you want the latest and greatest RKWard, use the most recent version ''above'' 0.5.0.
+
 
+
== Building RKWard 0.5.0 and above ==
+
  
 
=== Requirements ===
 
=== Requirements ===
Line 24: Line 23:
 
* Qt-libraries and headers (>= 4.3) (http://www.trolltech.com)
 
* Qt-libraries and headers (>= 4.3) (http://www.trolltech.com)
 
** On most systems these should be installed automatically, when you install the KDE-libraries, above.
 
** On most systems these should be installed automatically, when you install the KDE-libraries, above.
 +
* X11-libraries and headers (http://www.x.org)
 +
** On many systems these will be installed automatically, when you install the KDE-libaries. On other systems you may need to install libx11-dev/x11lib-dev, manually.
 
* R and headers (http://www.r-project.org)
 
* R and headers (http://www.r-project.org)
 
** Common package names are "r", "r-base", etc. Note that some distributions package the HTML-documentation in a separate package, so look out for "r-base-html" or similar package names.
 
** Common package names are "r", "r-base", etc. Note that some distributions package the HTML-documentation in a separate package, so look out for "r-base-html" or similar package names.
* PHP with commandline-interface (Version 4.x ''or'' 5.x) (http://www.php.net)
+
** If you compile R from source, make sure to use the "--enable-R-shlib" option to configure.
** Common package names include "php4", "php5", "php4-cli", "php5-cli".
+
 
* CMake (http://cmake.org)
 
* CMake (http://cmake.org)
 
** Generally this package is called "cmake".
 
** Generally this package is called "cmake".
  
 
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|contact us]] for help.
 
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|contact us]] for help.
 +
 +
Debian derivatives:
 +
* 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 kdelibs5-dev libx11-dev r-base-core r-base-dev cmake libqtwebkit-dev
 +
 +
(Note: In some old versions of the debian packaging, libqtwebkit-dev was not a separate package. Thus when building on a really old system, you may have to omit this line.)
  
 
=== Compilation ===
 
=== Compilation ===
Line 37: Line 44:
 
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.
 
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.
  
The recommended way to build from source is:
+
Suppose the source is obtained as  (here '''rkward-0.5.3.tar.gz''' is used as an example, change it accordingly):
  > mkdir build; cd build
+
$ tar xzf rkward-0.5.3.tar.gz # extracts to '''rkward-0.5.3''' directory
  > cmake path_to_rkward_sources [options] # see below
+
$ cd rkward-0.5.3
  > make
+
 
  > sudo make install
+
Then, the recommended way to build from source is:
 +
  $ mkdir build; cd build
 +
  $ cmake .. [options] # see ''Path to sources'' and ''CMake options'' below
 +
  $ make
 +
  $ sudo make install
 +
 
 +
==== 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) ====
 
==== CMake options (configuring) ====
Line 48: Line 63:
  
 
* -DCMAKE_INSTALL_PREFIX
 
* -DCMAKE_INSTALL_PREFIX
** set the installation base directory. Generally -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` should be correct.
+
** set the installation base directory. Generally -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` should be correct.  
 +
**When installing as a normal user (i.e., w/o root access), `kde4-config --localprefix` should work.
 +
** 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
 
* -DCMAKE_BUILD_TYPE
 
** type of build. Useful settings include -DCMAKE_BUILD_TYPE=Release and -DCMAKE_BUILD_TYPE=debugfull
 
** type of build. Useful settings include -DCMAKE_BUILD_TYPE=Release and -DCMAKE_BUILD_TYPE=debugfull
Line 57: Line 75:
 
** 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
 
** 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
 
* -DR_LIBDIR
** directory where R packages should be installed. Generally, this option is only of interest to packagers.
+
** 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:
 +
 
 +
$ R --silent
 +
  > Sys.getenv ("R_LIBS_USER").
 +
                        R_LIBS_USER
 +
"~/R/i486-pc-linux-gnu-library/2.9"
 +
::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.
 
* -DR_HOME
 
* -DR_HOME
 
** R home directory. Almost certainly this option is not needed.
 
** R home directory. Almost certainly this option is not needed.
* -DR_INCLUDE
+
* -DR_INCLUDEDIR
 
** path to R include files. Almost certainly this option is not needed.
 
** path to R include files. Almost certainly this option is not needed.
  
Line 69: Line 94:
 
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 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 root run:
 
As root run:
  > make install
+
  $ make install
  
 
Make sure you have set the correct path in cmake (the -DCMAKE_INSTALL_PREFIX option).
 
Make sure you have set the correct path in cmake (the -DCMAKE_INSTALL_PREFIX option).
Line 77: Line 102:
 
For now it's recommended to run RKWard from the command-line for debug-output. For the few available command-line options see
 
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
+
  $ rkward --help
  
== Building RKWard 0.4.9x and below ==
+
== Troubleshooting ==
  
=== Requirements ===
+
The most common source of problems are
To compile RKWard versions up to 0.4.x you need:
+
* KDE-libraries and headers (>= 3.x) ([http://www.kde.org])
+
* Qt-libraries and headers (>= 3.x) ([http://www.trolltech.com])
+
* R and headers (>= 2.1.0) ([http://www.r-project.org])
+
* PHP with commandline-interface ([http://www.php.net])
+
  
=== Compilation ===
+
# Missing some of the build requirements
 +
# Wrong / missing parameters to cmake
  
Compilation / installation is basically just a
 
# ./configure (possibly with options, see below)
 
# make
 
# make install
 
 
=== configure options ===
 
 
In most cases you will not need to pass any options to ./configure. If you run into troubles during compilation, you may need to specify these options:
 
 
* --prefix=/path/to/kde.
 
You can determine your kde-directory by looking for some K-Application you know you have installed by typing "which kedit" in a console and strip the final /bin of the path (e.g. if which kedit returns /usr/bin/kedit , use /usr ). For debian use --prefix=/usr
 
* In rare cases, you might also have to specify your qt (3) directory, passing the commandline-option --with-qt-dir=/usr/lib/qt3 (or similar) to configure.
 
* On systems with more than one version of R installed, you may need to specify --with-r-home=/correct/path to make sure the correct version of R is used.
 
* The option --with-r-libdir can be used to specify, where the R package of rkward is to be installed. Generally, this option is of interested to package builders, only.
 
 
=== 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 root run:
 
> 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
 
- Missing some of the build requirements
 
- Wrong / missing parameters to cmake or ./configure
 
 
So please re-read the corresponding sections, first. If you're still in trouble, [[Contact|let us know]], we'll be happy to help you.
 
So please re-read the corresponding sections, first. If you're still in trouble, [[Contact|let us know]], we'll be happy to help you.
  
 
For some systems, [[Binaries_and_Build_Scripts]] has more information.
 
For some systems, [[Binaries_and_Build_Scripts]] has more information.

Latest revision as of 08:52, 19 April 2016

Contents

[edit] 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.

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

[edit] Related pages

[edit] Building RKWard

[edit] Requirements

RKWard requires:

  • KDE-libraries and headers (>= 4.0) (http://www.kde.org)
    • 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.
  • Qt-libraries and headers (>= 4.3) (http://www.trolltech.com)
    • On most systems these should be installed automatically, when you install the KDE-libraries, above.
  • X11-libraries and headers (http://www.x.org)
    • On many systems these will be installed automatically, when you install the KDE-libaries. On other systems you may need to install libx11-dev/x11lib-dev, manually.
  • R and headers (http://www.r-project.org)
    • Common package names are "r", "r-base", etc. Note that some distributions package the HTML-documentation in a separate package, so look out for "r-base-html" or similar package names.
    • If you compile R from source, make sure to use the "--enable-R-shlib" option to configure.
  • CMake (http://cmake.org)
    • Generally this package is called "cmake".

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.

Debian derivatives:

  • 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 kdelibs5-dev libx11-dev r-base-core r-base-dev cmake libqtwebkit-dev

(Note: In some old versions of the debian packaging, libqtwebkit-dev was not a separate package. Thus when building on a really old system, you may have to omit this line.)

[edit] 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):

$ tar xzf rkward-0.5.3.tar.gz # extracts to rkward-0.5.3 directory
$ cd rkward-0.5.3

Then, the recommended way to build from source is:

$ mkdir build; cd build
$ cmake .. [options]	# see Path to sources and CMake options below
$ make
$ sudo make install

[edit] 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.

[edit] 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.
    • When installing as a normal user (i.e., w/o root access), `kde4-config --localprefix` should work.
    • 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:
$ R --silent
 > Sys.getenv ("R_LIBS_USER"). 
                        R_LIBS_USER
"~/R/i486-pc-linux-gnu-library/2.9"
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.
  • -DR_HOME
    • R home directory. Almost certainly this option is not needed.
  • -DR_INCLUDEDIR
    • path to R include files. Almost certainly this option is not needed.

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

[edit] 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 root run:

$ make install

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

[edit] 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

[edit] 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.

Personal tools
Namespaces

Variants
Actions
RKWard
Documentation
wiki
Toolbox
Affiliations