installation.md

Full Installation-from-Source Guide for ravetools

The package ravetools contains C++ code that requires general compilers such as gcc or clang to compile. In addition, the signal processing code requires FFTW3 library, which could be installed easily.

This guide contains three parts. In the first part, we will install proper compilers on your machine. If you have already installed them, please skip and proceed to the second part, in which you will install the FFTW3 library. The last part simply installs ravetools.

Prerequisite

The development of ravetools is and will always be on the latest version of R. While I will try my best to maximize backward compatibility, it is unlikely for me to test ravetools on every single old versions of R. Choosing the latest R is always the best choice.

Installing on Windows

1. Install Building Tools

write('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', file = "~/.Renviron", append = TRUE)

2. Install FFTW3

In start menu, the Rtools Bash application icon is purple with a letter M

pacman -S  mingw-w64-{i686,x86_64}-fftw

3. Install ravetools

if(system.file(package = 'remotes') == ""){ install.packages('remotes') }

remotes::install_github('dipterix/ravetools')

Installing on MacOSX

1. Check your R architecture

Open your R. In the start-up message, you will see text similar to these

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

Alternatively, you can run the following R command:

R.version$platform
##> [1] "aarch64-apple-darwin20"

Check the architecture keywords after Platform. If you see aarch64, then you have ARM CPU (such as M1 chip), and an ARM version of R installed. If you see x86_64, then you have an Intel version of R installed (even if you have ARM chips, your R is still Intel-based).

If you have ARM CPU (like M1-chip), it is always (strongly) recommended that you install R with the same architecture, because your compilers need to be consistent in architectures. If you have Intel-based R installed, then you have to set up a whole compiler chain that is Intel-based. (This tutorial does not cover such advanced case)

2. Install command-line tools

If you see the message: code-select: error: command line tools are already installed, use "Software Update" to install updates, this means the command-line tools have been already installed on your machine in the past, and you are safe to proceed to the next step.

3. Install HomeBrew

Please go to HomeBrew's installation site to install HomeBrew. If you don't like to read, simply paste the following command into your terminal window and hit the return key:

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

Please answer all the prompted questions and wait till brew to brew itself.

4. Install pkg-config and FFTW3

Open a new terminal window. If you are using ARM CPU, then type

eval "$(/opt/homebrew/bin/brew shellenv)"
brew install pkg-config fftw

If you have Intel-based machine, type

eval "$(/usr/local/bin/brew shellenv)"
brew install pkg-config fftw

5. Install ravetools

if(system.file(package = 'remotes') == ""){ install.packages('remotes') }

remotes::install_github('dipterix/ravetools')

Installing on Ubuntu

sudo apt-get install build-essential pkg-config libfftw3-dev

Please search their alternatives if you are using other Linux systems such as RedHat or CentOS.

if(system.file(package = 'remotes') == ""){ install.packages('remotes') }

remotes::install_github('dipterix/ravetools')

Installing with Docker

Please check this Dockerfile. It takes 24 minutes to compile everything from source with 2 CPUs, 1 GB RAM



dipterix/ravetools documentation built on March 5, 2025, 3:08 a.m.