Bug 14168 - R CMD SHLIB on Mac OS X fails when the default tempdir() is used
R CMD SHLIB on Mac OS X fails when the default tempdir() is used
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Misc
old
All All
: P5 normal
Assigned To: Jitterbug compatibility account
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-28 01:20 UTC by Jitterbug compatibility account
Modified: 2009-12-28 01:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2009-12-28 01:20:14 UTC
From: Oleg Sklyar <osklyar@gmx.com>
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) : 
  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) : 
  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) 
x86_64-apple-darwin9.8.0 

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     

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) : 
  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 
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=core2 -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]]

Comment 1 Jitterbug compatibility account 2010-01-01 18:30:00 UTC
NOTES:
 fixed in 2.10.1 patched
Comment 2 Jitterbug compatibility account 2010-01-01 18:30:02 UTC
Audit (from Jitterbug):
Fri Jan  1 12:30:02 2010	ripley	changed notes
Fri Jan  1 12:30:02 2010	ripley	moved from incoming to Misc-fixed