#1110709 armadillo: Support for SuperLU broken

#1110709#5
Date:
2025-08-10 10:08:24 UTC
From:
To:
Hi,

the support for SuperLU is broken:

  #define ARMA_USE_SUPERLU 1
  #include <armadillo>

  int main()
  {
    arma::sp_mat A = arma::sprandu<arma::sp_mat>(1000, 1000, 0.1);
    arma::vec b = arma::randu<arma::vec>(1000);
    arma::vec x = spsolve(A, b, "superlu");
    return 0;
  }

With "g++ arma.cpp -larmadillo" I get (abbreviated):

  In file included from /usr/include/armadillo:114,
                   from arma.cpp:2:
  /usr/include/armadillo_bits/include_superlu.hpp:232:84: note: ‘#pragma message: WARNING: SuperLU headers not found; using built-in definitions’
    232 |   #pragma message ("WARNING: SuperLU headers not found; using built-in definitions")
        |                                                                                    ^
  /usr/bin/ld: /tmp/ccAYEdY9.o: in function `arma::superlu::init_stat(arma::superlu::SuperLUStat_t*)':
  arma.cpp:(.text._ZN4arma7superlu9init_statEPNS0_13SuperLUStat_tE[_ZN4arma7superlu9init_statEPNS0_13SuperLUStat_tE]+0x14): undefined reference to `wrapper_StatInit'
  [...]

This is probably because Armadillo 14.2 requires SuperLU 5.2 (see
/usr/include/armadillo_bits/include_superlu.hpp:67). Actually, SuperLU 5.3 as
in bookwork seems to work, too. But trixie has SuperLU 7.0.1. Armadillo 14.6
supports SuperLU 7.x.

When this has been fixed it is probably a good idea to re-add a versioned
depends on libsuperlu-dev to bound it from above. Also an autopkgtest for this
feature would be useful.

Best regards,
  Joachim