[R-sig-ME] error: 'Index' is not a member...

Boylan, Ross Ro@@@Boy|@n @end|ng |rom uc@|@edu
Thu Apr 11 03:04:54 CEST 2024


When trying to build lme4 from source (git master) I get a bunch of compiler errors, which seem to result from

lme4CholmodDecomposition.h:58:39: error: 'Index' is not a member of 'lme4::lme4CholmodDecomposition<Eigen::SparseMatrix<double, 0, int> >::Base' {aka 'Eigen::CholmodDecomposition
<Eigen::SparseMatrix<double, 0, int>, 1>'}
      58 |             eigen_assert((Base::Index)(factor()->n) == other.rows());
         |                          ~~~~~~~~~~~~~^~~~~~~~~~~~~

Discussion of somewhat similar problems focuses on changes to Matrix, specifically at 1.6-2.  But I'm using 1.6-5 with a fresh install of R 4.3.3 and recreation of the libraries for that version (i.e., I didn't copy any stuff from the old libraries).

Any ideas?

Really, my interest is in following some of the R code in the debugger, and this only arose on the way to that goal.

Environment
Windows Server 2019 v1809
R 4.3.3 running inside VS Code, with the R extension.
Using devtools::load_all()
System has RTools4.3 installed (though not recently refreshed), RStudio 2023.12.1 Build 402, Visual Studio 2019, and Cygwin.  I believe the first is the source of the build tools used, but I mention the others because it's possible they are being used or are interfering.

Fuller Transcript:
> load_all()
i Loading lme4
i Re-compiling lme4 (debug build)
-- R CMD INSTALL --------------------------------------------------------------------------------------------------------------------------------------------------------------------
-  installing *source* package 'lme4' ... (456ms)
   ** using staged installation
   ** libs
   using C++ compiler: 'G__~1.EXE (GCC) 12.3.0'
   g++ -std=gnu++17  -I"C:/PROGRA~1/R/R-43~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Program Files/R/R-4.3.3/library/Rcpp/include' -I'C:/Program Files/R/R-4.3.
3/library/RcppEigen/include' -I'C:/Program Files/R/R-4.3.3/library/Matrix/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall -gdwarf-2 -mfpmath=sse -ms
se2 -mstackrealign  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c external.cpp -o external.o
   g++ -std=gnu++17  -I"C:/PROGRA~1/R/R-43~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Program Files/R/R-4.3.3/library/Rcpp/include' -I'C:/Program Files/R/R-4.3.
3/library/RcppEigen/include' -I'C:/Program Files/R/R-4.3.3/library/Matrix/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall -gdwarf-2 -mfpmath=sse -ms
se2 -mstackrealign  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c glmFamily.cpp -o glmFamily.o
   g++ -std=gnu++17  -I"C:/PROGRA~1/R/R-43~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Program Files/R/R-4.3.3/library/Rcpp/include' -I'C:/Program Files/R/R-4.3.
3/library/RcppEigen/include' -I'C:/Program Files/R/R-4.3.3/library/Matrix/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall -gdwarf-2 -mfpmath=sse -ms
se2 -mstackrealign  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c mcmcsamp.cpp -o mcmcsamp.o
   g++ -std=gnu++17  -I"C:/PROGRA~1/R/R-43~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Program Files/R/R-4.3.3/library/Rcpp/include' -I'C:/Program Files/R/R-4.3.
3/library/RcppEigen/include' -I'C:/Program Files/R/R-4.3.3/library/Matrix/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall -gdwarf-2 -mfpmath=sse -ms
se2 -mstackrealign  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c optimizer.cpp -o optimizer.o
   g++ -std=gnu++17  -I"C:/PROGRA~1/R/R-43~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Program Files/R/R-4.3.3/library/Rcpp/include' -I'C:/Program Files/R/R-4.3.
3/library/RcppEigen/include' -I'C:/Program Files/R/R-4.3.3/library/Matrix/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall -gdwarf-2 -mfpmath=sse -ms
se2 -mstackrealign  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c predModule.cpp -o predModule.o
   In file included from c:\rtools43\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\12.3.0\include\c++\cassert:44,
                    from C:/Program Files/R/R-4.3.3/library/RcppEigen/include/Eigen/Core:84,
                    from C:/Program Files/R/R-4.3.3/library/RcppEigen/include/Eigen/Dense:1,
                    from C:/Program Files/R/R-4.3.3/library/RcppEigen/include/RcppEigenForward.h:28,
                    from C:/Program Files/R/R-4.3.3/library/RcppEigen/include/RcppEigen.h:25,
                    from predModule.h:12,
                    from predModule.cpp:8:
   lme4CholmodDecomposition.h: In instantiation of 'void lme4::lme4CholmodDecomposition<_MatrixType, _UpLo>::solveInPlace(const Eigen::MatrixBase<OtherDerived>&, int) const [with Ot
herDerived = Eigen::Matrix<double, -1, -1>; _MatrixType = Eigen::SparseMatrix<double, 0, int>; int _UpLo = 1]':
   predModule.cpp:123:37:   required from here
   lme4CholmodDecomposition.h:58:39: error: 'Index' is not a member of 'lme4::lme4CholmodDecomposition<Eigen::SparseMatrix<double, 0, int> >::Base' {aka 'Eigen::CholmodDecomposition
<Eigen::SparseMatrix<double, 0, int>, 1>'}
      58 |             eigen_assert((Base::Index)(factor()->n) == other.rows());
         |                          ~~~~~~~~~~~~~^~~~~~~~~~~~~
   C:/Program Files/R/R-4.3.3/library/RcppEigen/include/Eigen/src/Core/util/Macros.h:1037:25: note: in expansion of macro 'eigen_plain_assert'
    1037 | #define eigen_assert(x) eigen_plain_assert(x)
         |                         ^~~~~~~~~~~~~~~~~~
         ^~~~~~~~~~~~

# That exact pair of errors, at the same lines, repeats ~5 times

   make: *** [C:/PROGRA~1/R/R-43~1.3/etc/x64/Makeconf:272: predModule.o] Error 1
   ERROR: compilation failed for package 'lme4'
-  removing 'C:/Users/rdboylan/AppData/Local/Temp/3/RtmpmQrCjG/devtools_install_4fac7c5146bb/lme4'
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, ...`:
! System command 'Rcmd.exe' failed
---
Exit status: 1

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list