[Rcpp-devel] how to pass -fPIC instead of -fpic when building rccp package

Anwar Ludin anwar.ludin at riskcetera.com
Fri Jul 12 01:42:06 CEST 2013


Hi Dirk,

Yes I agree, I'm just having issues with the way the build process works, so let's make it a Rcpp problem ;)

>library(Rcpp)
>Rcpp.package.skeleton("testpackage")

R CMD INSTALL --preclean --no-multiarch testpackage

icpc -I/usr/include/R -DNDEBUG  -I/usr/local/include -I"/usr/lib64/R/library/Rcpp/include"   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c rcpp_hello_world.cpp -o rcpp_hello_world.o
icpc -shared -L/usr/local/lib64 -o testpackage.so rcpp_hello_world.o -L/usr/lib64/R/library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/lib64/R/library/Rcpp/lib -L/usr/lib64/R/lib -lR
installing to /home/aludin/R/x86_64-redhat-linux-gnu-library/3.0/testpackage/libs

Here I'm using the Intel compiler as specified in my ~/.R/Makevars file:

CC=icc
CXX=icpc
CFLAGS=-g -O -mtune=native

So basically I have no idea where all the extra flags come from, in particular -fexceptions -fstack-protector & -fpic

I want to get rid of the -fstack-protector & -fpic flags

Cheers,

Anwar 




On Jul 12, 2013, at 12:44 AM, Dirk Eddelbuettel <edd at debian.org> wrote:

> 
> On 11 July 2013 at 15:12, Anwar Ludin wrote:
> | Hello,
> | 
> | When building a rcpp package is there a way of forcing -fPIC instead of -fpic during package compilation? I 'm using RStudio as my main IDE and the package is built using
> 
> That is an RStudio question, and they have it all documented.
> 
> Set it under (IIRC) project options, else use ~/.R/Makevars and have it work
> for all R compilation, inside or outside of RStudio.
> 
> Dirk
> 
> | R CMD INSTALL --preclean --no-multiarch <package_compilation>
> | 
> | Thanks!
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
> 
> -- 
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



More information about the Rcpp-devel mailing list