-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix Support Fails During OpenBLAS Build on Windows (WoA) #5154
Comments
Let me see - the |
Hi @martin-frbg, Thanks for the response. I removed the -v flag in the CMakelists.txt file and changed the file extension from .so to .dll, which allowed the build to complete successfully. However, the symbols inside scipy_openblas.dll still do not have the scipy_ prefix as expected. Is there an additional step required to ensure the symbol renaming takes effect? |
Since you're trying to create a |
mhh, that's annoying - seems llvm-objcopy only actually works on ELF files, although it does not complain when handed a DLL. I'll try to come up with something based on Microsoft's lib command |
Thanks for looking into this! That makes sense—since llvm-objcopy is meant for ELF files, it explains why the symbol renaming didn't work on the DLL. Do you have any suggestions on how we can proceed with ensuring the symbols get renamed correctly? Let me know if there's anything I can try on my end. Thanks again! |
Right, but as it is also stated to support COFF I had (perhaps naively) assumed that it would work with DLLs as well, given that it did not produce an error.
I had found some untested suggestions to try something like |
Hi @martin-frbg, I tried building OpenBLAS with prefix support on x64 Windows using make commands, and the prefixing worked correctly. The resulting binaries were also in PE/COFF format. However, on Windows on ARM (WoA), I was not able to build OpenBLAS using make commands and had to use CMake and Ninja instead. If we can identify how symbol prefixing works in the Make-based build, we might be able to replicate that approach in the CMake build instead of relying on llvm-objcopy. This could help ensure prefixing works properly on WoA as well. Would appreciate your thoughts on this! |
Certainly - the Makefile build is different in that it creates a static library (.a) first, and then post-processes that into a shared one. On Windows, this static library is almost certainly just a bunch of COFF-formatted objects, so llvm-objcopy works. The CMake build actually used to proceed similarly, until there were complaints (and associated PRs) claiming that creating both static and dynamic library in the same run by default was somehow against the philosophy of CMake. The "old" way can very likely be restored to work around the Windows issue, but I did not manage to check this today |
Thanks for the clarification! That makes sense. If restoring the "old" way in the CMake build can resolve this issue, I’d be happy to test it out. Do you have any pointers on where this change was made, or which PRs introduced it? I can look into reverting or modifying that behavior to see if it restores proper symbol prefixing on Windows. |
Hi @martin-frbg Since the Make-based prefix enabled build is working while the CMake-based one is failing on redefining symbols with llvm-objcopy, I’d like to understand how the PREFIX mechanism is handled in Make-based builds. Could you explain how it's being applied there? I want to try a similar approach in the CMake-based build to see if it resolves the issue. |
Please see exports/Makefile - basically it is linking the dllinit.c stub against the static library and applying a def file with the symbol equivalences in the process. However I am still struggling to get this to work with the WoA LLVM19, which is throwing some rather confused and confusing warnings. |
Hi @martin-frbg,
I am attempting to build OpenBLAS on Windows on ARM (WoA) with prefix support enabled. However, I encountered the following error when the build process reaches the objcopy step:
I used the following CMake command for the build:
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DTARGET=ARMV8 -DBUILD_SHARED_LIBS=ON -DARCH=arm64 -DBINARY=64 -DCMAKE_SYSTEM_PROCESSOR=ARM64 -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang-new -DSYMBOLPREFIX="scipy_" -DLIBNAMEPREFIX="scipy_"
Is there any recommended way to enable prefix support for OpenBLAS on Windows (WoA)
The text was updated successfully, but these errors were encountered: