Setup script to create the binary installer for the released clang binaries used to compile R
This installer has been superceded by the
r-macOS-rtools installer,
which automatically installs and configures the R toolchain for
compiled code on macOS, e.g. XCode Command Line Tools, clang4
,
and gfortran
.
clang4
R Binaries The repository contains the scripts used to create a macOS installer package (.pkg
)
for the clang4
binaries. For those interested, the installer can be obtained
on either the project's Release page
or through http://go.illinois.edu/r-macos-clang-pkg.
The pre-built binaries this installer setups during the installation can be found at: http://r.research.att.com/libs/.
The scripts have the potential to be generalized further so that
.pkg
installers are available to be created for all binaries
listed on http://r.research.att.com/libs/.
Financial support was provided to sign the installer by Professor Timothy Bates of the University of Edinburgh.
Download it from http://go.illinois.edu/r-macos-clang-pkg, open the installer by right clicking to bring up menu and selecting "Open". From here, navigate through it like a normal macOS installer.
If you have yet to install Xcode Command Line Interface Tools ("Xcode CLI"), you will then need to open Terminal (Applications/Utilities/Terminal) and type:
xcode-select --install
That's it. Once installed, you can start using compiled code
in R like normal with the added benefit of OpenMP
.
If you want to see behind the curtain, continue reading...
The clang4-r
installer performs two actions that require
the users password to accomplish. These actions are:
/usr/local/clang4
directoryCC
, CXX
, CXX**
,
and LDFLAGS
in the ~/.R/Makevars
fileIn essence, it provides a graphical user interface installation guide,
more secure path manipulation, and a smarter handling of a pre-existing ~/.R/Makevars
when compared to the following pure bash approach:
# Download binary
curl -O http://r.research.att.com/libs/clang-4.0.0-darwin15.6-Release.tar.gz
# Extract binary onto root directory
tar fvxz clang-4.0.0-darwin15.6-Release.tar.gz -C /
# Overwrites ~/.R/Makevars file if present otherwise creates it
cat <<- EOF > ~/.R/Makevars
# The following statements are required to use the clang4 binary
CC=/usr/local/clang4/bin/clang
CXX=/usr/local/clang4/bin/clang++
CXX1X=/usr/local/clang4/bin/clang++
CXX98=/usr/local/clang4/bin/clang++
CXX11=/usr/local/clang4/bin/clang++
CXX14=/usr/local/clang4/bin/clang++
CXX17=/usr/local/clang4/bin/clang++
LDFLAGS=-L/usr/local/clang4/lib
# End clang4 inclusion statements
EOF
# Install Xcode CLI tools
xcode-select --install
Thanks to the financial support provided by Professor Timothy Bates of the University of Edinburgh to join the Apple Developer program. The installer is now signed using developer credentials.
As a result, the installer should have a "lock" icon in the upper right corner:
Clicking the lock icon will reveal the signed developer certificate:
With this being said, the code used to generate the installer has been made publically available under an open source license (GPL >= 2).
Below is an abridged version of the actions of each file provided.
download_files.sh
clang-4.0.0-darwin15.6-Release.tar.gz
from
http://r.research.att.com/libs/ and extracts it into a temporary ROOT/
directory
established in the working directoryscripts/postinstall
~/.R/Makevars
file with the necessary implicit variables
to compile with clang4.make_installer.sh
.pkg
pkgbuild
productbuild
to create a distribution.xml
distribution.xml
(title, background, ...)productbuild
to rebuild the package.distribution.xml
build_files/Rlogo.png
build_files/LICENSE.rtf
build_files/WELCOME_DISPLAY.rtf
GPL (>= 2)