I'm trying to compile a developmental build, and I get this error during compilation:
unknown type name 'dgeqp3'
function cannot return function type 'void (int *, int *, double *, int *, int *, double *, double *, int *, int *)'
use of undeclared identifier 'dgeqp3'
The file that causes the error is arma_extra.C, which must be an add-on to Armadillo (C++ library for linear algebra & scientific computing). The first few lines (you better believe I get the same error messages for zqep3):
#include <cassert>
#include <sstream>
#include "arma_extra.h"
#ifdef DEVBUILD
#include <DEVBUILD.h>
#undef dgeqp3
#undef zgeqp3
#endif
/*!
* Convert an integer to a string.
*/
#define SSTR( x ) static_cast< std::ostringstream & >( \
( std::ostringstream() << std::dec << x ) ).str()
extern "C" {
void arma_fortran_noprefix(dgeqp3)(int*,int*,double*,int*,int*,double*,double*,int*,int*);
void arma_fortran_noprefix(zgeqp3)(int*,int*,std::complex<double>*,int*,int*,std::complex<double>*,std::complex<double>*,int*,double*,int*);
}
dgeqp3 is a LAPACK (Fortran 90 library for linear algebra) function, so it looks like Armadillo is trying to use some functions from LAPACK. I'm not familiar with a function declaration of the form
data_type my_function(what's this)(int,...);
I'm guessing it's a sort of wrapping, hence the external "C" to prevent function overloading?
But I've read elsewhere that this sort of syntax is forbidden, due to functions not being able to return functions. Indeed, this seems to be the second of the three error messages I get. I'm a bit desperate here so any help would be really appreciated.