Running GSL library inside R on macOS 10.15

It’s quite simple. Make sure to build everything from the sources

> mkdir -p $HOME/opt/src
> mkdir -p $HOME/opt/usr/local
> cd $HOME/opt/src
> curl -O http://mirror.us-midwest-1.nexcess.net/gnu/gsl/gsl-2.6.tar.gz
> tar zxf gsl-2.6.tar.gz
> cd gsl-2.6
> ./configure --prefix=$HOME/opt/usr/local/gsl/gsl-2.6
> make
> make install

make sure that R can see your fresh installation and run R.

> export CFLAGS="-I$HOME/opt/usr/local/gsl/gsl-2.6/include"
> export LDFLAGS="-L$HOME/opt/usr/local/gsl/gsl-2.6/lib -lgsl -lgslcblas" 
> R 

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
...
...
> install.packages("gsl")
...
...
...
There is a binary version available but the source version is later:
      binary source needs_compilation
gsl 1.9-10.3  2.1-6              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
...
...
>

now, you can install other packages that depend on GSL, e.g. copula.

> install.packages("copula")
> library(copula)
>

That’s it!