Skip to content

Instantly share code, notes, and snippets.

@mattfidler
Forked from achubaty/config.site
Last active November 30, 2018 05:32
Show Gist options
  • Save mattfidler/7533df348e60c4a439f0cf4a5cbc1a47 to your computer and use it in GitHub Desktop.
Save mattfidler/7533df348e60c4a439f0cf4a5cbc1a47 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/gcc5/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 Developer Studio 12.6 compiler instead (because CRAN)

Setup

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

Compilers

GNU libiconv

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

GNU libcurl

  • Add the opencsw repsitory.
  • Install libcurl_dev: sudo /opt/csw/bin/pkgutil -y -i libcurl_dev /opt/csw/bin/pkgutil -y -i libcurl4_feature

Java (recommended)

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

pdflatex (optional)

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

Build r-base

mkdir -p ~/R/build
cd ~/R/build
RVERSION=3.5.1
wget http://cran.rstudio.com/src/base/R-3/R-${RVERSION}.tar.gz
tar xzvf R-${RVERSION}.tar.gz
cd ${RVERSION}
rm config.site
## Copy new config.site into R dir
PATH=$PATH:/opt/developerstudio12.6/bin
./configure --prefix=/opt/R-${RVERSION} --with-blas='-library=sunperf' --with-lapack
make
sudo mkdir -p /opt/R-${RVERSION}/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