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

Pratibha Rana prana at Vertica.com
Thu Sep 18 17:50:32 CEST 2014


On 09/18/2014 11:16 AM, Dirk Eddelbuettel wrote:
> 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.
I see . I'll take a look at that and see if I can bring my source
installation at parity.
>  
> | 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.
I do have an example which goes into an infinite recursion while
creating a NumericVector if I try to run it on an installation from
sources but runs fine on an installation from the repository. But if you
start looking at the code, most of it doesn't do anything useful since I
trimmed down the original code as much as possible in my attempt to
isolate the problem. But in the current code if I try to trim any piece
of code the problem goes away. I understand that the reproducer is not
as minimal as it should be, but in my defence the bug is wierd and
commenting out even seemingly harmless code makes the code work. Try
commenting out any of the functions in RInterface.cpp and the code works
just fine. Also the same piece of code works in one function but not the
other.
>
> Hope this helps.  
>
> Dirk
>



More information about the R-SIG-Debian mailing list