Hi Jeroen, On 1 December 2013 at 17:52, Jeroen Ooms wrote: | Hi all :) | | I'm experiencing an issue with building Rcpp packages inside the OpenCPU | sandbox. I think this issue was introduced with the upgrade to Rcpp 0.10.6. The
I don't think this is us, and I don't think something changed. See below. | problem is that g++ seems to ignore the TMPDIR environment variable, and | instead always tries to use the default /tmp. When /tmp is not writable, this | causes the compiling to fail. | | I am personally using RAppArmor to enforce these security policies, but an | easier way to reproduce the problem is by temporarily disable write access to / | tmp. Something like this: | | #force custom TMP directory, replace jeroen with your username | cd /tmp | sudo mkdir test | sudo chown jeroen test | sudo chgrp jeroen test | sudo chmod 755 /tmp | TMPDIR=/tmp/test bash -c R This should pass through to shells spawned. First, straight bash: edd@max:~$ FOOBAR=/bing bash edd@max:~$ echo $FOOBAR /bing edd@max:~$ exit Second, R edd@max:~$ FOOBAR=/bing R -q -e 'system("echo $FOOBAR")' R> system("echo $FOOBAR") /bing R> R> edd@max:~$ | #then in R do: | tempdir() #check | install.packages("RcppExamples") #or any other rcpp package Note that install.packages() is a base R function, and not anything Rcpp adds. We do have a few system() calls here or there for Rcpp Attributes and the like. | The process fails with 'Fatal error: creating temporary file for '-e' failed -L | /usr/lib/R/lib -lR'. When using AppArmor, the error is actually more detailed | and says that g++ tried to create a file /tmp/tmpfDbJ9KD. | | How can I make g++ use the same TMPDIR as the R process? I think I'd start by setting TMPDIR. But here (in a virtual machine) I can't even make g++ fail: edd@billie:~/maxHome/tmp/jeroen$ cat hello.cpp #include <iostream> int main(void) { std::cout << "Hello Jeroen\n"; return 0; } edd@billie:~/maxHome/tmp/jeroen$ edd@billie:~/maxHome/tmp/jeroen$ g++ -o hello hello.cpp && ./hello Hello Jeroen edd@billie:~/maxHome/tmp/jeroen$ mkdir /tmp/test; sudo chown edd:edd /tmp/test; sudo chmod 0755 /tmp/test edd@billie:~/maxHome/tmp/jeroen$ rm hello && TMPDIR=/tmp/test g++ -o hello hello.cpp && ./hello Hello Jeroen edd@billie:~/maxHome/tmp/jeroen$ 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