Balasubramanian Narasimhan November 1, 2019
- Macbook pro running MacOS 10.15.1
- Virtual Box Version 6.0.14 r133895 (Qt5.6.3)
- Enable function keys to work as standard function keys via system preferences for setup of Solaris and set it back as needed
- I do everything as
root
(a bit lazy, yes) and so I create a directory/root
where I keep files, sources and build things, including theconfig.site
andmapfile
referenced below.
The config.site
provides all the flags for building with Oracle
Developer Studio and override default settings. Note the reference to a
mapfile
which I place in /root/mapfile
(more below).
#! /bin/sh
## From Solaris specs on CRAN
CC='cc -xc99'
CPPFLAGS="-I/opt/csw/include -I/usr/local/include"
LDFLAGS="-L/opt/csw/lib -L/usr/local/lib -M/root/mapfile"
CFLAGS='-O -xlibmieee -xlibmil -xtarget=native -xcache=generic -nofstore'
FC=f95
FFLAGS='-O -libmil -xtarget=native -xcache=generic -nofstore'
CXX=CC
CXXSTD="-std=c++11 -library=stdcpp,CrunG3"
CXXFLAGS="-O -xlibmil -xtarget=native -xcache=generic -nofstore"
CXX98STD="-compat=g -library=stdcpp,CrunG3"
CXX11STD=$CXXSTD
SAFE_FFLAGS="-O -fstore"
FCLIBS_XTRA="-lfsu /opt/developerstudio12.6/lib/libfui.so.2"
R_LD_LIBRARY_PATH="/opt/developerstudio12.6/lib:/usr/local/lib:/opt/csw/lib"
The mapfile
below is something that overrides assumptions the
compilers make about hardware; see
reference.
Without this fix, expect a strange error about sysdata
not being
loaded! My goal is not speed, but mere checking, so I go with the bare
minimum.
$mapfile_version 2
CAPABILITY {
HW = ;
};
A one-time setup!
- Dowload template from Oracle.
- Import appliance (
.ova
file) into vbox. - After import, tweak settings
- System/Motherboard: Base Memory 8G, 1 processor
- Display/Video Memory: 32Mb
- General/Advanced: Enable Shared Clipboard
- Shared Folders: Local Downloads folder (
Folder Name: Downloads
), automounted to Solaris (Mount point: Downloads
), although it is seen at/mnt/sf_Downloads
! - Save settings
- Boot into Solaris for the first time.
- Choose timezone, and en_US.UTF-8 as Locale
- Setup root password which we will use for everything
- To avoid hassles, decline
NIS+
orNIS
and just go withDNS
(which is what I do), or even none if you don’t know what those terms mean. (The latter, however, could be limiting for dns name resolution and downloads.) - Go with default for all else
A one-time setup unless the version of Developer Studio changes!
- Log in as
root
. (As noted earlier I do everything asroot
.) - Create a directory called
/root
and saveconfig.site
andmapfile
above there. - Install Developer Studio (v12.6 as of this writing)
- Download Oracle Developer Studio tar gz file
- Unzip, untar, install and patch.
bzcat -d OracleDeveloperStudio12.6-solaris-x86-pkg.tar.bz2 | tar xf -
cd OracleDeveloperStudio12.6-solaris-x86-pkg
./developerstudio.sh --non-interactive
./install_patches.sh
A one-time setup.
- Install needed packages from Open CSW Project tree
pkgadd -d http://get.opencsw.org/now
/opt/csw/bin/pkgutil -U
/opt/csw/bin/pkgutil -y -i libiconv_dev libz_dev libreadline_dev liblzma_dev libpcre_dev libcurl_dev libssh2_dev libssl_dev libcares_dev librtmp_dev libkrb5_dev libk5crypto3 liblber2_4_2 libbrotli_dev libicu_dev pkg-config gmake texlive gtar curl wget emacs
- Add symbolic link manually, otherwise, expect (incorrect) error message about curl version during configure!
ln -s /opt/csw/lib/liblber-2.4.so.2 /opt/csw/lib/liblber.so
Repeat with each release of R.
I build in /root
and install to /root/RHOME
. Always build
R-patched
first since R-devel
can be unstable leaving you wondering
if the toolchain is wrong or the R-devel source is unstable!
- Set up environment and directory
mkdir /root
export PATH=/usr/ccs/bin:/opt/developerstudio12.6/bin:/usr/sfw/bin:/usr/xpg4/bin:/usr/xpg6/bin::/opt/csw/bin:$PATH
cd /root
mkdir RHOME ## where R will land
- Download
R-devel.tar.gz
orR-patched.tar.gz
and untar. - Copy above
config.site
over the suppliedconfig.site
inR-devel
orR-patched
directory - Configure and make in the main source directory
./configure --prefix=/root/RHOME --enable --with-internal-tzcode
make
make install
- Add
/root/RHOME
to path and invoke R
export PATH=$PATH/RHOME/bin:$PATH
R
Repeat with each release of R.
Repeat 1.4 with R-devel sources.
Avoid this if you can. Solaris X window server is appalling, is blindingly slow, hangs and crashes. But the following should work.
One time setup.
- Download template from Oracle.
- Import appliance (
.ova
file) into vbox. - After import, tweak settings
- System: Base Memory 8G, 2 processors
- Display: 32Mb
- Shared Folders: Local Downloads folder (
Name: Downloads
), automounted to Solaris (/Downloads
), although it is see at/mnt/sf_Downloads
! - Disable audio on Solaris 11 or it will freeze over and over!
- Save settings
- Boot into Solaris for the first time.
- Choose timezone, and en_US.UTF-8 as Locale
- Setup root password and a standard account
- Go with default for all else.
- Log in as user, decline location services and online accounts synchronization. Exit the welcome app and reboot to be safe
A one-time setup unless the version of Developer Studio changes!
- Install Developer Studio (v12.6 as of this writing)
- Download certificate and keys
- Request access and follow instructions on solaris machine.
- Update everything:
sudo pkg update
From 1.3 onwards.
- To check/install a package which has
GNU Make
as a systems requirement, use
MAKE=gmake R CMD ...
- Some packages cannot be installed using the Oracle development tools. The only recourse is the GNU tools. For this purpose, one needs to jump through several hoops.
- Setup a directory
~/.R/Makevars
file with the following contents
CC=gcc
CFLAGS=-m32 -I/opt/csw/include -I/usr/local/include
CPPFLAGS=-m32 -I/opt/csw/include -I/usr/local/include
CPICFLAGS=
CXXPICFLAGS=
CXXSTD=
F77=gfortran
F77FLAGS=-m32
CXX=g++
CXXFLAGS=-m32 -I/opt/csw/include -I/usr/local/include
FC=$F77
LDFLAGS=-L/opt/csw/lib -L/usr/local/lib
I also set my path as follows
export PATH=/opt/csw/gnu:/root/RHOME/bin:$PATH
so that the OpenCSW tools are found first. After this you can install
packages like stringi
which is needed by stringr
which is needed for
knitr
. When done, move the directory back to ~/.R-gnu
to keep for
future use.