j'essaie de faire fonctionner Rccp à partir d'exemples glanés sur le net. Pour le moment j'essaie l'exemple suivant :
Code : Tout sélectionner
# load main two packages
library(Rcpp, lib.loc=":/R/R-3.1.2/library/")
library(inline, lib.loc=":/R/R-3.1.2/library/")
# do something with Rcpp to quickly check that it works
body <- '
NumericVector xx(x);
return wrap( std::accumulate( xx.begin(), xx.end(), 0.0));'
add <- cxxfunction(signature(x = "numeric"), body, plugin = "Rcpp")
x <- 1
y <- 2
res <- add(c(x, y))
res
N'y connaissant pas grand chose, j'ai suivi ces étapes, sans succès. Il doit y avoir des histories de variables environnementales ou je ne sais quoi.Erreur dans compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! g++: not found
make: *** [file188832332a82.o] Error 127
Message d'avis :
l'exécution de la commande 'make -f "C:/R/R-31~1.2/etc/x64/Makeconf" -f "C:/R/R-31~1.2/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file188832332a82.dll" WIN=64 TCLBIN=64 OBJECTS="file188832332a82.o"' renvoie un statut 2
De plus : Message d'avis :
l'exécution de la commande 'C:/R/R-3.1.2/bin/x64/R CMD SHLIB file188832332a82.cpp 2> file188832332a82.cpp.err.txt' renvoie un statut 1
Je précise que je bosse sous windows 7 et la version 64 de R.
Cordialement,
Maxime