AlabamaASRL / asset_asrl

https://alabamaasrl.github.io/asset_asrl/
Apache License 2.0
30 stars 6 forks source link

Pardiso Interface Compile Failure #54

Open wgledbe opened 5 months ago

wgledbe commented 5 months ago

Summary

Pardiso interface fails to compile on Windows with the following error:

[build] src\Solvers\PardisoInterface.h:40:17: error: cannot initialize a parameter of type 'const long long *' with an rvalue of type 'int *'
[build]    40 |             pt, &maxfct, &mnum, &type, &phase, &n, a, ia, ja, perm, &nrhs, iparm, &msglvl, b, x, &error);
[build]       |                 ^~~~~~~
[build] src\Solvers\PardisoInterface.h:193:55: note: in instantiation of member function 'Eigen::internal::pardiso_run_selector<int>::run' requested here
[build]   193 |         internal::pardiso_run_selector<StorageIndex>::run(m_pt,
[build]       |                                                       ^
[build] src\Solvers\PardisoInterface.h:135:7: note: in instantiation of member function 'Eigen::PardisoImpl<Eigen::PardisoLDLT<Eigen::SparseMatrix<double, 1>>>::pardisoRelease' requested here
[build]   135 |       pardisoRelease();
[build]       |       ^
[build] src\Solvers\PardisoInterface.h:679:9: note: in instantiation of member function 'Eigen::PardisoImpl<Eigen::PardisoLDLT<Eigen::SparseMatrix<double, 1>>>::~PardisoImpl' requested here
[build]   679 |   class PardisoLDLT : public PardisoImpl<PardisoLDLT<MatrixType, Options>> {
[build]       |         ^
[build] C:/Program Files (x86)/Intel/oneAPI/mkl/latest/include\mkl_pardiso.h:33:52: note: passing argument to parameter 'maxfct' here
[build]    33 | void pardiso( _MKL_DSS_HANDLE_t pt, const MKL_INT *maxfct, const MKL_INT *mnum,
[build]       |                                                    ^
[build] 4 warnings and 1 error generated.

MKL Versions attempted:

Compilers attempted:

Investigations

The internal type MKL_INT is probably being set to long long int rather than int, causing the arguments to ::pardiso to be const long long int * rather than const int *. Seems to be triggered by the MKL_ILP64 preprocessor definition.

wgledbe commented 5 months ago

Could be because I'm trying to link against CMake target MKL::MKL rather than use MKL_LIBRARIES and MKL_INCLUDE_DIRS.