osklyar at gmx.com
2009-Dec-27 19:25 UTC
[Rd] R CMD SHLIB on Mac OS X fails when the default tempdir() is used (PR#14168)
This is prompted by trying to run the 'inline' package on Mac OS X Leopard with R 2.10.1. Mac uses completely crazy temp paths and R uses those as well. The inline package creates source files in the temp directory which it then compiles with R CMD SHLIB and attaches. The compilation fails with the error message below which seems to be caused by the complexity of the path (compiling the same file with R CMD SHLIB and a sane path is ok, see below). What can look like an inline problem, in fact is not inline's as it fails in exactly the same way when run from a command line (see below). It fails on c, cpp, f files. For the inline package, I will get a workaround by setwd to the location of the code and then setwd back, but generally one should be able to run R CMD SHLIB with any valid path, at least this one contains only alphanumerics and + and -. Best, Oleg Browse[2]> system("/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB /var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-/RtmpGzn3kA/file60b7acd9.cpp") Error in sub(p0(base, "."), "", a) :=20 invalid regular expression '/var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-/RtmpGzn3kA/file60b7acd9.' Calls: <Anonymous> -> .shlib_internal -> sub In addition: Warning message: In sub(p0(base, "."), "", a) : regcomp error: 'Invalid use of repetition operators' Execution halted Browse[2]> system("R CMD SHLIB /var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-/RtmpGzn3kA/file60b7acd9.cpp") Error in sub(p0(base, "."), "", a) :=20 invalid regular expression '/var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-/RtmpGzn3kA/file60b7acd9.' Calls: <Anonymous> -> .shlib_internal -> sub In addition: Warning message: In sub(p0(base, "."), "", a) : regcomp error: 'Invalid use of repetition operators' Execution halted Browse[2]> tempdir() [1] "/var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-//RtmpGzn3kA" Browse[2]> sessionInfo() R version 2.10.1 (2009-12-14)=20 x86_64-apple-darwin9.8.0=20 locale: [1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base=20=20=20=20=20 other attached packages: [1] inline_0.3.3.1 bash-3.2$ R CMD SHLIB /var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-/RtmpGzn3kA/file60b7acd9.cpp Error in sub(p0(base, "."), "", a) :=20 invalid regular expression '/var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-/RtmpGzn3kA/file60b7acd9.' Calls: <Anonymous> -> .shlib_internal -> sub In addition: Warning message: In sub(p0(base, "."), "", a) : regcomp error: 'Invalid use of repetition operators' Execution halted bash-3.2$ pwd /Users/osklyar/Code bash-3.2$ cd tmp/ bash-3.2$ ln -s /var/folders/bU/bUB3Gk1uHBuDXq1G72Xc+++++TI/-Tmp-/RtmpGzn3kA/file60b7acd9.cpp file60b7acd9.cpp bash-3.2$ ls file60b7acd9.cpp inline bash-3.2$ R CMD SHLIB file60b7acd9.cpp=20 g++-4.2 -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/local/include -fPIC -mtune=3Dcore2 -g -O2 -c file60b7acd9.cpp -o file60b7acd9.o g++-4.2 -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o file60b7acd9.so file60b7acd9.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation [[alternative HTML version deleted]]
Possibly Parallel Threads
- Problems with installing R packages from source and running C++ in R, even on fresh R installation
- Problems with installing R packages from source and running C++ in R, even on fresh R installation
- Problems with installing R packages from source and running C++ in R, even on fresh R installation
- [Bug 14168] New: endian bug on powerpc
- fatal error unused tempdir