AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
Build fails with clang-cl: SVML _mm_pow_ps gated on _MSC_VER alone
- Vorherrschende Sprache
- C++
- Sterne
- 2.1k
- Forks
- 503
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
`FixedFunctionOpCPU.cpp` gates the SVML `_mm_pow_ps` path on `_MSC_VER >= 1920` alone. clang-cl
defines `_MSC_VER` (1951 for clang 22.1.8) but ships no SVML, so the build breaks whenever
`OCIO_USE_AVX` is on.
Minimal:
```c++
#include
__m128 f(__m128 x, __m128 e) { return _mm_pow_ps(x, e); }
```
```
> clang-cl -c -arch:AVX t.cpp
t.cpp(2,39): error: use of undeclared identifier '_mm_pow_ps'
```
Excluding the compiler in the gate is enough, and clang-cl then takes the existing `ssePower()` path
like any other non-MSVC compiler:
```diff
-#if (_MSC_VER >= 1920) && (OCIO_USE_AVX)
+#if (_MSC_VER >= 1920) && (OCIO_USE_AVX) && !defined(__clang__)
```
main has 2 such sites; 2.5.2 has 4, the extra two being the dispatch arms in
`GetFixedFunctionCPURenderer`.
clang 22.1.8, x86_64-pc-windows-msvc. Reproduced against 2.5.2 and main.
Beitragsleitfaden
Rechercherichtung
Beginne in FixedFunctionOpCPU.cpp und finde die beiden SVML-_mm_pow_ps-Präprozessorschalter, die _MSC_VER und OCIO_USE_AVX verwenden. Reproduziere das Problem mit clang-cl -c -arch:AVX und überprüfe anschließend, dass der clang-cl-Build bei aktiviertem OCIO_USE_AVX den vorhandenen ssePower()-Pfad verwendet und erfolgreich ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 82/100