Repository: opencv
Issue: OpenCV doesn't compile with OpenBLAS= ON, Eigen=OFF
Labels: bug,category: core,category: build/install

### System Information

OpenCV version: 4.6.0
OpenBLAS version: 0.3.21
Operating System / Platform: Windows 11
Compiler & compiler version: Microsoft Visual Studio Professional 2022 (64-bit) - Version 17.3.5
CMake 3.24.3

### Detailed description

Try to build OpenCV 4.6.0 with OpenBLAS 0.3.21 (WITH_LAPACK=ON) and WITH_EIGEN=OFF

The compilation fails with the following error messages:
- dls_solver.cpp
- essential_solver.cpp

```
C:\.hunter\_Base\ca7838d\220ef5a\0306445\Build\OpenCV\Source\modules\calib3d\src\usac\essential_solver.cpp(164,9): error C2660: 'dgeev_': function does not take 14 arguments
C:\.hunter\_Base\ca7838d\220ef5a\0306445\Install\include\openblas\lapack.h(1812,6): message : see declaration of 'dgeev_' (compiling source file C:\.hunter\_Base\ca7838d\220ef5a\0306445\Build\OpenCV\Source\modules\calib3d\src\usac\essential_solver.cpp)
C:\.hunter\_Base\ca7838d\220ef5a\0306445\Build\OpenCV\Source\modules\calib3d\src\usac\dls_solver.cpp(163,9): error C2660: 'dgeev_': function does not take 14 arguments
```

The function in question, `dgeev_` is called like this from OpenCV:
opencv-4.6.0\modules\calib3d\src\usac\essential_solver.cpp, line 164:
```
 dgeev_(&jobvl, &jobvr, &mat_order, action_mat_data, &lda, wr, wi, eig_vecs, &ldvl,
                nullptr, &ldvr, work, &lwork, &info);
```

The declaration of dgeev_ looks like this (at least the OpenBLAS version):
OpenBLAS_0.3.21\include\lapack.h, line 1811:
```
#define LAPACK_dgeev_base LAPACK_GLOBAL(dgeev,DGEEV)
void LAPACK_dgeev_base(
    char const* jobvl, char const* jobvr,
    lapack_int const* n,
    double* A, lapack_int const* lda,
    double* WR,
    double* WI,
    double* VL, lapack_int const* ldvl,
    double* VR, lapack_int const* ldvr,
    double* work, lapack_int const* lwork,
    lapack_int* info
#ifdef LAPACK_FORTRAN_STRLEN_END
    , size_t, size_t
#endif
);
```
Because LAPACK_FORTRAN_STRLEN_END is hardcoded in lapack.h, line 19:
```
/* It seems all current Fortran compilers put strlen at end.
*  Some historical compilers put strlen after the str argument
*  or make the str argument into a struct. */
#define LAPACK_FORTRAN_STRLEN_END
```
the OpenBLAS version of `dgeev_ ` will ALWAYS expect 16 parameters. 

Potential fix:
```
        char jobvl = 'V', jobvr = 'N'; // only left eigen vectors are computed
        dgeev_(&jobvl, &jobvr, &mat_order, action_mat_data, &lda, wr, wi, eig_vecs, &ldvl,
                nullptr, &ldvr, work, &lwork, &info, 1, 1);
```

I noticed that the generated header opencv_lapack.h mentions `LAPACK_FORTRAN_STRLEN_END `
```
/*
 * Using netlib's reference LAPACK implementation version >= 3.4.0 (first with C interface).
 * Use LAPACK_xxxx to transparently (via predefined lapack macros) deal with pre and post 3.9.1 versions.
 * LAPACK 3.9.1 introduces LAPACK_FORTRAN_STRLEN_END and modifies (through preprocessing) the declarations of the following functions used in opencv
 *        sposv_, dposv_, spotrf_, dpotrf_, sgesdd_, dgesdd_, sgels_, dgels_
 * which end up with an extra parameter.
 * So we also need to preprocess the function calls in opencv coding by prefixing them with LAPACK_.
 * The good news is the preprocessing works fine whatever netlib's LAPACK version.
 */
```

Was `dgeev_ ` simply overlooked?

### Steps to reproduce

Try to build OpenCV 4.6.0 with OpenBLAS 0.3.21 WITH_EIGEN=OFF.

I checked with tagged version 4.6.0, also the master branch and the behavior is the same.

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)