Skip to content

Fortran hidden argument cleanup

Following up on the discussion in !97 (merged), I thought to myself one evening "let's handle this Fortran hidden argument issue; it'll be an easy thing for an evening". Far more than an evening later, I've discovered all the things that make the issue complicated (and these are the changes of this MR):

  • All BLAS and LAPACK functions must be called not from coot_fortran() but instead through a namespaced function which can redirect to the appropriate hidden-arguments/non-hidden-arguments Fortran function: blas::axpy(), lapack::geqlf(), etc. These are used heavily in the ported MAGMA code.

  • The translation layer to provide blas::axpy(), lapack::geqlf(), etc. had to be implemented. These are templated functions, which makes the interface a little bit nicer. I went "above and beyond" and made the functions not take pointers where appropriate---so, e.g., an argument like const blas_int* m which might represent the length of a vector is now const blas_int m. Similarly, character arguments are, e.g., const char uplo instead of const char* uplo with an expectation that the length is 1.

  • The COOT_USE_FORTRAN_HIDDEN_ARGS configuration option is added and documented. It's enabled by default.

  • While I was at it, I also added the COOT_BLAS_NOEXCEPT and COOT_LAPACK_NOEXCEPT configuration options (not documented), which match the Armadillo options of the (nearly) same name.

Merge request reports