[Rcpp-devel] RcppEigen fails on win-builder i386, and a possibly related issue.

François Rousset francois.rousset at umontpellier.fr
Sun May 22 23:31:25 CEST 2016


Le 22/05/2016 à 22:51, Dan Dillon a écrit :
>
> Do you have the same version of mingw as cran?  If not , that would be 
> a good test
>
I have installed the Rtools 3.3 as described there :
https://github.com/rwinlib/r-base
which is linked from the "R-devel-experimental" download page
https://cran.r-project.org/bin/windows/base/rdevel.html
so I am using gcc 4.9.3, and win-builder too.

The full win-builder logs for 'minimalTest' are accessible (for ca. 72h) 
here :
http://win-builder.r-project.org/u84hzB80Fol0/

One difference is that win-builder uses -03  :

*** 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
*** arch - i386 "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   
(etc)

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

F.


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20160522/469b639c/attachment-0001.html>


More information about the Rcpp-devel mailing list