[Rd] R CMD SHLIB flags

Dirk Eddelbuettel edd at debian.org
Thu Jul 27 02:47:37 CEST 2006


On 26 July 2006 at 16:59, Thomas Lumley wrote:
| 
| How can one specify multiple extra flags to R CMD SHLIB?  The example in 
| R-exts section 5.5
|     MAKEFLAGS="CFLAGS=-O3" R CMD SHLIB *.c
| works for a single flag, but when I try
|     MAKEFLAGS="CFLAGS=-g -O2 -Wall" R CMD SHLIB *.c
| only the first flag is used and the rest seem to be ignored (version 
| 2.3.1, Mac OS X)

As it seems to break at the space, escaping those seems to help:

edd at basebud:~/src/debian/CRAN/tseries-0.10-3/src> MAKEFLAGS='CFLAGS=-g\ -O2\ -Wall' R CMD SHLIB *.c
gcc -I/usr/share/R/include -I/usr/share/R/include     -fpic  -g -O2 -Wall -c arma.c -o arma.o
gcc -I/usr/share/R/include -I/usr/share/R/include     -fpic  -g -O2 -Wall -c bdstest.c -o bdstest.o
gcc -I/usr/share/R/include -I/usr/share/R/include     -fpic  -g -O2 -Wall -c boot.c -o boot.o
gcc -I/usr/share/R/include -I/usr/share/R/include     -fpic  -g -O2 -Wall -c garch.c -o garch.o
gcc -I/usr/share/R/include -I/usr/share/R/include     -fpic  -g -O2 -Wall -c ppsum.c -o ppsum.o
gcc -I/usr/share/R/include -I/usr/share/R/include     -fpic  -g -O2 -Wall -c tsutils.c -o tsutils.o
gcc -shared  -o arma.so arma.o bdstest.o boot.o garch.o ppsum.o tsutils.o -lblas-3 -lgfortran -lm -lgcc_s  -L/usr/lib/R/lib -lR
edd at basebud:~/lan/chibud/src/debian/CRAN/tseries-0.10-3/src> MAKEFLAGS='CFLAGS=-g\ -O2\ -Wall' R CMD SHLIB *.c

Using bash on Debian.  Does that work for you on Mac OS X too?

Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison



More information about the R-devel mailing list