@@ -15,10 +15,7 @@ if is_windows
1515 add_project_arguments (' -DWIN32' , ' -D_WINDOWS' , language : [' c' , ' cpp' ])
1616endif
1717
18- qblas_dep = dependency (' qblas' , fallback : [' qblas' , ' qblas_dep' ])
1918
20- # Try to find SLEEF system-wide first, fall back to subproject if not found
21- # Required SLEEF version (must match sleef.wrap revision)
2219required_sleef_version = ' 3.9.0'
2320# Don't use fallback here - we need to call subproject() explicitly later with disable_fma option
2421sleef_dep = dependency (' sleef' , version : ' >=' + required_sleef_version, required : false )
@@ -30,7 +27,7 @@ if sleef_dep.found() and sleef_dep.version().startswith(required_sleef_version)
3027 # SLEEF found system-wide - verify quad-precision support
3128 cpp = meson .get_compiler(' cpp' )
3229 sleefquad_lib = cpp.find_library (' sleefquad' , required : false )
33-
30+
3431 if sleefquad_lib.found()
3532 sleefquad_test_code = '''
3633 #include <sleefquad.h>
@@ -48,7 +45,7 @@ if sleef_dep.found() and sleef_dep.version().startswith(required_sleef_version)
4845 dependencies : [sleef_dep, sleefquad_lib],
4946 name : ' SLEEF quad-precision support'
5047 )
51-
48+
5249 if quad_works
5350 sleefquad_dep = declare_dependency (
5451 dependencies : [sleef_dep, sleefquad_lib]
8077 message (' Proceeding with vendored SLEEF subproject instead' )
8178endif
8279
80+ # QBLAS does not build under MSVC (GCC-only flags, POSIX-only APIs, GCC
81+ # built-ins for CPUID); force-disable it on Windows. Users on other
82+ # platforms can opt out via -Ddisable_quadblas=true to fall back to the
83+ # naive matmul kernel.
84+ disable_quadblas = is_windows or get_option (' disable_quadblas' )
85+ if disable_quadblas
86+ if is_windows
87+ message (' QBLAS disabled (Windows / MSVC) - using naive matmul kernel' )
88+ else
89+ message (' QBLAS disabled by user option - using naive matmul kernel' )
90+ endif
91+ add_project_arguments (' -DDISABLE_QUADBLAS' , language : [' c' , ' cpp' ])
92+ qblas_dep = declare_dependency ()
93+ else
94+ qblas_dep = dependency (' qblas' , fallback : [' qblas' , ' qblas_dep' ])
95+ endif
96+
8397incdir_numpy = run_command (py,
8498 [' -c' , ' import numpy; print(numpy.get_include())' ],
8599 check : true
@@ -101,12 +115,6 @@ npymath_lib = c.find_library('npymath', dirs: npymath_path)
101115
102116dependencies = [py_dep, qblas_dep, sleef_dep, sleefquad_dep, npymath_lib]
103117
104- # Add OpenMP dependency (optional, for threading)
105- openmp_dep = dependency (' openmp' , required : false , static : false )
106- if openmp_dep.found()
107- dependencies += openmp_dep
108- endif
109-
110118# compiler flags for QBLAS compatibility
111119if not is_windows
112120 # QBLAS requires extended numeric literals for Q suffix support
0 commit comments