Skip to content

Don't redefine cblas/lapack routines from MKL - #4659

Open
d-torrance wants to merge 1 commit into
Macaulay2:developmentfrom
d-torrance:mkl
Open

Don't redefine cblas/lapack routines from MKL#4659
d-torrance wants to merge 1 commit into
Macaulay2:developmentfrom
d-torrance:mkl

Conversation

@d-torrance

@d-torrance d-torrance commented Aug 21, 2026

Copy link
Copy Markdown
Member

Also define MKL_Complex16 as double before including ffpack.h. If it was built with MKL support, then compilation will fail with a bunch of cannot convert 'double*' to 'MKL_Complex16*' errors.

After these changes, I was able to build M2 and FFLAS-FFPACK using MKL as their BLAS/LAPACK implementation.

Here are the steps to reproduce the issue. In particular, we need FFLAS-FFPACK to pull in the MKL headers. This is on Ubuntu 24.04 with intel-mkl installed:

sudo update-alternatives --config libblas.so-x86_64-linux-gnu
# select /usr/lib/x86_64-linux-gnu/libmkl_rt.so
cd M2/M2/BUILD/build
../../autogen.sh
../../configure CPPFLAGS="$(pkg-config --cflags blas)"
# need fflas-ffpack built w/ MKL support, and it only detects it using CBLAS_LIBS
make -C libraries/fflas_ffpack CBLAS_LIBS="$(pkg-config --libs blas)"
make

Closes: #3372

🤖 AI Disclosure 🤖

I did a bit of brainstorming with Claude, but the code is all mine.

Also define MKL_Complex16 as double before including ffpack.h.  If it
was built with MKL support, then compilation will fail with a bunch of
"cannot convert 'double*' to 'MKL_Complex16*'" errors.
@d-torrance d-torrance added Engine Macaulay2/e build issue platform specific issues involving compiling M2, generating examples, or running tests Linear Algebra labels Aug 21, 2026

@andrew-tawfeek andrew-tawfeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I compiled the affected FFLAS and mutable-matrix translation units both normally and with FFLAS forced through the MKL path against Intel MKL headers; the header guards suppress the conflicting declarations and the complex type matches the existing double-based storage.

AI-assisted PR review alongside GPT 5.6-Sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build issue platform specific issues involving compiling M2, generating examples, or running tests Engine Macaulay2/e Linear Algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants