@opherdonchin, I just replied over at the github issue that I couldn’t reproduce your problem. I think that this indicates that some blas flags are not being set properly, or are being read from somewhere that you are unaware of (an .aesararc file or an environment variable?).
Anyway, I wanted to take the chance to post here a patch that should make your model sample correctly. After looking at the code I wrote for the aesara PR regarding the ldflags, it looks like you should be able to specify the full blas__ldflags
to make the compiler link the correct libraries. Try to do:
aesara.config.blas__ldflags = f'"-L{os.path.join(sys.prefix, "Library", "bin")}" -lmkl_core -lmkl_intel_thread -lmkl_rt'
Sorry that I didn’t realize earlier that you could patch up your flags like this to include the library directories.