OpenBLAS icon indicating copy to clipboard operation
OpenBLAS copied to clipboard

cmake --install does not install DLL

Open mennodeij opened this issue 6 months ago • 4 comments

After a build on windows with the LLVM toolchain, where BUILD_SHARED_LIBS=ON and BUILD_STATIC_LIBS=ON is used, the cmake --install . --prefix <path-to-install -v does not install the shared library. Also, it looks like the DLL link library is overwritten with the static library.

mennodeij avatar Jun 25 '25 11:06 mennodeij

It is currently not supported to build both dll and static library in one go on Windows, as far as I know this is/was due to some (possibly now historical) limitations of Visual Studio.

martin-frbg avatar Jun 25 '25 11:06 martin-frbg

This is on the commandline with ninja and the LLVM toolchain. AFAICS there's no VS involved?

mennodeij avatar Jun 25 '25 13:06 mennodeij

I'm not claiming that it makes sense, just that's how it is in the build system (since before I became the maintainer, and also long before LLVM). Historically there hasn't been much Windows expertise here as far as I know, and I'm mainly a Unix/Linux person myself. Let me check... or you can search for "MSVC" in the toplevel CMakeLists.txt and remove the if...endif block that prevents BUILD_SHARED_LIBS and BUILD_STATIC_LIBS from being both TRUE. Could be that CMake's MSVC variable used to be a clear sign of "MSVC being used through VS" in the past

martin-frbg avatar Jun 25 '25 13:06 martin-frbg

@mennodeij Using -DBUILD_SHARED_LIBS=ON should be enough to generate both static and dynamic version of openblas. Specifying both BUILD_SHARED_LIBS=ON and BUILD_STATIC_LIBS=ON would always leads to generate only static version of OpenBLAS in CMake

Greenie0701 avatar Jul 13 '25 18:07 Greenie0701