Closed goodsman closed 9 years ago
That is probably an issue with your build environment. Please see if you can use Rcpp::sourceCpp outside of odeintr. I am sure there is some example code around (try: example('sourceCpp')?).
Note that there is currently an issue with the Windows environment because odeintr uses the BH package, which does not work with the gcc in the current windows R setup. You may need to install a separate compiler (clang/gcc) and for R to use that. This is probably not the issue above.
THK
On Tue, Sep 22, 2015 at 12:54 PM, goodsman notifications@github.com wrote:
After installing odeintr, running the following code:
compile_sys("logistic", "dxdt = x * (1 - x)") system.time({x = logistic(0.001, 15, 0.01)})
results in the following message
Warning message: running command 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="sourceCpp_1.dll" WIN=64 TCLBIN=64 OBJECTS="file27c42a93610.o"' had status 2 Error in Rcpp::sourceCpp(code = code, env = env, ...) : Error 1 occurred building shared library.
This message is preceded by a very long string of character output. Pasting the entire output here would make this post extremely long, but I will include it upon request.
— Reply to this email directly or view it on GitHub https://github.com/thk686/odeintr/issues/1.
Thanks for your help.
I am able to run the following code.
sourceCpp(code='
// [[Rcpp::export]] int fibonacci(const int x) { if (x == 0) return(0); if (x == 1) return(1); return (fibonacci(x - 1)) + fibonacci(x - 2); }' )
I am running on Windows. I will look into installing a separate compiler.
This is fixed. There was indeed a bug. Because g++ in the windows R build environment is outdated, it does not support some newer C++ features. When converting type aliases to typedefs, I left out a template parameter. Try it now.
Thanks. I'll uninstall the version downloaded from CRAN and build it from the tarball.
After installing odeintr, running the following code:
compile_sys("logistic", "dxdt = x * (1 - x)") system.time({x = logistic(0.001, 15, 0.01)})
results in the following message
Warning message: running command 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="sourceCpp_1.dll" WIN=64 TCLBIN=64 OBJECTS="file27c42a93610.o"' had status 2 Error in Rcpp::sourceCpp(code = code, env = env, ...) : Error 1 occurred building shared library.
This message is preceded by a very long string of character output. Pasting the entire output here would make this post extremely long, but I will include it upon request.