From edd at debian.org  Thu Jul 27 02:47:37 2006
From: edd at debian.org (Dirk Eddelbuettel)
Date: Wed, 26 Jul 2006 19:47:37 -0500
Subject: [Rd] R CMD SHLIB flags
In-Reply-To: <Pine.LNX.4.64.0607261632410.13929@homer23.u.washington.edu>
References: <Pine.LNX.4.64.0607261632410.13929@homer23.u.washington.edu>
Message-ID: <17608.3369.321430.848590@basebud.nulle.part>


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



[Rd] R CMD SHLIB flags
Dirk Eddelbuettel