pythran
pythran copied to clipboard
Instructions for Windows 10 users MKL / OpenBLAS properly formatted
Instructions given so OpenMP will work on Windows 10 with both MKL and OpenBLAS.
Change whatever you feel is appropriate. I did notice on a very large project with OpenBLAS I had to change some settings around to get OpenMP working like this:
library_dirs='C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64' ldflags=\libomp.lib
So link the standard Windows Visual Studio OpenMP library instead of the LLVM one. Why this works on larger projects (100 lines of code) and not the LLVM one I have no idea. So rather than figure it out, I'd just provide it as an alternative if the first method fails... Someone smarter than me may be able to figure out why, although I imagine most users just want config settings to plug in to get their module built and could care less what happens behind the scenes, as long as it's using OpenMP.
I found that some random modules in my project were actually loading the libiomp5md.lib
, causing my interpreter to crash when I tried to link libomp.lib
in my Pythran modules. Note these are actually the same OpenMP files, but having both loaded into an environment at once will cause a crash (Windows can't tell they are the same, so multiple OpenMP DLLs loaded causes erratic behavior, OpenMP crashes the kernel). So I found a workaround for those that already installed the Intel OneAPI Intel MKL library by modifying the pythran-win32.cfg
file as such:
library_dirs='C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\compiler\lib\intel64_win'
ldflags=\libiomp5md.lib
My original instructions only showed how to link libomp.lib
so this is how you go about linking the other OpenMP library. If I need to update the documentation let me know and I will when I get a chance.