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

2013-07-11 Thread Dirk Eddelbuettel

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@lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


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

2013-07-11 Thread Anwar Ludin
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 e...@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@lists.r-forge.r-project.org
 | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
 
 -- 
 Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com

___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


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

2013-07-11 Thread Dirk Eddelbuettel

Anwar,

On 12 July 2013 at 01:42, Anwar Ludin wrote:
| 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

I suspect these stem from R's own configuration, set at its compile time.
Try this:

edd@max:~$ R CMD config CPPFLAGS

edd@max:~$ R CMD config CXXFLAGS 
-g -O3 -Wall -pipe -Wno-unused -pedantic
edd@max:~$ R CMD config CXXPICFLAGS
-fpic
edd@max:~$ 

See 'R CMD CONFIG --help' for more, and the $RHOME/etc/Makeconf file for the
settings.

Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel