RAVE:Install prerequisites

From OpenWetWare
Jump to navigationJump to search
RAVE logo R Analysis and Visualization of iEEG

RAVE



RAVE is written in the programming language "R". Before installing RAVE, "R" (version 4 or greater) must be installed. RAVE displays results using a web browser, and is developed with Google Chrome (other browsers may have worse performance for complex graphics operations).

Prerequisites for MacOS

1. Install R, version 4 or higher

Click here to install the latest version of the R language for Mac. Find the latest package (.pkg) file, click to download, then open and install. There are different versions of R for older Macs with Intel CPUs and newer Macs with Apple CPUs (M1/M2). Choose the correct version, either "Intel 64-bit" or "Apple silicon ARM64".


To verify R installation: R will be installed in the /Applications folder. Open this folder and double-click on the R icon to start R. After starting R, We recommend that you right-click on the R icon in the Dock and select "Options"/"Keep in Dock". This will make it easier to launch R and RAVE. We recommend starting R, opening the "Preferences"/"Startup" tab, and change "Save workspace on exit from "R" to "No". Uncheck the box "Read history file on startup". To check the current version of "R", start R and enter the following into the console:

 R.version

This will produce a number of lines of output, beginning with something like

 platform       x86_64-apple-darwin17.0     
 arch           x86_64

2. homebrew package manager

Open "terminal" (in the /Applications/Utilities folder). Copy the command line shown below into the terminal window.

 /usr/bin/env bash

Next, copy the line below into the terminal window. You will be prompted for the administrator password, enter it and then press return to begin installation. For more information, see the homepage for the "homebrew" package manager.

 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

This step will take several minutes to complete. Wait until the installation is finished and the command prompt reappears before moving to the next step.

Add brew to your path or the next installation steps will fail. The installer provides the necessary command lines in the Terminal window at the conclusion of the previous step. Execute them in the same terminal window by copying and pasting. They will look something like

 echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
 eval "$(/opt/homebrew/bin/brew shellenv)"

These commands will not produce any output.

To verify brew installation: Copy the command line shown below into the terminal window.

 brew --version

Should produce a result like

 Homebrew 3.4.1
 Homebrew/homebrew-core (git revision f03c984ad7; last commit 2022-03-08)

3. Install libraries using brew

Enter this command into the terminal window:

 brew install hdf5 fftw pkg-config

This step will install the hdf5 (high-performance file system), fftw (fast-fourier transform library), pkg-config (package configuration toolbox) and takes several minutes to complete. Wait until the installation is finished and the command prompt reappears before moving to the next step.

4. Finished with prerequisites

Click here to return to full installation guide.

5. Troubleshooting

You may receive this message

 Warning: macOS is reporting that you have not yet agreed to the Xcode license. This can occur if Xcode has been updated or reinstalled (e.g. as part of a macOS update). Some features (e.g. Git / SVN) may be disabled.

To make this error go away, open the "Terminal" app in the Applications folder, enter

 sudo xcodebuild -license accept

For password, type in the password of an account with Administrator privileges. Then restart RStudio. A helpful article in case of XCode installation errors.

If the XCode download from the RStudio install in step 2 fails, install the command line tools manually. First, download XCode. Click "GET" (if instead you see "OPEN", then Xcode is already installed.) Open the "Terminal" app in the Applications folder, enter

 xcode-select --install

Click "yes" to proceed with installing the command-line tools. The message "xcode-select: error: command line tools are already installed" means that you can proceed.

Prerequisites for Windows

These instructions are for Windows 10 with "bash" enabled. You will be asked many questions by the installers; the default response is fine for all of them.

  1. Install the latest version of the R language
  2. Install the latest version of RTools. The version of RTools must match your version of R. RTools contains compilers used to compile routines for faster execution.
  3. Finished with Windows install! Return to full installation guide.

Prerequisites for Ubuntu

To install R, please go to https://cran.r-project.org/ and read installation guide for Linux system. The following guide is for Ubuntu (x86_64) system.

1. Add R-Cran repository to your app list:

Open terminal (if you don't know how, look at your sidebar in ubuntu, `search your computer` enter "terminal", and open it), type the following code:

 # update indices
 sudo apt update -qq
 # install two helper packages we need
 sudo apt install --no-install-recommends software-properties-common dirmngr
 # import the signing key (by Michael Rutter) for these repo
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
 # add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
 sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
2. Install R

Copy the following command line by line into your terminal and run

 sudo apt-get install r-base r-base-dev
3. Install compiling tools and system dependencies

After installing R, copy the following command to your terminal and run:

 sudo apt-get install build-essential file git libsodium-dev libffi-dev \
   libbz2-dev libpcre2-dev libcairo2-dev libcurl4-openssl-dev libfftw3-dev \
   libfreetype6-dev libfribidi-dev libgit2-dev libhdf5-dev libharfbuzz-dev \
   libjpeg-dev libpng-dev libssl-dev libssh2-1-dev libtiff5-dev libv8-dev \
   libxml2-dev psmisc procps sudo wget zlib1g-dev

The packages `libv8-dev` is for `V8` package to enable JavaScript. `libxml2-dev` is for `xml2`. `libfftw3-dev` `libtiff5-dev` are necessary for fast-fourier transformations and `libhdf5-dev` is for reading and writing data in open data format `HDF5`. All the other packages are necessary for `devtools` (compilers)


4. Install the free version of RStudio Desktop here:

Go to https://www.rstudio.com/products/rstudio/download/#download and download one with keywords "Ubuntu 16.04+/Debian 9+ (64-bit)", move the downloaded file to your **desktop**, rename it "rstudio.deb".

Open terminal, type the following command in your terminal

 cd ~/Desktop
 sudo dpkg -i ./rstudio.deb 

and `RStudio` should be in your application list. If not, look at your sidebar in ubuntu, click **search your computer** and enter "RStudio". See [1] for more help.

5. Finished with Ubuntu install! Return to full installation guide.

For Developers and Power Users

RStudio provides many useful tools for R developers. If you expect to be developing RAVE, we recommend that you install RStudio.

  1. Install RStudio Desktop from the RStudio website Install RStudio Desktop. Choose the RStudio Desktop (Free) version. Alternatively, RStudio can be installed from the command line. Enter the following command into the terminal window:
 brew install --cask rstudio

For either method on Macs, RStudio will be installed in the /Applications folder. We recommend that you open this folder, and right-click on the RStudio icon and select "Options"/"Keep in Dock". This will make it easier to launch RStudio and RAVE. We recommend starting RStudio, opening the "Preferences" menu, and changing two items: uncheck the "Restore .RData into workspace at startup" option, and change "Save workspace to .RData on exit:" to "Never". Click "Apply" and follow the prompts to restart RStudio. RAVE is tested with the latest version of RStudio. If you have an older version installed, update to the newest version.