<div dir="ltr">Hi Dirk,<div><br></div><div> many thanks for the explanation, it's nice to know what's the problem.</div><div><br></div><div>I'll check whether there are other <span style="font-family:arial,sans-serif;font-size:13px">toggles</span> I can use to get it to work under Windows.</div>
<div><br></div><div>Best,</div><div><br></div><div>Matteo</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 29, 2014 at 4:34 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Matteo,<br>
<div class=""><br>
On 29 May 2014 at 16:20, Matteo Fasiolo wrote:<br>
| Hi Dirk,<br>
|<br>
|  adding<br>
|<br>
| PKG_CPPFLAGS = -DWIN32<br>
|<br>
| solved the problem,<br>
<br>
</div>Good. That fixes my little snafu and gives me a moment to address it.  Maybe<br>
I'll also add the -DWIN32 just to be safe.<br>
<div class=""><br>
| but I got another bunch of errors (see below).<br>
|<br>
| Maybe these are unsupported C++11 features?<br>
|<br>
| I think I was getting similar errors when I was compiling my package in Linux,<br>
| but they were solved after installing gcc 4.8.<br>
<br>
</div>That is precisely it.<br>
<br>
R-on-Windows still defaults to g++ 4.6.* which is older and less featureful.<br>
R knows that, see how you now get  -std=c++0x   from setting the C++11 flag.<br>
<br>
And it looks like the Armadillo code wants a newer compiler when C++11 is in<br>
use, which would be a roadblock for you for the time being.  I can discuss<br>
with Conrad whether it is worth covering this aspect at the Armadillo side,<br>
but for now you are between a rock and hard place.<br>
<br>
I would recommend looking through the files which come up below, and see if<br>
you can identify additional #ifdef statements.  Armadillo is extremely well<br>
structured and you may find another toggle to suppress the inclusion of<br>
features which tickle the errors below, but which you do not need.  In that<br>
additional -D... definitions may help you.<br>
<br>
Keep us posted,  Dirk<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
| Matteo<br>
|<br>
|<br>
| * installing *source* package 'anRpackage' ...<br>
| ** libs<br>
|<br>
| *** arch - i386<br>
| g++  -std=c++0x -I"D:/RCompile/recent/R-3.1.0/include" -DNDEBUG -DWIN32   -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o<br>

| In file included from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo:48:0,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadilloForward.h:37,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadillo.h:30,<br>
|                  from RcppExports.cpp:4:<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:159:110: note: #pragma message: Your C++ compiler is in C++11 mode, but it has incomplete support for C++11 features<br>
| In file included from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo:172:0,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadilloForward.h:37,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadillo.h:30,<br>
|                  from RcppExports.cpp:4:<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_bones.hpp:30:5: error: 'steady_clock' in namespace 'std::chrono' does not name a type<br>
| In file included from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo:510:0,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadilloForward.h:37,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadillo.h:30,<br>
|                  from RcppExports.cpp:4:<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp: In member function 'void arma::wall_clock::tic()':<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:38:5: error: 'chrono_time1' was not declared in this scope<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:38:33: error: 'std::chrono::steady_clock' has not been declared<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp: In member function 'double arma::wall_clock::toc()':<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:66:13: error: 'steady_clock' in namespace 'std::chrono' does not name a type<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:70:85: error: 'chrono_time2' was not declared in this scope<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:70:100: error: 'chrono_time1' was not declared in this scope<br>
| make: *** [RcppExports.o] Error 1<br>
| Warning: running command 'make -f "Makevars.win" -f "D:/RCompile/recent/R-3.1.0/etc/i386/Makeconf" -f "D:/RCompile/recent/R-3.1.0/etc/i386/Makevars.site" -f "D:/RCompile/recent/R-3.1.0/share/make/<a href="http://winshlib.mk" target="_blank">winshlib.mk</a>" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="anRpackage.dll" OBJECTS="RcppExports.o rcpparma_hello_world.o"' had status 2<br>

| g++  -std=c++0x -I"D:/RCompile/recent/R-3.1.0/include" -DNDEBUG -DWIN32   -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o<br>

| In file included from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo:48:0,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadilloForward.h:37,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadillo.h:30,<br>
|                  from RcppExports.cpp:4:<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:159:110: note: #pragma message: Your C++ compiler is in C++11 mode, but it has incomplete support for C++11 features<br>
| In file included from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo:172:0,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadilloForward.h:37,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadillo.h:30,<br>
|                  from RcppExports.cpp:4:<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_bones.hpp:30:5: error: 'steady_clock' in namespace 'std::chrono' does not name a type<br>
| In file included from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo:510:0,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadilloForward.h:37,<br>
|                  from d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/RcppArmadillo.h:30,<br>
|                  from RcppExports.cpp:4:<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp: In member function 'void arma::wall_clock::tic()':<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:38:5: error: 'chrono_time1' was not declared in this scope<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:38:33: error: 'std::chrono::steady_clock' has not been declared<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp: In member function 'double arma::wall_clock::toc()':<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:66:13: error: 'steady_clock' in namespace 'std::chrono' does not name a type<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:70:85: error: 'chrono_time2' was not declared in this scope<br>
| d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include/armadillo_bits/wall_clock_meat.hpp:70:100: error: 'chrono_time1' was not declared in this scope<br>
| make: *** [RcppExports.o] Error 1<br>
| Warning: running command 'make -f "Makevars.win" -f "D:/RCompile/recent/R-3.1.0/etc/i386/Makeconf" -f "D:/RCompile/recent/R-3.1.0/etc/i386/Makevars.site" -f "D:/RCompile/recent/R-3.1.0/share/make/<a href="http://winshlib.mk" target="_blank">winshlib.mk</a>" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="anRpackage.dll" OBJECTS="RcppExports.o rcpparma_hello_world.o" symbols.rds' had status 2<br>

| ERROR: compilation failed for package 'anRpackage'<br>
| * removing 'd:/RCompile/CRANguest/R-release/lib/anRpackage'<br>
| * restoring previous 'd:/RCompile/CRANguest/R-release/lib/anRpackage'<br>
|<br>
|<br>
|<br>
| On Thu, May 29, 2014 at 4:15 PM, Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br>
|<br>
|<br>
|     Would you mind resending what you just me to the list?<br>
|<br>
|     Dirk<br>
|<br>
|     --<br>
|     Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
|<br>
|<br>
</div></div><div class="im HOEnZb">| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
<br>
</div><div class="HOEnZb"><div class="h5">--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</div></div></blockquote></div><br></div>