<div dir="ltr">Dear list,<div><br></div><div>My cda package (<a href="https://github.com/baptiste/cda">https://github.com/baptiste/cda</a>) solves a linear system Ax=b with Armadillo; win-builder and CRAN complain about a missing "zgels_" when trying to build on windows or mac, as it's not part of the subset of LAPACK provided by R libraries (I asked about this in 2011). I have included a copy of this file (zgels.f) from Netlib for the past few years just to make the problem go away, but I've recently realised that zgels is not supposed to be called! It builds fine on Linux, or any machine with a full LAPACK installed, but I'm now wondering if solve() always calls zgels (that would be inefficient for my use-case). </div><div>The matrix A is square: the system is not under/overdetermined, and I believe Armadillo should select LU factorisation rather than (slower) QR. Here's the error I get from win-builder when I remove zgels.f from my cda package,</div><div><br></div><div>cd.o:cd.cpp:(.text$_ZN4arma6auxlib8solve_udISt7complexIdENS_3MatIS3_EEEEbRNS4_IT_EES8_RKNS_4BaseIS6_T0_EE[bool arma::auxlib::solve_ud<std::complex<double>, arma::Mat<std::complex<double> > >(arma::Mat<std::complex<double> >&, arma::Mat<std::complex<double> >&, arma::Base<std::complex<double>, arma::Mat<std::complex<double> > > const&)]+0x3a5): undefined reference to `zgels_'<br></div><div><br></div><div>So it thinks it should call solve_ud, which is meant for under-determined systems. Why would that be? </div><div>I tried to find the relevant piece in the template code, this looks relevant but I don't understand it: <a href="https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/armadillo_bits/glue_solve_meat.hpp#L26">https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/armadillo_bits/glue_solve_meat.hpp#L26</a><br></div><div><br></div><div>Best regards,</div><div><br></div><div>baptiste</div></div>