THIS QUESTION PERTAINS TO WINDOWS 10. There is a similar question but that does not answer or resolve the issue that I am facing.
I have a C++ function written and am using sourceCpp to compile. I have specified a directory location so I know where the modified code lives. I am looking at the verbose output for the linking process. This is what it looks like.
I am trying to get a Debug build. Looks like windowsDebugDLL=TRUE has no effect. I am running on Windows 10. What gets generated is optimized code.
Also, I would like to know what library -lR links to. I have searched for libR.lib, libR.a. R.lib, R.a to no avail.
Where is the R makefile located that is used to do the compilation? Is it just temporarily generated and erased?
Where is the Makevars file on Windows. Putting it under .R folder under Users/ directory does not do it. Makevars.win does not do it either? So the question is... is it possible to create a debug version of the dll at all?
Thanks in advance for all the responses.
Rcpp::sourceCpp("sfgkanal.cpp", verbose=TRUE, rebuild=FALSE, cacheDir = getwd(), windowsDebugDLL=TRUE)
Generated extern "C" functions
--------------------------------------------------------
#include <Rcpp.h>
#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif
// analyseSFGK
Rcpp::List analyseSFGK(Rcpp::List& x);
RcppExport SEXP sourceCpp_1_analyseSFGK(SEXP xSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< Rcpp::List& >::type x(xSEXP);
rcpp_result_gen = Rcpp::wrap(analyseSFGK(x));
return rcpp_result_gen;
END_RCPP
}
// libraryReady
Rcpp::String libraryReady();
RcppExport SEXP sourceCpp_1_libraryReady() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(libraryReady());
return rcpp_result_gen;
END_RCPP
}
Generated R functions
-------------------------------------------------------
`.sourceCpp_1_DLLInfo` <- dyn.load('H:/jupyter-mktmicro-research/R/sfgk/sourceCpp-x86_64-w64-mingw32-1.0.9/sourcecpp_69f04dc58d9/sourceCpp_19.dll')
analyseSFGK <- Rcpp:::sourceCppFunction(function(x) {}, FALSE, `.sourceCpp_1_DLLInfo`, 'sourceCpp_1_analyseSFGK')
libraryReady <- Rcpp:::sourceCppFunction(function() {}, FALSE, `.sourceCpp_1_DLLInfo`, 'sourceCpp_1_libraryReady')
rm(`.sourceCpp_1_DLLInfo`)
Building shared library
--------------------------------------------------------
DIR: H:/jupyter-mktmicro-research/R/sfgk/sourceCpp-x86_64-w64-mingw32-1.0.9/sourcecpp_69f04dc58d9
C:/PROGRA~1/R/R-42~1.0/bin/x64/R CMD SHLIB -d --preclean -o "sourceCpp_19.dll" "sfgkanal.cpp"
g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG -I"C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include" -I"H:/jupyter-mktmicro-research/R/sfgk" -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -gdwarf-2 -mfpmath=sse -msse2 -mstackrealign -c sfgkanal.cpp -o sfgkanal.o
In file included from C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include/Rcpp/Vector.h:54,
from C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include/Rcpp.h:40,
from sfgkanal.cpp:1:
C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include/Rcpp/vector/traits.h: In lambda function:
C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include/Rcpp/vector/traits.h:49:47: warning: '*((void*)(&<anonymous>)+16).Rcpp::traits::r_vector_cache<13, Rcpp::PreserveStorage>::start' may be used uninitialized in this function [-Wmaybe-uninitialized]
49 | inline proxy ref(R_xlen_t i) const { return start[i] ; }
| ^~~~~
C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include/Rcpp/vector/traits.h:49:47: warning: '*((void*)(&<anonymous>)+16).Rcpp::traits::r_vector_cache<13, Rcpp::PreserveStorage>::start' may be used uninitialized in this function [-Wmaybe-uninitialized]
49 | inline proxy ref(R_xlen_t i) const { return start[i] ; }
| ^~~~~
C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include/Rcpp/vector/traits.h:49:47: warning: '*((void*)(&<anonymous>)+16).Rcpp::traits::r_vector_cache<13, Rcpp::PreserveStorage>::start' may be used uninitialized in this function [-Wmaybe-uninitialized]
49 | inline proxy ref(R_xlen_t i) const { return start[i] ; }
| ^~~~~
C:/Users/.../AppData/Local/R/win-library/4.2/Rcpp/include/Rcpp/vector/traits.h:49:47: warning: '*((void*)(&<anonymous>)+16).Rcpp::traits::r_vector_cache<13, Rcpp::PreserveStorage>::start' may be used uninitialized in this function [-Wmaybe-uninitialized]
49 | inline proxy ref(R_xlen_t i) const { return start[i] ; }
| ^~~~~
g++ -std=gnu++11 -shared -static-libgcc -o sourceCpp_19.dll tmp.def sfgkanal.o -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-42~1.0/bin/x64 -lR