I would like to call LAPACK `dgetrf`

from a nopython block.

In the numba repository, there are wrappers of LAPACK and BLAS functions at numba/_lapack.c. I am looking at numba/numba/np/linalg.py (particularly the implementation of inv) for examples of how to use these wrappers, but I am not able to replicate the results of their code.

Here is a small snippet that computes `r`

which is of Type Signature. I am not sure how to actually call the function `numba_xxgetrf`

. I am also not sure how to wrap this code block in a nopython block. Attempting to place all the code below in a nopython block gives an error message that _LAPACK() is not recognized.

import numpy as np

import numba.np.linalg as la

A = np.ones((10,10))

numba_xxgetrf = la._LAPACK().numba_xxgetrf(A.dtype)

n = A.shape[-1]

acpy = np.asfortranarray(A) # convert to Fortran array to call Lapack

ipiv = np.empty(n, dtype=F_INT_nptype) # pivoting vector

r = numba_xxgetrf(‘d’, n, n, acpy.ctypes, n, ipiv.ctypes)