RKWard on Mac

From RKWard
(Difference between revisions)
Jump to: navigation, search
m (Pre-Requirements: added warning)
(Link to updated bundle)
(33 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
== Status ==
 
== Status ==
  
Unfortunately, access to a Mac is limited for the main contributors, so we are still figuring out a complete step-by-step guide and do need your help. If you would like to give this a try, please do! You are likely to run into a problem, here or there, but we are very much willing to talk you through those, and we are confident that RKWard on Mac is just a few steps away.
+
Although access to a Mac is still limited for the main contributors, as of version 0.6.5, there is a pre-compiled ready-to-install bundle for Mac OS X >= 10.09. We want to encourage you to send feedback to our [[Contact|'''mailing lists''']], be it success stories or bug reports, because without it is hard to continue support for this operating system in the future!
  
Please take the outline below as a rough guide of the required steps. If one of the steps is unclear, or simply does not work, [[Contact|'''let us know''']], and we will find a solution.
+
Please take the information below as a guide through the required steps. If one of the steps is unclear, or simply does not work, [[Contact|'''let us know''']], and we will find a solution.
  
== Installing using MacPorts ==
+
== Installing using the precompiled binary bundle ==
  
The [http://www.macports.org MacPorts project] seems to offer the more up-to-date KDE packages for MacOS, so at the moment it is considered the preferred method over fink. However, it will install an Aqua based version of KDE, and as of now, RKWard will not be able to capture the graphic devices. That is, most of RKWard's advanced graphics features are missing here, as they still lack support for Aqua. The rest of the application should be operational, though.
+
We've used the MacPort of RKWard to precompile a [http://download.kde.org/stable/rkward/0.6.5/mac/RKWard-binary-0.6.5b_OSX10.9_KDE-4.14.3_needs_CRAN_R-3.3.0.pkg installation .pkg which includes all needed KDE libraries and RKWard], currently only for Mac OS X Maverick (10.9) or above. Newer releases of this bundle do not inlcude R, which means you need to install the latest version of [http://cran.r-project.org/bin/macosx/ R from CRAN] first ('''make sure the RKWard bundle you install matches this R version''', as is said in the bundle's file name: "''needs_CRAN_R-<version>''"). The bundle is still work in progress, but it has been tested and is reported to run on various machines. A screencast of the installation is available [http://www.youtube.com/watch?v=2t4zUOlgPG8 here].
 +
 
 +
'''Note:''' ''If installing on OS 10.8 Mountain Lion, you will need to either disable Gatekeeper in the Security & Privacy control panel by setting "Allow applications downloaded from:" to "Anywhere", or by right-clicking the installer and selecting "Open."''
 +
 
 +
If you test this bundle package, please [[Contact|send us feedback]], be it a short success notice or a bug report. We rely on this simple feedback for the further development of this port!
 +
 
 +
=== Uninstalling the bundle ===
 +
 
 +
Follow the instructions on uninstalling the MacPorts source installation (see [[#Uninstalling RKWard|below]]).
 +
 
 +
== Installing from source using MacPorts ==
 +
 
 +
The [http://www.macports.org MacPorts project] offers up-to-date KDE packages for Mac OS X, so at the moment it is considered the preferred method over fink (see [https://rkward.kde.org/index.php?title=RKWard_on_Mac&oldid=1419 earlier revisions of this page]). A screencast of the process is available [http://www.youtube.com/watch?v=OiAsSyNo_NY&feature=plcp here].
 +
 
 +
=== When is this preferable over the binary bundle? ===
 +
 
 +
Because the bundling process currently involves a lot of manual steps, we can only release new binary bundles every now and then. If you need or want to check out the latest development version of RKWard, e.g., to test new features or fixes, installing the latest port is the preferred method for Mac users. However, ''you should not mix both installation types'', allthough the bundle should not interfere with MacPorts in general.
  
 
=== Pre-Requirements ===
 
=== Pre-Requirements ===
  
 
<ol>
 
<ol>
<li>Install the [http://www.macports.org/install.php MacPorts software]. As the instrunctions tell, you need XCode installed as well. When you do or try to upgrade, make sure no previous installation of XCode is lying around, because it can mess up the build with confusion about the gcc compilers available. A symptom for this might be failing builds of certain ports later on. Look for old "/Developer-X.Y" entries and check if you need to remove them, e.g.:<pre>
+
<li>Install all requirements for the [http://www.macports.org/install.php MacPorts software]. Please make sure you have a ''recent'' version of XCode installed and take care of keeping it up-to-date, because some ports will not compile otherwise. In case you have more than one installation of XCode on your system, make sure to set one (probably the latest) as the default, because confusion about the gcc compilers available can mess up the build. A symptom for this might be failing builds of certain ports later on. If this is the case, use <tt>xcode-select</tt> to set the default before installing MacPorts, e.g.:<pre>
sudo /Developer-3.2/Library/uninstall-devtools --mode=all  # be aware that this will *uninstall* XCode 3.2 completely!
+
xcode-select -switch /Applications/Xcode.app/Contents/Developer
 
</pre></li>
 
</pre></li>
<li>As of now, the <tt>rkward</tt> portfile is under development and not yet available as an official part of MacPorts '''(meaning: this is the bleeding edge approach!)'''. Therefore, you need to tell MacPorts to use it nonetheless manually. Open a terminal and follow these steps:</li>
+
<li>There is an official [https://trac.macports.org/browser/trunk/dports/kde/rkward/Portfile RKWard port] you might use. To do so, simply install [http://www.macports.org/install.php MacPorts] manually and then jump right to [[#Building RKWard|Building RKWard]]. Alternatively, you can use the build script that is part of RKWard's sources, which is also the method we use to build and bundle RKWard for OS X. It will also take care if the MacPorts installation for you and configure it accordingly. '''Only do this if you're using MacPorts for RKWard alone! The script installs everything to /opt/rkward, which is not the MacPorts default path! Do not use the script if you're already using MacPorts!'''
 +
 
 +
To proceed, open a terminal and follow these steps:</li>
 
<ol>
 
<ol>
<li>Create a new directory for the portfile, e.g.<pre>
+
<li>Create a new directory for the RKWard sources:<pre>
mkdir -p /Users/&lt;your_username&gt;/software/ports/
+
sudo mkdir -p /opt/git
 
</pre></li>
 
</pre></li>
<li>Get the recent portfile and create the neccessary portfile index:<pre>
+
<li>Checkout the source code and create a symbolic link to the portfile location (it's expected by the script):<pre>
cd /Users/&lt;your_username&gt;/software/ports/
+
cd /opt/git
svn co http://rkward.svn.sourceforge.net/svnroot/rkward/trunk/rkward/macports/ .
+
git clone git://anongit.kde.org/rkward.git
portindex
+
cd /opt
 +
sudo ln -s /opt/git/rkward/macports/ ports
 
</pre></li>
 
</pre></li>
<li>Add this portfile location to the MacPorts configuration. This example uses the <tt>nano</tt> editor, but of course any other text editor will do, too:<pre>
+
<li>You can now call the build script to do certain tasks. To get an overview of its features, call it without any options:<pre>
sudo nano /opt/local/etc/macports/macports.conf
+
/opt/git/rkward/macports/update_bundle.sh
</pre></li>
+
</pre>
<li>Find the line containing "rsync://rsync.macports.org/... default]" and add directly above that:<pre>
+
To setup and configure MacPorts in /opt/rkward, use the "-F" option and state the most recent release of MacPorts, for example 2.3.4:<pre>
file:///Users/&lt;your_username&gt;/software/ports/
+
/opt/git/rkward/macports/update_bundle.sh -F 2.3.4
</pre></li>
+
<li>And finally, update your port database:<pre>
+
sudo port selfupdate
+
 
</pre></li>
 
</pre></li>
 +
<li>After the installation finished, you can use the script to install RKWard (see below).</li>
 
</ol>
 
</ol>
 
</ol>
 
</ol>
  
All further needed software packages (KDE and R) will be installed with the RKWard port automatically, so you should need no additional preparations.
+
All further needed software packages (KDE and R) will be installed with the RKWard port automatically, so you should need no additional preparations.  
  
 
=== Building RKWard ===
 
=== Building RKWard ===
  
This step should take only one command in a terminal, but a lot of time to finish (depending on your CPU, it could even take days!):
+
This step should take only one command in a terminal, but a lot of time to finish (depending on your CPU, it could even take days!). With the steps described above you have prepared MacPorts to build the package.
  sudo port -v install rkward-devel
+
 
 +
If you want to install the latest stable release from a standard MacPorts installation, you should use this command:
 +
  sudo port -v install rkward
 +
 
 +
If, on the other hand, you used the build script to setup MacPorts, you should also continue to use the script to install RKWard. As you have seen, the script has options to decide whether you would like to build against a present installation of R or use MacPorts version of R, install the latest stable release of RKWard or the current development snapshot '''(meaning: this is the bleeding edge approach!)''' etc. To install RKWard stable with CRAN R, call the script with these options:
 +
/opt/git/rkward/macports/update_bundle.sh -Dbr
  
 
=== Running RKWard ===
 
=== Running RKWard ===
Line 49: Line 71:
 
If the compilation and installation finished successfully, you should now find RKWard in your Applications menu, filed under MacPorts.
 
If the compilation and installation finished successfully, you should now find RKWard in your Applications menu, filed under MacPorts.
  
Before you can start any KDE software, you first need to run the following commands once:
+
'''Note:''' Before you can start any KDE software, you first need to run the following commands once (should be done automatically if you installed using the build script):
 
  sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
 
  sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
 
  launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
 
  launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
  
You might also notice that the <tt>LANG</tt> variable is not set in the environment RKWard is started, i.e. you will always get the english interface. To change that, e.g. into german, you can also use <tt>launchctl</tt>:
+
=== Uninstalling RKWard ===
launchctl setenv LANG de_DE.UTF-8
+
  
== Installing using fink ==
+
There is no genuine uninstall routine yet. But to remove it again from your system, all you need to do is to remove two directories:
=== Pre-Requirements ===
+
sudo rm -rf /Applications/RKWard
 +
sudo rm -rf /opt/rkward
  
<ol>
+
'''Note:''' Of course, in case you have saved anything manually to these folders since installation, backup your data first -- and be careful with <tt>rm -rf</tt>!
<li>You need an existing installation of R (2.9.0 or higher). http://www.r-project.org/ has binaries for MacOS, and you will likely use the latest available binary installer.</li>
+
<li>For KDE4, follow this procedure (taken from http://mac.kde.org):</li>
+
<ol>
+
<li>Install Fink: http://www.finkproject.org/download/index.php</li>
+
<li>Open a Terminal</li>
+
<li>Enable the "unstable" distribution:<pre>
+
fink configure
+
</pre>
+
</li>
+
<li>Update Fink:<pre>
+
fink selfupdate      # This will take a while to complete
+
</pre></li>
+
<li>Finally, install kdelibs and some needed packages. '''Currently it is important to use the X11 versions''', RKWard will not work with the native versions, yet:<pre>
+
fink install kdebase4-x11        # This will take a *long* time to complete
+
fink install svn                # if you do not have svn, already
+
</pre></li>
+
</ol>
+
</ol>
+
  
Notes:
+
Alternatively, you can also have this done by the build script to wipe RKWard from your system:
* Fink also provides an R package, but this seems to be very old, thus it is recommended to install the official binary from http://www.r-project.org, as detailed above. After installation, you should have a console version of R at /usr/bin/R .
+
/opt/git/rkward/macports/update_bundle.sh -X
  
=== Building RKWard ===
+
Using the script will also clean up some symlinks that were created for KDE services during installation. Removing RKWard manually will leave these symbolic links. They will do no harm, since you've just removed their targets. However, if you're certain you're not running KDE services anymore, you can also clean those up manually:
 +
sudo rm /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
 +
sudo rm /Library/LaunchDaemons/org.freedesktop.avahi-daemon.plist
 +
sudo rm /Library/LaunchDaemons/org.freedesktop.avahi-dnsconfd.plist
 +
sudo rm /Library/LaunchAgents/org.freedesktop.dbus-session.plist
 +
sudo rm /Library/LaunchAgents/org.macports.kdecache.plist
  
Next fetch the latest [[RKWard SVN|SVN]] sources:
+
'''Note:''' To be safe here, first check with <tt>ls -l /Library/LaunchDaemons</tt> and <tt>ls -l /Library/LaunchAgents</tt> that these links are really dead and associated with files in <tt>/opt/rkward</tt>!
  svn co http://rkward.svn.sourceforge.net/svnroot/rkward/trunk rkward_trunk
+
The remainder of the process should work as detailed at [[Building RKWard From Source]]. These commands will hopefully do the trick:
+
  cd rkward_trunk/rkward;  # the directory with the svn checkout
+
  mkdir build; cd build
+
  . /sw/sbin/kde4-buildenv.sh    # this sets some environment variables needed for building; we assume your fink base is "/sw".
+
  cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`
+
  make
+
  sudo make install
+
  
This should be all!
+
== Troubleshooting ==
  
=== Running RKWard ===
+
Again: Some detail or other of the above instructions is probably just wrong. If / when you get an error, please don't give up. Send us a [[Contact|mail]], and we will talk you through.
 +
BTW: If you figured out the remaining details all by yourself: Great! But please drop us a note as well, so we can provide more accurate instructions in the future.
  
For some reason fink places the KDE binaries in a rather hidden place, which is not in the path by default. If you have done everything as described above, rkward will be at
+
=== RKWard crashes on start ===
  /sw/opt/kde4/x11/bin/rkward
+
  
 +
'''Possible solution no. 1:''' Your KDE setup is probably not ready, most likely dbus is not running. Before you can start any KDE software, you first need to run the following commands once:
 +
sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
 +
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
  
== Troubleshooting ==
+
'''Possible solution no. 2:''' You had installed R from another source before, RKWard picks the wrong one and doesn't find its own R package(s). If possible, remove the older R installation first.
  
Again: Some detail or other of the above instructions is probably just wrong. If / when you get an error, please don't give up. Send us a [[Contact|mail]], and we will talk you through.
+
=== Language is always english ===
  
BTW: If you figured out the remaining details all by yourself: Great! But please drop us a note as well, so we can provide more accurate instructions in the future.
+
'''Possible solution:''' If the <tt>LANG</tt> variable is not set in the environment RKWard is started, you will always get the english interface. To change that, e.g. into german, you can also use <tt>launchctl</tt>, before you start RKWard:
 +
launchctl setenv LANG de_DE.UTF-8
 +
This setting takes effect immediately, but won't survive a reboot. A more permanent solution is to set this environment variable for your user account by creating or adding to the file<tt> ~/.MacOSX/environment.plist</tt>:
 +
<pre>
 +
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
 +
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
 +
&lt;plist version="1.0"&gt;
 +
    &lt;dict&gt;
 +
        &lt;key&gt;LANG&lt;/key&gt;
 +
        &lt;string&gt;de_DE.UTF-8&lt;/string&gt;
 +
    &lt;/dict&gt;
 +
&lt;/plist&gt;
 +
</pre>

Revision as of 19:47, 5 July 2016


This page has been marked as needing an improvement. This means the page is incomplete, badly structured or otherwise in need of significant improvements.

Contents

Status

Although access to a Mac is still limited for the main contributors, as of version 0.6.5, there is a pre-compiled ready-to-install bundle for Mac OS X >= 10.09. We want to encourage you to send feedback to our mailing lists, be it success stories or bug reports, because without it is hard to continue support for this operating system in the future!

Please take the information below as a guide through the required steps. If one of the steps is unclear, or simply does not work, let us know, and we will find a solution.

Installing using the precompiled binary bundle

We've used the MacPort of RKWard to precompile a installation .pkg which includes all needed KDE libraries and RKWard, currently only for Mac OS X Maverick (10.9) or above. Newer releases of this bundle do not inlcude R, which means you need to install the latest version of R from CRAN first (make sure the RKWard bundle you install matches this R version, as is said in the bundle's file name: "needs_CRAN_R-<version>"). The bundle is still work in progress, but it has been tested and is reported to run on various machines. A screencast of the installation is available here.

Note: If installing on OS 10.8 Mountain Lion, you will need to either disable Gatekeeper in the Security & Privacy control panel by setting "Allow applications downloaded from:" to "Anywhere", or by right-clicking the installer and selecting "Open."

If you test this bundle package, please send us feedback, be it a short success notice or a bug report. We rely on this simple feedback for the further development of this port!

Uninstalling the bundle

Follow the instructions on uninstalling the MacPorts source installation (see below).

Installing from source using MacPorts

The MacPorts project offers up-to-date KDE packages for Mac OS X, so at the moment it is considered the preferred method over fink (see earlier revisions of this page). A screencast of the process is available here.

When is this preferable over the binary bundle?

Because the bundling process currently involves a lot of manual steps, we can only release new binary bundles every now and then. If you need or want to check out the latest development version of RKWard, e.g., to test new features or fixes, installing the latest port is the preferred method for Mac users. However, you should not mix both installation types, allthough the bundle should not interfere with MacPorts in general.

Pre-Requirements

  1. Install all requirements for the MacPorts software. Please make sure you have a recent version of XCode installed and take care of keeping it up-to-date, because some ports will not compile otherwise. In case you have more than one installation of XCode on your system, make sure to set one (probably the latest) as the default, because confusion about the gcc compilers available can mess up the build. A symptom for this might be failing builds of certain ports later on. If this is the case, use xcode-select to set the default before installing MacPorts, e.g.:
    xcode-select -switch /Applications/Xcode.app/Contents/Developer
    
  2. There is an official RKWard port you might use. To do so, simply install MacPorts manually and then jump right to Building RKWard. Alternatively, you can use the build script that is part of RKWard's sources, which is also the method we use to build and bundle RKWard for OS X. It will also take care if the MacPorts installation for you and configure it accordingly. Only do this if you're using MacPorts for RKWard alone! The script installs everything to /opt/rkward, which is not the MacPorts default path! Do not use the script if you're already using MacPorts! To proceed, open a terminal and follow these steps:
    1. Create a new directory for the RKWard sources:
      sudo mkdir -p /opt/git
      
    2. Checkout the source code and create a symbolic link to the portfile location (it's expected by the script):
      cd /opt/git
      git clone git://anongit.kde.org/rkward.git
      cd /opt
      sudo ln -s /opt/git/rkward/macports/ ports
      
    3. You can now call the build script to do certain tasks. To get an overview of its features, call it without any options:
      /opt/git/rkward/macports/update_bundle.sh
      
      To setup and configure MacPorts in /opt/rkward, use the "-F" option and state the most recent release of MacPorts, for example 2.3.4:
      /opt/git/rkward/macports/update_bundle.sh -F 2.3.4
      
    4. After the installation finished, you can use the script to install RKWard (see below).

All further needed software packages (KDE and R) will be installed with the RKWard port automatically, so you should need no additional preparations.

Building RKWard

This step should take only one command in a terminal, but a lot of time to finish (depending on your CPU, it could even take days!). With the steps described above you have prepared MacPorts to build the package.

If you want to install the latest stable release from a standard MacPorts installation, you should use this command:

sudo port -v install rkward

If, on the other hand, you used the build script to setup MacPorts, you should also continue to use the script to install RKWard. As you have seen, the script has options to decide whether you would like to build against a present installation of R or use MacPorts version of R, install the latest stable release of RKWard or the current development snapshot (meaning: this is the bleeding edge approach!) etc. To install RKWard stable with CRAN R, call the script with these options:

/opt/git/rkward/macports/update_bundle.sh -Dbr

Running RKWard

If the compilation and installation finished successfully, you should now find RKWard in your Applications menu, filed under MacPorts.

Note: Before you can start any KDE software, you first need to run the following commands once (should be done automatically if you installed using the build script):

sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

Uninstalling RKWard

There is no genuine uninstall routine yet. But to remove it again from your system, all you need to do is to remove two directories:

sudo rm -rf /Applications/RKWard
sudo rm -rf /opt/rkward

Note: Of course, in case you have saved anything manually to these folders since installation, backup your data first -- and be careful with rm -rf!

Alternatively, you can also have this done by the build script to wipe RKWard from your system:

/opt/git/rkward/macports/update_bundle.sh -X

Using the script will also clean up some symlinks that were created for KDE services during installation. Removing RKWard manually will leave these symbolic links. They will do no harm, since you've just removed their targets. However, if you're certain you're not running KDE services anymore, you can also clean those up manually:

sudo rm /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
sudo rm /Library/LaunchDaemons/org.freedesktop.avahi-daemon.plist
sudo rm /Library/LaunchDaemons/org.freedesktop.avahi-dnsconfd.plist
sudo rm /Library/LaunchAgents/org.freedesktop.dbus-session.plist
sudo rm /Library/LaunchAgents/org.macports.kdecache.plist

Note: To be safe here, first check with ls -l /Library/LaunchDaemons and ls -l /Library/LaunchAgents that these links are really dead and associated with files in /opt/rkward!

Troubleshooting

Again: Some detail or other of the above instructions is probably just wrong. If / when you get an error, please don't give up. Send us a mail, and we will talk you through. BTW: If you figured out the remaining details all by yourself: Great! But please drop us a note as well, so we can provide more accurate instructions in the future.

RKWard crashes on start

Possible solution no. 1: Your KDE setup is probably not ready, most likely dbus is not running. Before you can start any KDE software, you first need to run the following commands once:

sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

Possible solution no. 2: You had installed R from another source before, RKWard picks the wrong one and doesn't find its own R package(s). If possible, remove the older R installation first.

Language is always english

Possible solution: If the LANG variable is not set in the environment RKWard is started, you will always get the english interface. To change that, e.g. into german, you can also use launchctl, before you start RKWard:

launchctl setenv LANG de_DE.UTF-8

This setting takes effect immediately, but won't survive a reboot. A more permanent solution is to set this environment variable for your user account by creating or adding to the file ~/.MacOSX/environment.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>LANG</key>
        <string>de_DE.UTF-8</string>
    </dict>
</plist>
Personal tools
Namespaces

Variants
Actions
RKWard
Documentation
wiki
Toolbox
Affiliations