Re: [Rd] Turning off compiler optimization

2008-11-20 Thread Prof Brian Ripley
Use .R/Makeconf: see 'R Installation and Administration' section 6.3.3. On Thu, 20 Nov 2008, Michael Braun wrote: Hi. I am writing some code in C that I would like to link into R. My Makevars file is: PKG_CPPFLAGS=-I/usr/local/include PKG_LIBS=-L/usr/local/lib -lgsl PKG_CFLAGS = -Wall -O0 -

Re: [Rd] Turning off compiler optimization

2008-11-20 Thread Dirk Eddelbuettel
On 20 November 2008 at 15:25, Michael Braun wrote: | Hi. I am writing some code in C that I would like to link into R. | | My Makevars file is: | | PKG_CPPFLAGS=-I/usr/local/include | PKG_LIBS=-L/usr/local/lib -lgsl | PKG_CFLAGS = -Wall -O0 -g -p -pg | | The source file is core.c,. and I am co

Re: [Rd] Turning off compiler optimization

2008-11-20 Thread Kasper Daniel Hansen
This is what I am using, suggested a long time ago by Simon Urbanek. I would really like a good way way to override optimization flags - in my package I have code that does not work with -O2. I use the following lines in my Makevars MYCXXFLAGS=-O0 %.o: %.cpp $(CXX) $(ALL_CPPFLAGS)

[Rd] Turning off compiler optimization

2008-11-20 Thread Michael Braun
Hi. I am writing some code in C that I would like to link into R. My Makevars file is: PKG_CPPFLAGS=-I/usr/local/include PKG_LIBS=-L/usr/local/lib -lgsl PKG_CFLAGS = -Wall -O0 -g -p -pg The source file is core.c,. and I am compiling using R CMD SHLIB core.c The output is gcc -arch x86_64