Windows: Meson build fails with nnet_avx2.c compiled without AVX2
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.3k
- Forks
- 808
- PR merge metrics
- No merged PRs in 30d
Description
With opus 1.5.1, building with MSVC on Windows is failing with nnet_avx2.c is being compiled without AVX2 enabled. This is x86_64 architecture computer. The CMake build is working fine.
(tar) Exporting opus
Building project opus (1.5.1)
The Meson build system
Version: 1.3.2
Source dir: C:\gtk-build\build\x64\release\opus
Build dir: C:\gtk-build\build\x64\release\opus\_gvsbuild-meson
Build type: native build
Project name: opus
Project version: 1.5.1
DEPRECATION: None of the values ['gnu99'] are supported by the c compiler.
However, the deprecated gnu99 std currently falls back to c99.
This will be an error in the future.
If the project supports both GNU and MSVC compilers, a value such as
"c_std=gnu11,c11" specifies that GNU is prefered but it can safely fallback to plain c11.
C compiler for the host machine: cl (msvc 19.39.33521 "Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33521 for x64")
C linker for the host machine: link link 14.39.33521.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: NO
Checking for function "lrintf" with dependency -lm: YES
Checking for function "lrint" with dependency -lm: YES
Checking for function "__malloc_hook" : NO
Check usable header "stdint.h" : YES
Checking if "restrict keyword" compiles: YES
Checking if "C99 variable-size arrays" compiles: NO
Checking if "alloca (alloca.h)" compiles: NO
Checking if "alloca (std)" compiles: YES
Checking if "compiler supports SSE intrinsics" : links: YES
Checking if "compiler supports SSE2 intrinsics" : links: YES
Checking if "compiler supports SSE4.1 intrinsics" : links: YES
Checking if "compiler supports AVX2 intrinsics" : links: YES
Checking if "Get X86 CPU info via inline assembly" : links: NO
Checking if "Get X86 CPU info via C method" : links: NO
Fetching value of define "_MSC_VER" : 1939
Message: Getting X86 CPU info via __cpuid
Configuring config.h using configuration
Configuring opus.pc using configuration
Program doxygen skipped: feature docs disabled
Build targets in project: 15
opus 1.5.1
Compiler support
C99 var arrays : NO
C99 lrintf : YES
Use alloca : YES
Optimizations
Floating point support : YES
Fast float approximations : NO
Fixed point debugging : NO
Inline assembly optimizations : none
External assembly optimizations: none
Intrinsics optimizations : SSE, SSE2, SSE4.1, AVX2
Run-time CPU detection : SSE, SSE2, SSE4.1, AVX2
General configuration
Custom modes : NO
Assertions : NO
Hardening : YES
Fuzzing : NO
Check ASM : NO
API documentation : NO
Extra programs : YES
Tests : NO
User defined options
buildtype : debugoptimized
prefix : C:\gtk-build\gtk\x64\release
docs : disabled
tests : disabled
Found ninja-1.11.1 at C:\gtk-build\tools\ninja-1.11.1\ninja.EXE
[143/175] Compiling C object dnn/libdnn_avx2.a.p/x86_nnet_avx2.c.obj
FAILED: dnn/libdnn_avx2.a.p/x86_nnet_avx2.c.obj
"cl" "-Idnn\libdnn_avx2.a.p" "-Idnn" "-I..\dnn" "-I." "-I.." "-Iinclude" "-I..\include" "-Icelt" "-I..\celt" "-Isilk" "-I..\silk" "/MD" "/nologo" "/showInclud
es" "/utf-8" "/W3" "/O2" "/Zi" "-DOPUS_BUILD" "-DHAVE_CONFIG_H" "-D_CRT_SECURE_NO_WARNINGS" "/wd4035" "/wd4715" "/wd4116" "/wd4046" "/wd4068" "/wd4820" "/wd4244" "/wd4255" "/wd4668" "/Fddnn\libdnn_avx2.a.p\x86_nnet_avx2.c.pdb" /Fodnn/libdnn_avx2.a.p/x86_nnet_avx2.c.obj "/c" ../dnn/x86/nnet_avx2.c
../dnn/x86/nnet_avx2.c(35): fatal error C1189: #error: nnet_avx2.c is being compiled without AVX2 enabled
[147/175] Compiling C object dnn/libdnn_sse2.a.p/x86_nnet_sse2.c.obj
C:\gtk-build\build\x64\release\opus\dnn\vec_avx.h(350): warning C4305: 'function': truncation from 'double' to 'float'
[148/175] Compiling C object dnn/libdnn_sse4_1.a.p/x86_nnet_sse4_1.c.obj
C:\gtk-build\build\x64\release\opus\dnn\vec_avx.h(350): warning C4305: 'function': truncation from 'double' to 'float'
ninja: build stopped: subcommand failed.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Meson target compiling dnn/x86/nnet_avx2.c and compare its compiler arguments with the working CMake build, focusing on how AVX2 is enabled for MSVC. Reproduce the Windows x86_64 build and confirm that the AVX2 source compiles successfully without changing the CMake path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100