Hello,
On a windows machine where Rtools is installed and works, i.e. I
get:
require(devtools)
has_devel()
"C:/R/R-3.0.2/bin/i386/R" --vanilla CMD SHLIB foo.c
gcc -m32 -I"C:/R/R-30~1.2/include" -DNDEBUG
-I"C:/R/R-3.0.2/library/Rcpp/include"
-I"d:/RCompile/CRANpkg/extralibs64/local/include" -O3 -Wall
-std=gnu99 -mtune=core2 -c foo.c -o foo.o
gcc -m32 -shared -s -static-libgcc -o foo.dll tmp.def foo.o
C:/R/R-3.0.2/library/Rcpp/lib/i386/libRcpp.a
-Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386
-Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-30~1.2/bin/i386
-lR
[1] TRUE
sourceCpp does not manage to find the tools correctly:
evalCpp( "1+1")
Error in sourceCpp(code = code, env = env, rebuild = rebuild,
showOutput = showOutput, :
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please download and install the appropriate version of Rtools:
http://cran.r-project.org/bin/windows/Rtools/ [1]
Using devtools:::R however, I manage to compile the file correctly:
co
cpp::export]]
+ double foo(){
+
2;
+ }
+
Sys.setenv( "PKG_CXXFLAGS" = Rcpp:::RcppCxxFlags() )
Sys.setenv( "PKG_LIBS" = Rcpp::
B test.cpp", getwd() )
"C:/R/R-3.0.2/bin/i386/R" --vanilla CMD SHLIB test.cpp
g++ -m32 -I"C:/R/R-30~1.2/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/extralibs64/local/include&q
/R-3.0.2/library/Rcpp/include -O2 -Wall -mtune=core2 -c
test.cpp -o test.o
g++ -m32 -shared -s -static-libgcc -o test.dll tmp.def test.o
C:/R/R-3.0.2/library/Rcpp/lib/i386/libRcpp.a
-Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386
-Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-30~1.2/bin/i386
-lR
So perhaps we can borrow some wisdom out of devtools to make
sourceCpp work. As one can expect, the code from sourceCpp that
fails is these lines:
cmd <- paste(R.home(component = "bin"), .Platform$file.sep,
"R ", "CMD SHLIB ", "-o ",
shQuote(context$dynlibFilename),
" ", ifelse(rebuild, "--preclean ", ""),
shQuote(context$cppSourceFilename),
sep = "")
Romain
version
_
platform i386-w64-mingw32
arch i386
os mingw32
system i386, mingw32
status
25
svn rev 63987
language R
version.string R version 3.0.2 (2013-09-25)
nickname Frisbee Sailing
packageDescription("Rcpp")$Version
[1] "0.10.5"
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.
pp-devel" target="_blank">https://lists.r-forge.r-pr
-bin/mailman/listinfo/rcpp-devel