Skip to content

Instantly share code, notes, and snippets.

@tvatter
Forked from jeroen/config.site
Created August 10, 2018 21:36
Show Gist options
  • Save tvatter/b2503f03fcd604ff764ffe4b979afcb6 to your computer and use it in GitHub Desktop.
Save tvatter/b2503f03fcd604ff764ffe4b979afcb6 to your computer and use it in GitHub Desktop.
Building R on Solaris
## Copy this file into config.site ##
CC="cc -xc99"
CFLAGS="-O -xlibmieee -xlibmil -xtarget=native -nofstore"
F77="f95"
FFLAGS='-O -libmil -xtarget=native -nofstore'
CXX="CC -library=stlport4"
CXXFLAGS="-O -xlibmil -xtarget=native -nofstore"
CXX1X="/opt/csw/bin/g++"
CXX1XFLAGS="-O2"
CXX1XPICFLAGS=-fPIC
FC=$F77
FCFLAGS=$FFLAGS
SAFE_FFLAGS="-O -fstore"
FCLIBS=-lfsu
R_LD_LIBRARY_PATH="/opt/developerstudio12.5/lib:/usr/local/lib:/opt/csw/lib"

Requirements

  • Free Oracle account
  • VirtualBox

Notes

  • The following tries to replicate the CRAN builds config.
  • 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.5 compiler instead (because CRAN)

Setup

  • Download Solaris 10 VM for VirtualBox
  • Double Click image to open in Virtualbox
  • In virtual box "Devices" menu, enable share clipboard bewteen guest/host (bidirectional).
  • Click though menu to setup server.
  • Log as root.
  • Use kbd -s to change keyboard layout, log-out and log-on to activate.

Compilers

  • Like CRAN, we use Oracle Studio 12.5
  • Dowload Oracle Studio 12.5
  • Unpack the using bzip2 -d OracleDeveloperStudio12.5-solaris-x86-pkg.tar.bz2 and tar -xvf OracleDeveloperStudio12.5-solaris-x86-pkg.tar
  • Go in the folder cd OracleDeveloperStudio12.5-solaris-x86-pkg
  • If not enough space in temp dir when running ./developerstudio.sh, do mkdir ../temp and ./developerstudio.sh --tempdir ../temp

GNU libiconv

  • Add the opencsw repsitory.
  • Install GNU iconv: /opt/csw/bin/pkgutil -y -i libiconv_dev
  • Install GNU readline: /opt/csw/bin/pkgutil -y -i libreadline6
  • Install GNU gcc5: /opt/csw/bin/pkgutil -y -i gcc5core
  • Install GNU wget /opt/csw/bin/pkgutil -y -i wget

Build r-base

/opt/csw/bin/wget http://cran.rstudio.com/src/base/R-3/R-3.5.1.tar.gz
gunzip -d R-3.5.1.tar.gz
tar xvf R-3.5.1.tar
cd R-3.5.1
rm config.site
## Copy new config.site into R dir
PATH=$PATH:/opt/developerstudio12.5/bin
./configure --prefix=/opt/R --with-readline=no --with-internal-tzcode
make
sudo mkdir -p /opt/R/lib/R/lib
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment