<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Le 22/05/2016 à 22:51, Dan Dillon a
      écrit :<br>
    </div>
    <blockquote
cite="mid:CAEWw9xV=qYp-ad+zJeQrBk1JBdov+CwC6-NJvnq6K+TSdgR4Fw@mail.gmail.com"
      type="cite">
      <p dir="ltr">Do you have the same version of mingw as cran?  If
        not , that would be a good test</p>
    </blockquote>
    I have installed the Rtools 3.3 as described there :<br>
    <a class="moz-txt-link-freetext" href="https://github.com/rwinlib/r-base">https://github.com/rwinlib/r-base</a><br>
    which is linked from the "R-devel-experimental" download page<br>
    <a class="moz-txt-link-freetext" href="https://cran.r-project.org/bin/windows/base/rdevel.html">https://cran.r-project.org/bin/windows/base/rdevel.html</a><br>
    so I am using gcc 4.9.3, and win-builder too.<br>
    <br>
    The full win-builder logs for 'minimalTest' are accessible (for ca.
    72h) here :<br>
    <a class="moz-txt-link-freetext" href="http://win-builder.r-project.org/u84hzB80Fol0/">http://win-builder.r-project.org/u84hzB80Fol0/</a><br>
    <br>
    One difference is that win-builder uses -03  :<br>
    <pre>*** arch - i386
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++  -I"D:/RCompile/recent/R/include"            -I"d:/RCompile/CRANpkg/lib/3.4/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.4/RcppEigen/include" -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -Wall  -mtune=core2            -c RcppExports.cpp -o RcppExports.o
-mtune=core2            -c RcppExports.cpp -o RcppExports.o
(etc)

while (for i386) my installation used -02 by default. So I have just changed that on my computer, and the compilation log now reads as
<span class="GCWXI2KCJKB" style="outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important;">*** arch - i386
</span><span class="GCWXI2KCJKB" style="outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important;">"C:/Rtools/mingw_32/bin/"g++  -I"C:/PROGRA~1/R/R-devel/include" -DNDEBUG    -I"C:/Users/francois/Documents/R/win-library/3.4/Rcpp/include" -I"C:/Users/francois/Documents/R/win-library/3.4/RcppEigen/include" -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -c RcppExports.cpp -o RcppExports.o</span>  
(etc)

but the tests still run without error on my PC. I am not sure whether I should play with other compiler options.

F. 

</pre>
    <br>
    <blockquote
cite="mid:CAEWw9xV=qYp-ad+zJeQrBk1JBdov+CwC6-NJvnq6K+TSdgR4Fw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">On May 22, 2016 3:49 PM, "François
        Rousset" <<a moz-do-not-send="true"
          href="mailto:francois.rousset@umontpellier.fr">francois.rousset@umontpellier.fr</a>>
        wrote:<br type="attribution">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
          <br>
          Le 22/05/2016 à 22:16, Dirk Eddelbuettel a écrit :<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            On 22 May 2016 at 09:13, Dirk Eddelbuettel wrote:<br>
            |<br>
            | Hi Francois,<br>
            |<br>
            | Thanks for taking the time to track this down and to
            create an example.<br>
            | I just opened a GitHub issue for it:<br>
            |   <a moz-do-not-send="true"
              href="https://github.com/RcppCore/RcppEigen/issues/34"
              rel="noreferrer" target="_blank">https://github.com/RcppCore/RcppEigen/issues/34</a><br>
            | Feel free to comment there as well.<br>
            <br>
            In that thread on GH, Dan raises a good point:  what
            actually is the supposed<br>
            error message?  What you have at the end of this long email
            isn't all that<br>
            clear and _still indirect_: "Running examples in
            'minimalTest-Ex.R' failed"<br>
            <br>
            For those of us without a windows 32bit machine at hand, can
            you (or anybody<br>
            else) actually produce an error message?  Preferably with
            compiler output?<br>
          </blockquote>
          I never obtained a more useful error message. I have been
          running the CRAN checks routinely on my windows PC both for 32
          and 64 bit builds without any problem. Compilation itself does
          not generate any particular message. Below are the screen logs
          on my PC:<br>
          <br>
          =========================================================<br>
          ==> Rcmd.exe INSTALL --preclean --with-keep.source
          minimalTest<br>
          <br>
          * installing to library
          'C:/Users/francois/Documents/R/win-library/3.4'<br>
          * installing *source* package 'minimalTest' ...<br>
          ** libs<br>
          <br>
          *** arch - i386<br>
          "C:/Rtools/mingw_32/bin/"g++ 
          -I"C:/PROGRA~1/R/R-devel/include" -DNDEBUG
          -I"C:/Users/francois/Documents/R/win-library/3.4/Rcpp/include"
-I"C:/Users/francois/Documents/R/win-library/3.4/RcppEigen/include"
          -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall
          -mtune=core2 -c RcppExports.cpp -o RcppExports.o<br>
          "C:/Rtools/mingw_32/bin/"g++ 
          -I"C:/PROGRA~1/R/R-devel/include" -DNDEBUG
          -I"C:/Users/francois/Documents/R/win-library/3.4/Rcpp/include"
-I"C:/Users/francois/Documents/R/win-library/3.4/RcppEigen/include"
          -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall
          -mtune=core2 -c spaMM_linear.cpp -o spaMM_linear.o<br>
          C:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o
          minimalTest.dll tmp.def RcppExports.o spaMM_linear.o
          -Ld:/Compiler/gcc-4.9.3/local330/lib/i386
          -Ld:/Compiler/gcc-4.9.3/local330/lib
          -LC:/PROGRA~1/R/R-devel/bin/i386 -lR<br>
          installing to
          C:/Users/francois/Documents/R/win-library/3.4/minimalTest/libs/i386<br>
          <br>
          *** arch - x64<br>
          "C:/Rtools/mingw_64/bin/"g++ 
          -I"C:/PROGRA~1/R/R-devel/include" -DNDEBUG
          -I"C:/Users/francois/Documents/R/win-library/3.4/Rcpp/include"
-I"C:/Users/francois/Documents/R/win-library/3.4/RcppEigen/include"
          -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -c
          RcppExports.cpp -o RcppExports.o<br>
          "C:/Rtools/mingw_64/bin/"g++ 
          -I"C:/PROGRA~1/R/R-devel/include" -DNDEBUG
          -I"C:/Users/francois/Documents/R/win-library/3.4/Rcpp/include"
-I"C:/Users/francois/Documents/R/win-library/3.4/RcppEigen/include"
          -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -c
          spaMM_linear.cpp -o spaMM_linear.o<br>
          C:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o
          minimalTest.dll tmp.def RcppExports.o spaMM_linear.o
          -Ld:/Compiler/gcc-4.9.3/local330/lib/x64
          -Ld:/Compiler/gcc-4.9.3/local330/lib
          -LC:/PROGRA~1/R/R-devel/bin/x64 -lR<br>
          installing to
          C:/Users/francois/Documents/R/win-library/3.4/minimalTest/libs/x64<br>
          ** R<br>
          ** byte-compile and prepare package for lazy loading<br>
          ** help<br>
          *** installing help indices<br>
          ** building package indices<br>
          ** testing if installed package can be loaded<br>
          *** arch - i386<br>
          *** arch - x64<br>
          * DONE (minimalTest)<br>
          =========================================================<br>
          ==> Rcmd.exe build minimalTest<br>
          <br>
          * checking for file 'minimalTest/DESCRIPTION' ... OK<br>
          * preparing 'minimalTest':<br>
          * checking DESCRIPTION meta-information ... OK<br>
          * cleaning src<br>
          * checking for LF line-endings in source and make files<br>
          * checking for empty or unneeded directories<br>
          * building 'minimalTest_1.1.3.tar.gz'<br>
          <br>
          ==> Rcmd.exe check minimalTest_1.1.3.tar.gz<br>
          <br>
          * using log directory
          'C:/home/francois/travail/stats/CRANhell/minimalTest.Rcheck'<br>
          * using R Under development (unstable) (2016-05-14 r70617)<br>
          * using platform: x86_64-w64-mingw32 (64-bit)<br>
          * using session charset: ISO8859-1<br>
          * checking for file 'minimalTest/DESCRIPTION' ... OK<br>
          * checking extension type ... Package<br>
          * this is package 'minimalTest' version '1.1.3'<br>
          * package encoding: UTF-8<br>
          * checking package namespace information ... OK<br>
          * checking package dependencies ... OK<br>
          * checking if this is a source package ... OK<br>
          * checking if there is a namespace ... OK<br>
          * checking for executable files ... OK<br>
          * checking for hidden files and directories ... OK<br>
          * checking for portable file names ... OK<br>
          * checking whether package 'minimalTest' can be installed ...
          [21s] OK<br>
          * checking installed package size ... OK<br>
          * checking package directory ... OK<br>
          * checking DESCRIPTION meta-information ... OK<br>
          * checking top-level files ... OK<br>
          * checking for left-over files ... OK<br>
          * checking index information ... OK<br>
          * checking package subdirectories ... OK<br>
          * checking R files for non-ASCII characters ... OK<br>
          * checking R files for syntax errors ... OK<br>
          * loading checks for arch 'i386'<br>
          ** checking whether the package can be loaded ... OK<br>
          ** checking whether the package can be loaded with stated
          dependencies ... OK<br>
          ** checking whether the package can be unloaded cleanly ... OK<br>
          ** checking whether the namespace can be loaded with stated
          dependencies ... OK<br>
          ** checking whether the namespace can be unloaded cleanly ...
          OK<br>
          ** checking loading without being on the library search path
          ... OK<br>
          * loading checks for arch 'x64'<br>
          ** checking whether the package can be loaded ... OK<br>
          ** checking whether the package can be loaded with stated
          dependencies ... OK<br>
          ** checking whether the package can be unloaded cleanly ... OK<br>
          ** checking whether the namespace can be loaded with stated
          dependencies ... OK<br>
          ** checking whether the namespace can be unloaded cleanly ...
          OK<br>
          ** checking loading without being on the library search path
          ... OK<br>
          * checking dependencies in R code ... OK<br>
          * checking S3 generic/method consistency ... OK<br>
          * checking replacement functions ... OK<br>
          * checking foreign function calls ... OK<br>
          * checking R code for possible problems ... OK<br>
          * checking Rd files ... OK<br>
          * checking Rd metadata ... OK<br>
          * checking Rd cross-references ... OK<br>
          * checking for missing documentation entries ... OK<br>
          * checking for code/documentation mismatches ... OK<br>
          * checking Rd \usage sections ... OK<br>
          * checking Rd contents ... OK<br>
          * checking for unstated dependencies in examples ... OK<br>
          * checking line endings in C/C++/Fortran sources/headers ...
          OK<br>
          * checking compiled code ... OK<br>
          * checking examples ...<br>
          ** running examples for arch 'i386' ... [0s] OK<br>
          ** running examples for arch 'x64' ... [0s] OK<br>
          * checking PDF version of manual ... OK<br>
          * DONE<br>
          Status: OK<br>
          <br>
          R CMD check succeeded<br>
          ===============================================<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            Dirk<br>
              | On 22 May 2016 at 12:09, François Rousset wrote:<br>
            | | Hi,<br>
            | |<br>
            | | RcppEigen no longer passes the CRAN checks for Windows
            i386 architecture:<br>
            | | <a moz-do-not-send="true"
href="https://cran.r-project.org/web/checks/check_results_RcppEigen.html"
              rel="noreferrer" target="_blank">https://cran.r-project.org/web/checks/check_results_RcppEigen.html</a><br>
            | | This problem seems to have appeared in the middle of
            last month,<br>
            | | presumably following some change on CRAN.<br>
            | |<br>
            | | A similar problem appeared at the same time in some
            packages I maintain,<br>
            | | which link to RcppEigen. For one package, execution
            stops on a line of<br>
            | | the form<br>
            | | MatrixXd<br>
            | |
someMatrix(MatrixXd(nb,nb).setZero().selfadjointView<Lower>().rankUpdate(<br>
            | | anotherMatrix ));<br>
            | | I have reduced the code causing the error to a small
            reproducible<br>
            | | example, and since I can reproduce the error only on the
            win-builder<br>
            | | service on CRAN, not on my Windows PC, this example
            takes the form of a<br>
            | | package 'minimalTest'. It can be downloaded from<br>
            | | <a moz-do-not-send="true"
              href="http://kimura.univ-montp2.fr/%7Erousset/minimalTest_1.1.3.tar.gz"
              rel="noreferrer" target="_blank">http://kimura.univ-montp2.fr/~rousset/minimalTest_1.1.3.tar.gz</a>.<br>
            | |<br>
            | | I hope the following may help in correcting RcppEigen
            (as I think I can<br>
            | | circumvent the problem in my package), but I am also
            curious whether I<br>
            | | am missing some obvious error in my code.<br>
            | |<br>
            | | In this small example, the checks fail (on Windows i386
            only; the<br>
            | | relevant part of the check log is pasted at the end of
            this message)<br>
            | | when executing<br>
            | |<br>
            | | mini(14)<br>
            | |<br>
            | | where the mini() function is<br>
            | |<br>
            | | // [[Rcpp::export]]<br>
            | | int mini( int nb ){<br>
            | |    MatrixXd swZ(nb,nb);<br>
            | |    swZ.setZero();<br>
            | |    Rcout <<"Trivial code:<br>
            | |
            swZ.selfadjointView<Lower>().rankUpdate(swZ):"<<std::endl;<br>
            | |    swZ.selfadjointView<Lower>().rankUpdate(swZ);<br>
            | |    Rcout << "after minimal test.
            "<<std::endl; // not printed when error<br>
            | | occurs<br>
            | |    return(0);<br>
            | | }<br>
            | |<br>
            | | However, the problem occurs only when two other
            functions, derived from<br>
            | | more meaningful functions in the original package, are
            included in the<br>
            | | sources (yet are not called by the tests):<br>
            | |<br>
            | | // [[Rcpp::export]]<br>
            | | List unusedFn1( SEXP XX ) {<br>
            | |    const MappedSparseMatrix<double>
            X(as<MappedSparseMatrix<double> >(XX));<br>
            | |    SparseQR<SparseMatrix<double,
            Eigen::ColMajor>,<br>
            | | Eigen::COLAMDOrdering<int> > spQR(X);<br>
            | |    SparseMatrix<double> Q_ap(5,5);<br>
            | |    Q_ap.setZero();<br>
            | |    List out = List::create(Named("Q_ap") = Q_ap);<br>
            | |    return(out);<br>
            | | }<br>
            | |<br>
            | | // [[Rcpp::export]]<br>
            | | SEXP unusedFn2( SEXP ZZ ) {<br>
            | |    const Map<MatrixXd> Z(as<Map<MatrixXd>
            >(ZZ));<br>
            | |    int c(Z.cols());<br>
            | |    if (c==0) return(wrap(MatrixXd(0,0)));<br>
            | |    MatrixXd bidon(MatrixXd(c,c).setZero());<br>
            | |    MatrixXd<br>
            | |
swZ(MatrixXd(c,c).setZero().selfadjointView<Lower>().rankUpdate(bidon.transpose()));<br>
            | |    return(wrap(swZ));<br>
            | | }<br>
            | |<br>
            | | The problem does not occur if either of these two
            functions is removed<br>
            | | from the sources. I found that I could resolve the
            problem in my<br>
            | | original package by removing any
            Eigen::SparseMatrix-related code from<br>
            | | it. Much as in the checks for the small example package,
            that code was<br>
            | | not called in the checks for my original package.<br>
            | |<br>
            | | The small example package does not contain other C++ or
            R functions<br>
            | | (except those generated automatically by Rcpp).<br>
            | |<br>
            | | Can anyone make sense of this?<br>
            |<br>
            | The fact that inclusion of other code, which is not called
            and should be<br>
            | optimized away, is involved is really, really weird.<br>
            |<br>
            | All I can think of so far is maybe some macro going
            haywire?<br>
            |<br>
            | Dirk<br>
            |<br>
            | | Thanks in advance,<br>
            | |<br>
            | | F.R.<br>
            | |<br>
            | | ==============================================<br>
            | | ** running examples for arch 'i386' ... ERROR<br>
            | | Running examples in 'minimalTest-Ex.R' failed<br>
            | | The error most likely occurred in:<br>
            | |<br>
            | |  > base::assign(".ptime", proc.time(), pos =
            "CheckExEnv")<br>
            | |  > ### Name: mini<br>
            | |  > ### Title: Test RcppEigen code<br>
            | |  > ### Aliases: mini unusedFn1 unusedFn2<br>
            | |  ><br>
            | |  > ### ** Examples<br>
            | |  ><br>
            | |  > sessionInfo()<br>
            | | R Under development (unstable) (2016-05-21 r70655)<br>
            | | Platform: i386-w64-mingw32/i386 (32-bit)<br>
            | | Running under: Windows Server 2008 x64 (build 6002)
            Service Pack 2<br>
            | |<br>
            | | locale:<br>
            | | [1] LC_COLLATE=C               
             LC_CTYPE=German_Germany.1252<br>
            | | [3] LC_MONETARY=C                LC_NUMERIC=C<br>
            | | [5] LC_TIME=C<br>
            | |<br>
            | | attached base packages:<br>
            | | [1] stats     graphics  grDevices utils     datasets 
            methods   base<br>
            | |<br>
            | | other attached packages:<br>
            | | [1] minimalTest_1.1.3<br>
            | |<br>
            | | loaded via a namespace (and not attached):<br>
            | | [1] Rcpp_0.12.5<br>
            | |  > mini(14)<br>
            | | Trivial code:
            swZ.selfadjointView<Lower>().rankUpdate(swZ):<br>
            | | ** running examples for arch 'x64' ... [1s] OK<br>
            | | * checking PDF version of manual ... OK<br>
            | | * DONE<br>
            | | ===============================================<br>
            | | _______________________________________________<br>
            | | Rcpp-devel mailing list<br>
            | | <a moz-do-not-send="true"
              href="mailto:Rcpp-devel@lists.r-forge.r-project.org"
              target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
            | | <a moz-do-not-send="true"
href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel"
              rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
            |<br>
            | --<br>
            | <a moz-do-not-send="true"
              href="http://dirk.eddelbuettel.com" rel="noreferrer"
              target="_blank">http://dirk.eddelbuettel.com</a> |
            @eddelbuettel | <a moz-do-not-send="true"
              href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
            | _______________________________________________<br>
            | Rcpp-devel mailing list<br>
            | <a moz-do-not-send="true"
              href="mailto:Rcpp-devel@lists.r-forge.r-project.org"
              target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
            | <a moz-do-not-send="true"
href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel"
              rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
            <br>
          </blockquote>
          <br>
          _______________________________________________<br>
          Rcpp-devel mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:Rcpp-devel@lists.r-forge.r-project.org"
            target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
          <a moz-do-not-send="true"
href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel"
            rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
        </blockquote>
      </div>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>