Re: [R] src/Makevars ignored ?

2016-09-27 Thread Martin Morgan

On 09/26/2016 07:46 AM, Eric Deveaud wrote:



Hello,

as far as I understood the R library generic compilation mechanism,
compilation of C//C++ sources is controlde

1) at system level by the ocntentos RHOME/etc/Makeconf
2) at user level by the content of ~/.R/Makevars
3) at package level by the content of src/Makevars

Problem I have is that src/Makevars is ignored


see following example:

R is compiled and use the following CC and CFLAGS definition

bigmess:epactsR/src > R CMD config CC
gcc -std=gnu99
bigmess:epactsR/src > R CMD config CFLAGS
-Wall -g

so building C sources lead to the following

bigmess:epactsR/src > R CMD SHLIB index.c
gcc -std=gnu99 -I/local/gensoft2/adm/lib64/R/include -DNDEBUG
-I/usr/local/include-fpic  -Wall -g  -c index.c -o index.o

normal, it uses defintion from RHOME/etc/Makeconf


when I set upp a ~/.R/Makevars that overwrite CC and CFLAGS definition.

bigmess:epactsR/src > cat ~/.R/Makevars
CC=gcc
CFLAGS=-O3
bigmess:epactsR/src > R CMD SHLIB index.c
gcc -I/local/gensoft2/adm/lib64/R/include -DNDEBUG  -I/usr/local/include
   -fpic  -O3 -c index.c -o index.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o index.so index.o


OK CC and CFLAGS are honored and set accordingly to ~/.R/Makevars


but when I try to use src/Makevars, it is ignored

bigmess:epactsR/src > cat ~/.R/Makevars
cat: /home/edeveaud/.R/Makevars: No such file or directory
bigmess:epactsR/src > cat ./Makevars
CC = gcc
CFLAGS=-O3
bigmess:epactsR/src > R CMD SHLIB index.c
gcc -std=gnu99 -I/local/gensoft2/adm/lib64/R/include -DNDEBUG
-I/usr/local/include-fpic  -Wall -g  -c index.c -o index.o


what I have missed or is there something wrong ?


Use PKG_CFLAGS instead of CFLAGS; CC cannot be changed in Makevars. See 
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-Makevars


Martin Morgan




PS I tested the ssame behaviour with various version of R from R/2.15 to
R/3.3

best regards

Eric

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



This email message may contain legally privileged and/or...{{dropped:2}}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] src/Makevars ignored ?

2016-09-26 Thread Jeff Newmiller
You failed to read the Posting Guide, which would have told you which mailing 
list to post this question to. (Hint: not this one.)
-- 
Sent from my phone. Please excuse my brevity.

On September 26, 2016 4:46:06 AM PDT, Eric Deveaud  wrote:
>
>
>   Hello,
>
>as far as I understood the R library generic compilation mechanism, 
>compilation of C//C++ sources is controlde
>
>1) at system level by the ocntentos RHOME/etc/Makeconf
>2) at user level by the content of ~/.R/Makevars
>3) at package level by the content of src/Makevars
>
>Problem I have is that src/Makevars is ignored
>
>
>see following example:
>
>R is compiled and use the following CC and CFLAGS definition
>
>bigmess:epactsR/src > R CMD config CC
>gcc -std=gnu99
>bigmess:epactsR/src > R CMD config CFLAGS
>-Wall -g
>
>so building C sources lead to the following
>
>bigmess:epactsR/src > R CMD SHLIB index.c
>gcc -std=gnu99 -I/local/gensoft2/adm/lib64/R/include -DNDEBUG 
>-I/usr/local/include-fpic  -Wall -g  -c index.c -o index.o
>
>normal, it uses defintion from RHOME/etc/Makeconf
>
>
>when I set upp a ~/.R/Makevars that overwrite CC and CFLAGS definition.
>
>bigmess:epactsR/src > cat ~/.R/Makevars
>CC=gcc
>CFLAGS=-O3
>bigmess:epactsR/src > R CMD SHLIB index.c
>gcc -I/local/gensoft2/adm/lib64/R/include -DNDEBUG 
>-I/usr/local/include 
>-fpic  -O3 -c index.c -o index.o
>gcc -std=gnu99 -shared -L/usr/local/lib64 -o index.so index.o
>
>
>OK CC and CFLAGS are honored and set accordingly to ~/.R/Makevars
>
>
>but when I try to use src/Makevars, it is ignored
>
>bigmess:epactsR/src > cat ~/.R/Makevars
>cat: /home/edeveaud/.R/Makevars: No such file or directory
>bigmess:epactsR/src > cat ./Makevars
>CC = gcc
>CFLAGS=-O3
>bigmess:epactsR/src > R CMD SHLIB index.c
>gcc -std=gnu99 -I/local/gensoft2/adm/lib64/R/include -DNDEBUG 
>-I/usr/local/include-fpic  -Wall -g  -c index.c -o index.o
>
>
>what I have missed or is there something wrong ?
>
>
>PS I tested the ssame behaviour with various version of R from R/2.15
>to 
>R/3.3
>
>   best regards
>
>   Eric
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] src/Makevars ignored ?

2016-09-26 Thread Eric Deveaud



Hello,

as far as I understood the R library generic compilation mechanism, 
compilation of C//C++ sources is controlde


1) at system level by the ocntentos RHOME/etc/Makeconf
2) at user level by the content of ~/.R/Makevars
3) at package level by the content of src/Makevars

Problem I have is that src/Makevars is ignored


see following example:

R is compiled and use the following CC and CFLAGS definition

bigmess:epactsR/src > R CMD config CC
gcc -std=gnu99
bigmess:epactsR/src > R CMD config CFLAGS
-Wall -g

so building C sources lead to the following

bigmess:epactsR/src > R CMD SHLIB index.c
gcc -std=gnu99 -I/local/gensoft2/adm/lib64/R/include -DNDEBUG 
-I/usr/local/include-fpic  -Wall -g  -c index.c -o index.o


normal, it uses defintion from RHOME/etc/Makeconf


when I set upp a ~/.R/Makevars that overwrite CC and CFLAGS definition.

bigmess:epactsR/src > cat ~/.R/Makevars
CC=gcc
CFLAGS=-O3
bigmess:epactsR/src > R CMD SHLIB index.c
gcc -I/local/gensoft2/adm/lib64/R/include -DNDEBUG  -I/usr/local/include 
   -fpic  -O3 -c index.c -o index.o

gcc -std=gnu99 -shared -L/usr/local/lib64 -o index.so index.o


OK CC and CFLAGS are honored and set accordingly to ~/.R/Makevars


but when I try to use src/Makevars, it is ignored

bigmess:epactsR/src > cat ~/.R/Makevars
cat: /home/edeveaud/.R/Makevars: No such file or directory
bigmess:epactsR/src > cat ./Makevars
CC = gcc
CFLAGS=-O3
bigmess:epactsR/src > R CMD SHLIB index.c
gcc -std=gnu99 -I/local/gensoft2/adm/lib64/R/include -DNDEBUG 
-I/usr/local/include-fpic  -Wall -g  -c index.c -o index.o



what I have missed or is there something wrong ?


PS I tested the ssame behaviour with various version of R from R/2.15 to 
R/3.3


best regards

Eric

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.