Skip to content

Instantly share code, notes, and snippets.

@jeroen
Last active April 9, 2020 02:59
Show Gist options
  • Save jeroen/aab6889691d531d6e8ee to your computer and use it in GitHub Desktop.
Save jeroen/aab6889691d531d6e8ee to your computer and use it in GitHub Desktop.
Building R on Solaris
## Copy this file into config.site ##
CC="cc -xc99"
CPPFLAGS="-I/opt/csw/include"
CFLAGS="-I/opt/csw/include -O -xlibmieee"
LDFLAGS="-L/opt/csw/lib"
F77=f95
FFLAGS=-O
CXX="CC -library=stlport4"
CXXFLAGS=-O
FC=f95
FCFLAGS=$FFLAGS
FCLIBS="-lfai -lfsu"
R_LD_LIBRARY_PATH="/usr/local/lib:/opt/csw/gcc4/lib:/opt/csw/lib"

Requirements

  • Free Oracle account
  • VirtualBox

Notes

  • Solaris iconv does not work. We need GNU iconv from CSW
  • The CSW version of r_base uses gcc (also from CSW)
  • The builds below use the Oracle Studio 12.3 compiler instead (because CRAN)

Setup

  • Download Solaris 11.2 VM for VirtualBox
  • Double Click image to open in Virtualbox
  • Click though menu to setup server
  • In virtual box "Devices" menu, enable share clipboard bewteen guest/host (bidirectional).

Compilers

GNU libiconv

  • Add the opencsw repsitory.
  • Install GNU iconv: sudo /opt/csw/bin/pkgutil -y -i libiconv_dev

Java (recommended)

sudo pkg install --accept jdk-7
javac --version

pdflatex (optional)

sudo /opt/csw/bin/pkgutil -a texlive
sudo /opt/csw/bin/pkgutil -y -i texlive
pdflatex --version`

Build r-base

mkdir -p ~/build
cd ~/build
wget http://cran.rstudio.com/src/base/R-3/R-3.1.2.tar.gz
tar xzvf R-3.1.2.tar.gz
cd 3.1.2
rm config.site
## Copy new config.site into R dir
PATH=$PATH:/opt/solarisstudio12.3/bin
./configure --prefix=/opt/R --with-blas='-library=sunperf' --with-lapack
make
sudo mkdir -p /opt/R/lib/R/lib
sudo make install

Build r-devel

mkdir -p ~/build
cd ~/build
wget ftp://ftp.stat.math.ethz.ch/Software/R/R-devel.tar.gz
tar xzvf R-devel.tar.gz
cd R-devel
rm config-site
## Copy new config.site into R dir
PATH=$PATH:/opt/solarisstudio12.3/bin
./configure --prefix=/opt/R-devel --with-blas='-library=sunperf' --with-lapack
make
sudo mkdir -p /opt/R-devel/lib/R/lib
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment