[R-sig-Debian] difference between install from source and install from repositories

Dirk Eddelbuettel edd at debian.org
Thu Sep 18 17:17:03 CEST 2014


On 18 September 2014 at 15:03, Pratibha Rana wrote:
| What is the difference between the R installation from source and the R
| installation from ubuntu repositories. Specifically when I install
| R-3.1.1 on ubuntu 14.04 from sources ldflags and CXXFLAGS are different
| that those from the installation from a repo.

R records the arguments it receives from the 'configure' call.  As a
convenience measure, you can access these via a softlinked file in
/etc/R/Makeconf which makes it easy to read and study.
 
| Installation from sources:
| 
| R CMD config --ldflags
| 
| -Wl,--export-dynamic -fopenmp  -L/home/prana/prana_R/third-party/install/lib/R/lib -lR -lrt -ldl -lm
| 
| R CMD config CXXFLAGS
| 
| 
| 
| Installation from repo:
| 
|  R CMD config --ldflags
| 
| -Wl,--export-dynamic -fopenmp  -L/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm
| 
| R CMD config CXXFLAGS
| 
| -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g
| 
| These are the steps that I followed to install from sources
| 
| ./configure  --enable-R-shlib --with-x=no --with-readline=no
| --prefix=/home/prana/software/install/
| make
| make install

And I as Debian maintainer use a different set of values. See debian/rules
which thanks to some fine work by Zach and others you can even browse via the
web:

   http://sources.debian.net/src/r-base/3.1.1-1/debian/rules/

The file is long and somewhat convoluted as it has grown over 15 or so
years.  But the values chosen are in alignment with the Debian Policy which
is documented in other places.

In short, we have "-lpcre -llzma -lbz2 -lz -lrt -ldl" because we use external
libraries where possible. 

On more current systems CXXFLAGS is even longer:

edd at max:~$ R CMD config CXXFLAGS
-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -O3 -Wall -pipe -Wno-unused -pedantic
edd at max:~$ 

because I (finally) turned on some security-related switches.  This is on my
Ubuntu 14.04 system at home using the Ubuntu binaries available at CRAN
thanks to the backported builds run by Michael (see the README on each CRAN
mirror $CRAN_mirror/bin/linux/ubuntu/ )


Now:  for your day-to-day work with R __none of this should matter__.  

If you think it does, a reproducible example would help.

Hope this helps.  

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-SIG-Debian mailing list