Skip to content

tweak cmake for clang-cl - #6266

Merged
martin-frbg merged 1 commit into
OpenMathLib:developfrom
mattip:win-cmake
Nov 25, 2026
Merged

martin-frbg merged 1 commit into
OpenMathLib:developfrom
mattip:win-cmake

Conversation

@mattip

@mattip mattip commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

I am working on #6255 over at MacPython/openblas-libs#293.

My AI agent and I noticed a very noisy build log on the win-arm64 build, which is being caused by -Wall. This becomes -Weverything on clang-cl (absolutely everything), rather than /W3 (problematic warnings only), emitting lots of warnings. It can also be spelled /clang:-Wall if you want.

We also saw that compilation of dllinit.c was weird. Because the CMake file uses VERBATIM, the flags were being added as a single string of compound arguments (and ignored) rather than as separate arguments. In my build this shows up in the logs as

  "C:\Program Files\LLVM\bin\clang-cl.exe" "-Wno-reserved-macro-identifier ... /DWIN32 /D_WINDOWS
    -DHAVE_C11 -DMS_ABI -Wall -DF_INTERFACE_GFORT ... -DBUILD_COMPLEX16" -IC:/.../OpenBLAS -c -o .../dllinit.o
  warning: unknown warning option '-Wno-reserved-macro-identifier ... -DBUILD_COMPLEX16';                                                                                                               
    did you mean '-Wno-unsafe-buffer-usage-in-unique-ptr-array-access'? [-Wunknown-warning-option]

So dllinit.c compiles with none of those defines or flags — it gets one bogus -W… argument instead. Harmless today (dllinit.c is a bare DllMain), but it silently drops -DMS_ABI, -DMAX_CPU_NUMBER, CRT and optimization flags from that one object.

If you want I can remove the verbose comments from the changes

@martin-frbg martin-frbg added this to the 0.3.35 milestone Nov 25, 2026
@martin-frbg

Copy link
Copy Markdown
Collaborator

Thanks - I found the ridiculous warnings on Windows annoying, but not annoying enough to take a look with everything else going on.

@martin-frbg
martin-frbg merged commit c93822c into OpenMathLib:develop Nov 25, 2026
145 of 151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants