If you haven’t tested yet the new OrangePI PC released here, a distro with ubuntu 15.04 Vivid Vervet build is waiting for you to test his new features. Today, to inaugurate the first blog-post of ctrlfagency, I have decided to start by sharing you a tutorial regarding the build of the IDE Rstudio. Rstudio is the software that will make you like math, statistics, probabilities, and Risk Management.
Features of Rstudio
- Access RStudio locally
- Syntax highlighting, code completion, and smart indentation
- Execute R code directly from the source editor
- Quickly jump to function definitions
- Easily manage multiple working directories using projects
- Integrated R help and documentation
- Interactive debugger to diagnose and fix errors quickly
- Extensive package development tools
R is a software distributed under AGPL License that permit to introduce you with Science and computing. R fit to all people from children to the oldest, and has a wide scientist community that use it (More than the google’s tensorflow project). This tutorial is the first of a long series. If you look at the internet for a tutorial on how to build Rstudio on OrangePi PC , you may fall into general misunderstanding because there are not actually existing tutorials about it.
Create a swap space
To get started we need to create a swap space on the orangePI in order to avoid your build’s cmake to stop during the install because of a lack of memory. We have the choice to create a single file to “host” our swap or to create a swap partition with fdisk or gparted… I have choosen to create a 1Gb swap space on a single file at the root of my filesystem.
cd / && sudo fallocate -l 1G /swapfile && chmod 600 swapfile && ls -lh swapfile && sudo mkswap swapfile && sudo swapon /swapfile && sudo swapon -s
Now we edit the fstab file to make our changes permanent :
sudo nano /etc/fstab
Add the lines at the bottom of the file :
/swapfile none swap sw 0 0
Save – ctrl+o And ctrl+x to quit
We can make it more effective by doing this :
sudo sysctl vm.swappiness=10 sudo sysctl vm.vfs_cache_pressure=50
Making theses changes permanent :
And add the lines at the top of the file :
sysctl vm.swappiness=10 sysctl vm.vfs_cache_pressure=50
Our swap space is created.
Install Java Developper Kit 8
Add webvupd8team repository :
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update
And install the package :
sudo apt-get install oracle-java8-installer
We could install Openjdk8 instead of the non-Free version :
sudo apt-get install -y openjdk-8-jdk
Download the latest ARM version of Rstudio and extract it to you folder.
wget https://github.com/rstudio/rstudio/tarball/v0.98.982 && tar zxvf v0.98.982
Download and exrtact the updated compiler for gwt.
wget http://dl.google.com/closure-compiler/compiler-latest.zip && unzip compiler-latest.zip
Download the dependencies :
sudo apt-get install -y install build-essential pkg-config fakeroot cmake uuid-dev libssl-dev libbz2-dev zlib1g-dev libpam-dev libboost-all-dev libpango1.0-dev ant pandoc qt-sdk
Replace the compiler.jar by the new one downloaded previously.
cp compiler.jar rstudio-rstudio-f8f2683/src/gwt/tools/compiler/compiler.jar
Install common dependencies :
cd rstudio-rstudio-f8f2683/dependencies/common/ && ./install-gwt && ./install-dictionaries && ./install-mathjax && ./install-boost && ./install-packages
Wait a while…
Make the build..
cd ../../ && sudo cmake -D RSTUDIO_TARGET=Desktop -DCMAKE_BUILD_TYPE=Release && sudo make install
Remove the building dependencies.
sudo apt-get autoremove openjdk-8-jdk pandoc libboost-all-dev && cd .. && rm -rf rstudio* && apt-get autoremove
That’s all folks !
- Shell script for Rstudio ARM on chromebooks here
- Building Rstudio on linux ARM here
- Install Java 8 here