Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@arraytools
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arraytools/684a316f09a350a9850f to your computer and use it in GitHub Desktop.
Save arraytools/684a316f09a350a9850f to your computer and use it in GitHub Desktop.
build-R-base-on-git
# sudo apt-get update
# sudo apt-get install git
# sudo apt-get build-dep r-base
# about 350MB as of R 3.2.0
git clone https://github.com/wch/r-source.git
cd r-source
R_PAPERSIZE=letter \
R_BATCHSAVE="--no-save --no-restore" \
R_BROWSER=xdg-open \
PAGER=/usr/bin/pager \
PERL=/usr/bin/perl \
R_UNZIPCMD=/usr/bin/unzip \
R_ZIPCMD=/usr/bin/zip \
R_PRINTCMD=/usr/bin/lpr \
LIBnn=lib \
AWK=/usr/bin/awk \
CC="ccache gcc" \
CFLAGS="-ggdb -pipe -std=gnu99 -Wall -pedantic" \
CXX="ccache g++" \
CXXFLAGS="-ggdb -pipe -Wall -pedantic" \
FC="ccache gfortran" \
F77="ccache gfortran" \
MAKE="make"
(cd doc/manual && make front-matter html-non-svn)
rm -f non-tarball
echo -n 'Revision: ' > SVN-REVISION
git log --format=%B -n 1 \
| grep "^git-svn-id" \
| sed -E 's/^git-svn-id: https:\/\/svn.r-project.org\/R\/.*?@([0-9]+).*$/\1/' \
>> SVN-REVISION
echo -n 'Last Changed Date: ' >> SVN-REVISION
git log -1 --pretty=format:"%ad" --date=iso | cut -d' ' -f1 >> SVN-REVISION
# make distclean
### The instruction in this section is for Ubuntu 12.04.
# Note since zlib has been removed from R-3.2.0 src/extra, Ubuntu 12.04 will need to install zlib
# from its source in order to meet the requirment (zlib 1.2.5 from 2010)
# since Ubuntu 12.04 only supplies zlib 1.2.3 from July 2005.
# http://r.789695.n4.nabble.com/About-removing-zlib-from-R-devel-td4705134.html
# To upgrade zlib to the latest and set up environment variables to compile R:
# wget http://zlib.net/zlib-1.2.8.tar.gz
# tar xzvf zlib-1.2.8.tar.gz
# cd zlib-1.2.8/
# ./configure --prefix=/usr/local/zlib
# make
# sudo make install
# export LD_LIBRARY_PATH=/usr/local/zlib/lib
# export C_INCLUDE_PATH=/usr/local/zlib/include
# R-3.2.0 requires texi2any v5.1. So we need to install/bulid a new one from its source.
# wget http://ftp.gnu.org/gnu/texinfo/texinfo-5.2.tar.gz
# tar xzvf texinfo-5.2.tar.gz
# cd texinfo-5.2/
# ./configure --prefix=/usr/local/texinfo
# make
# sudo make install
# export PATH=$PATH:/usr/local/texinfo
time (./configure --with-recommended-packages=no && make --jobs=5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment