OpenBLAS: Prefix Support Fails During OpenBLAS Build on Windows (WoA)
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:
objcopy -v --redefine-syms C:/Users/HCKTest/Desktop/Harish/openblas-libs/OpenBLAS/build/objcopy.def C:/Users/HCKTest/Desktop/Harish/openblas-libs/OpenBLAS/build/lib/libscipy_openblas.so""
llvm-objcopy.exe: error: unknown argument '-v'
ninja: build stopped: subcommand failed.
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)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (10 by maintainers)
The perl dependency is a bit annoying, perhaps I should try to rewrite gensymbol in either powershell or cmake syntax. Just stumbled over an unexpected gotcha - when installing the Strawberry Perl distribution that perl.org directs one to, it overrides a ton of tools with its own versions, including a cmake that claims the architecture is X86_64 …
Basically all the script has to do is write various lists of symbols to a file, depending on the value of several CMake variables. So I hope to do it in plain CMake, obviating the need for any additional (and grossly oversized) tool
Great, thanks -
$<TARGET_FILE:seems to be precisely the bit of information I was missing, much better to use that than to try to hardcode the library path like I did in the end. I’ll try to find out what is up with pdb file generation, hopefully that is just some other linker option missing. Unfortunately I have a hard time getting anything done right now, so it might be another few days.-nodefaultlib:libcmt -defaultlib:msvcrtworks, but I still need to figure out how to express the library path instead of hardcoding it to PROJECT_BINARY_DIR/lib (which is only correct as long as no CMAKE_BUILD_TYPE is set, the CMake generator changes it to lib/Release/ or lib/Debug etc otherwise)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.
Since you’re trying to create a
scipy_openblas, are you aware that the build configs for that are at https://github.com/MacPython/openblas-libs? It’d be useful to open an issue there; Windows on Arm support isn’t yet documented or supported there, but that’s where it should land. In https://github.com/numpy/numpy/issues/22530 the suggestion was to cross-compile in CI; once that works then there’s no need for local builds anymore.