Skip to content

Commit 97bb9bb

Browse files
committed
spike: windows descriptor v2 — jpeg SIMD off (C fallback) + -lole32
Resolves all 124 jpeg-turbo NASM link errors (WITH_SIMD=0 -> jsimd-none.c + C jpeg_nbits_table) and CoCreateGuid (-lole32). 17 source globs (asm gone), 174 generated. utf-8.
1 parent 601c540 commit 97bb9bb

1 file changed

Lines changed: 22 additions & 54 deletions

File tree

‎pkgs/c/compat.opencvwin.lua‎

Lines changed: 22 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Auto-generated by tools/compat-opencv/gen_descriptor.py — do not edit by hand.
1+
-- Auto-generated by tools/compat-opencv/gen_descriptor.py — do not edit by hand.
22
-- Recipe: OpenCV 5.0.0 built FROM SOURCE by mcpp (no CMake at build
33
-- time). Scope: core imgproc imgcodecs highgui videoio (+ flann, geometry
44
-- dependency closure); hermetic profile (all external probes OFF, vendored
@@ -9,7 +9,7 @@
99
-- #234 made the v1 forwarding-stub layer obsolete); only the libjpeg-turbo
1010
-- BITS_IN_JSAMPLE=12/16 re-compiles and the build-time generators (fonts,
1111
-- OpenCL kernel embeddings) are synthesized on the consumer by the embedded
12-
-- build.mcpp — byte-faithful ports verified against the reference CMake
12+
-- build.mcpp — byte-faithful ports verified against the reference CMake
1313
-- build. Regenerate: sh tools/compat-opencv/gen_config.sh (this repo).
1414
package = {
1515
spec = "1",
@@ -41,8 +41,6 @@ package = {
4141
"*/3rdparty/dlpack/include",
4242
"mcpp_generated/3rdparty/libjpeg-turbo",
4343
"*/3rdparty/libjpeg-turbo/src",
44-
"*/3rdparty/libjpeg-turbo/simd/nasm",
45-
"*/3rdparty/libjpeg-turbo/simd/x86_64",
4644
"mcpp_generated/3rdparty/zlib",
4745
"*/3rdparty/zlib",
4846
"*/modules/core/include",
@@ -74,7 +72,6 @@ package = {
7472
{ glob = "**/3rdparty/mlas/**" },
7573
{ glob = "**/3rdparty/libpng/**", defines = { "HAVE_STDARG_H=1", "NDEBUG", "PNG_INTEL_SSE_OPT=1", "WIN32", "_CRT_NONSTDC_NO_DEPRECATE", "_CRT_SECURE_NO_DEPRECATE", "_SCL_SECURE_NO_WARNINGS", "_VARIADIC_MAX=10", "_WIN32_WINNT=0x0601", "_WINDOWS" } },
7674
{ glob = "**/3rdparty/zlib/**", defines = { "HAVE_STDARG_H=1", "NDEBUG", "NO_FSEEKO", "WIN32", "_CRT_NONSTDC_NO_DEPRECATE", "_CRT_SECURE_NO_DEPRECATE", "_SCL_SECURE_NO_WARNINGS", "_VARIADIC_MAX=10", "_WIN32_WINNT=0x0601", "_WINDOWS" } },
77-
{ glob = "**/*.asm", defines = { "NO_GETENV", "NO_PUTENV", "WIN64", "_VARIADIC_MAX=10", "_WIN32_WINNT=0x0601", "__x86_64__" } },
7875
{ glob = "**/modules/core/**/*.avx.cpp", defines = { "CV_CPU_COMPILE_AVX=1", "CV_CPU_COMPILE_POPCNT=1", "CV_CPU_COMPILE_SSE4_1=1", "CV_CPU_COMPILE_SSE4_2=1", "CV_CPU_COMPILE_SSSE3=1", "CV_CPU_DISPATCH_MODE=AVX" }, cxxflags = { "-mssse3", "-msse4.1", "-mpopcnt", "-msse4.2", "-mavx" } },
7976
{ glob = "**/modules/core/**/*.avx2.cpp", defines = { "CV_CPU_COMPILE_AVX2=1", "CV_CPU_COMPILE_AVX=1", "CV_CPU_COMPILE_FMA3=1", "CV_CPU_COMPILE_FP16=1", "CV_CPU_COMPILE_POPCNT=1", "CV_CPU_COMPILE_SSE4_1=1", "CV_CPU_COMPILE_SSE4_2=1", "CV_CPU_COMPILE_SSSE3=1", "CV_CPU_DISPATCH_MODE=AVX2" }, cxxflags = { "-mssse3", "-msse4.1", "-mpopcnt", "-msse4.2", "-mavx", "-mf16c", "-mavx2", "-mfma" } },
8077
{ glob = "**/modules/core/**/*.avx512_skx.cpp", defines = { "CV_CPU_COMPILE_AVX2=1", "CV_CPU_COMPILE_AVX512_COMMON=1", "CV_CPU_COMPILE_AVX512_SKX=1", "CV_CPU_COMPILE_AVX=1", "CV_CPU_COMPILE_AVX_512F=1", "CV_CPU_COMPILE_FMA3=1", "CV_CPU_COMPILE_FP16=1", "CV_CPU_COMPILE_POPCNT=1", "CV_CPU_COMPILE_SSE4_1=1", "CV_CPU_COMPILE_SSE4_2=1", "CV_CPU_COMPILE_SSSE3=1", "CV_CPU_DISPATCH_MODE=AVX512_SKX" }, cxxflags = { "-mssse3", "-msse4.1", "-mpopcnt", "-msse4.2", "-mavx", "-mf16c", "-mavx2", "-mfma", "-mavx512f", "-mavx512f", "-mavx512cd", "-mavx512f", "-mavx512cd", "-mavx512vl", "-mavx512bw", "-mavx512dq" } },
@@ -97,9 +94,9 @@ package = {
9794
-- `unifont`: Unicode/CJK putText coverage. Pulls the font asset
9895
-- package and defines HAVE_UNIFONT (drawing_text.cpp gates on it);
9996
-- build.mcpp sees MCPP_FEATURE_UNIFONT=1 and hex-embeds the font
100-
-- (builtin_font_uni.h). Not part of the reference profile — the
97+
-- (builtin_font_uni.h). Not part of the reference profile — the
10198
-- embed machinery is byte-faithful to cmake's ocv_blob2hdr either way.
102-
-- `dnn`: the deep-learning module as an ADDITIVE feature — its
99+
-- `dnn`: the deep-learning module as an ADDITIVE feature — its
103100
-- sources (0 TUs: modules/dnn + vendored protobuf + mlas incl.
104101
-- .S kernels) join the same lib; HAVE_OPENCV_DNN arrives via the
105102
-- build.mcpp-selected opencv_modules.hpp variant, no extra deps.
@@ -116,10 +113,9 @@ package = {
116113
},
117114
},
118115
windows = {
119-
ldflags = { },
116+
ldflags = { "-lole32" },
120117
},
121118
sources = {
122-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jsimd.c",
123119
"*/3rdparty/libjpeg-turbo/src/{jaricom,jcapimin,jcapistd,jcarith,jccoefct,jccolor,jcdctmgr,jcdiffct,jchuff,jcicc,jcinit,jclhuff,jclossls,jcmainct,jcmarker,jcmaster,jcomapi,jcparam,jcphuff,jcprepct,jcsample,jctrans,jdapimin,jdapistd,jdarith,jdatadst,jdatasrc,jdcoefct,jdcolor,jddctmgr,jddiffct,jdhuff,jdicc,jdinput,jdlhuff,jdlossls,jdmainct,jdmarker,jdmaster,jdmerge,jdphuff,jdpostct,jdsample,jdtrans,jerror,jfdctflt,jfdctfst,jfdctint,jidctflt,jidctfst,jidctint,jidctred,jmemmgr,jmemnobs,jpeg_nbits,jquant1,jquant2,jutils}.c",
124120
"*/3rdparty/libpng/*.c",
125121
"*/3rdparty/libpng/intel/*.c",
@@ -137,50 +133,23 @@ package = {
137133
"*/modules/imgproc/src/{accum,accum.dispatch,bilateral_filter.dispatch,blend,box_filter.dispatch,canny,clahe,color,color_hsv.dispatch,color_lab,color_rgb.dispatch,color_yuv.dispatch,colormap,connectedcomponents,contours_approx,contours_common,contours_link,contours_new,contours_truco,corner,corner.avx,cornersubpix,demosaicing,deriv,distransform,drawing,drawing_text,emd_new,filter.dispatch,fisheye,floodfill,gabor,generalized_hough,grabcut,histogram,hough,imgwarp,imgwarp.avx2,imgwarp.sse4_1,lsd,main,median_blur.dispatch,morph.dispatch,phasecorr,phasecorr_iterative,pyramids,resize,resize.avx2,resize.sse4_1,samplers,segmentation,smooth.dispatch,spatialgradient,stackblur,stb_truetype,sumpixels.dispatch,tables,templmatch,thresh,undistort.dispatch,utils}.cpp",
138134
"mcpp_generated/modules/core/{arithm.avx2,arithm.sse4_1,convert.avx2,convert_scale.avx2,count_non_zero.avx2,has_non_zero.avx2,mathfuncs_core.avx,mathfuncs_core.avx2,matmul.avx2,matmul.avx512_skx,matmul.sse4_1,mean.avx2,merge.avx2,minmax.avx2,minmax.sse4_1,nan_mask.avx2,norm.avx,norm.avx2,norm.sse4_1,reduce.avx2,split.avx2,stat.avx2,stat.sse4_2,sum.avx2,transpose.avx,transpose.avx2}.cpp",
139135
"mcpp_generated/modules/imgproc/{accum.avx,accum.avx2,accum.sse4_1,bilateral_filter.avx2,bilateral_filter.avx512_skx,box_filter.avx2,box_filter.avx512_skx,box_filter.sse4_1,color_hsv.avx2,color_hsv.sse4_1,color_rgb.avx2,color_rgb.sse4_1,color_yuv.avx2,color_yuv.sse4_1,filter.avx2,filter.sse4_1,median_blur.avx2,median_blur.avx512_skx,median_blur.sse4_1,morph.avx2,morph.sse4_1,smooth.avx2,smooth.sse4_1,sumpixels.avx2,sumpixels.avx512_skx,undistort.avx2,warp_kernels.avx2,warp_kernels.sse4_1}.cpp",
140-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jsimdcpu.asm",
141-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jfdctflt-sse.asm",
142-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jccolor-sse2.asm",
143-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jcgray-sse2.asm",
144-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jchuff-sse2.asm",
145-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jcphuff-sse2.asm",
146-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jcsample-sse2.asm",
147-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jdcolor-sse2.asm",
148-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jdmerge-sse2.asm",
149-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jdsample-sse2.asm",
150-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jfdctfst-sse2.asm",
151-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jfdctint-sse2.asm",
152-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jidctflt-sse2.asm",
153-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jidctfst-sse2.asm",
154-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jidctint-sse2.asm",
155-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jidctred-sse2.asm",
156-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jquantf-sse2.asm",
157-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jquanti-sse2.asm",
158-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jccolor-avx2.asm",
159-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jcgray-avx2.asm",
160-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jcsample-avx2.asm",
161-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jdcolor-avx2.asm",
162-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jdmerge-avx2.asm",
163-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jdsample-avx2.asm",
164-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jfdctint-avx2.asm",
165-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jidctint-avx2.asm",
166-
"*/3rdparty/libjpeg-turbo/simd/x86_64/jquanti-avx2.asm",
167136
},
168137
generated_files = {
169138
["build.mcpp"] = [==[
170-
// build.mcpp for compat.opencv — consumer-side synthesis of OpenCV's
139+
// build.mcpp for compat.opencv — consumer-side synthesis of OpenCV's
171140
// build-time generated files from the frozen config snapshot. Embedded into
172141
// pkgs/c/compat.opencv.lua by tools/compat-opencv5/gen_descriptor.py.
173142
//
174-
// What it does (all pure transforms of files already in the pinned tarball —
143+
// What it does (all pure transforms of files already in the pinned tarball —
175144
// nothing is downloaded, nothing depends on the host):
176-
// 1. blob2hdr — modules/imgproc/fonts/*.ttf.gz → builtin_font_{sans,italic}.h
145+
// 1. blob2hdr — modules/imgproc/fonts/*.ttf.gz → builtin_font_{sans,italic}.h
177146
// (hex byte arrays; faithful port of cmake ocv_blob2hdr)
178-
// 2. cl2cpp — modules/<m>/src/opencl/*.cl → opencl_kernels_<m>.{cpp,hpp}
147+
// 2. cl2cpp — modules/<m>/src/opencl/*.cl → opencl_kernels_<m>.{cpp,hpp}
179148
// (comment-strip + string-escape + md5; faithful port of
180149
// cmake/cl2cpp.cmake; content is #ifdef HAVE_OPENCL-guarded
181150
// and inert in this profile, kept byte-faithful anyway)
182-
// 3. tu stubs — ONLY for the libjpeg-turbo BITS_IN_JSAMPLE=12/16
183-
// same-source re-compiles (one .c, three compiles — plain
151+
// 3. tu stubs — ONLY for the libjpeg-turbo BITS_IN_JSAMPLE=12/16
152+
// same-source re-compiles (one .c, three compiles — plain
184153
// sources cannot express that), driven by
185154
// mcpp_generated/tu_manifest.txt. Every other TU is a real
186155
// tarball path in `sources` since mcpp 0.0.97 (#233/#234
@@ -203,7 +172,7 @@ package = {
203172
204173
namespace fs = std::filesystem;
205174
206-
// ── tiny MD5 (RFC 1321, public-domain style condensed implementation) ────
175+
// ── tiny MD5 (RFC 1321, public-domain style condensed implementation) ────
207176
namespace md5impl {
208177
struct MD5 {
209178
uint32_t a0 = 0x67452301, b0 = 0xefcdab89, c0 = 0x98badcfe, d0 = 0x10325476;
@@ -272,10 +241,10 @@ static void spew(const fs::path& p, const std::string& content) {
272241
if (!f) { std::fprintf(stderr, "compat.opencv build.mcpp: cannot write %s\n", p.string().c_str()); std::exit(1); }
273242
}
274243
275-
// ── gunzip (raw inflate over the vendored zlib? not available here) ─────
244+
// ── gunzip (raw inflate over the vendored zlib? not available here) ─────
276245
// The .ttf.gz blobs are embedded AS-IS: cmake's ocv_blob2hdr hex-dumps the
277246
// *compressed* file bytes (OpenCV decompresses at runtime via its zlib), so
278-
// no inflate is needed here — just a hex dump.
247+
// no inflate is needed here — just a hex dump.
279248
static void blob2hdr(const fs::path& blob, const fs::path& hdr, const std::string& var) {
280249
// byte-faithful port of cmake ocv_blob2hdr: 16 bytes per line, ", "
281250
// separators, the very last ", " trimmed.
@@ -293,10 +262,10 @@ static void blob2hdr(const fs::path& blob, const fs::path& hdr, const std::strin
293262
spew(hdr, out.str());
294263
}
295264
296-
// ── cl2cpp (faithful port of cmake/cl2cpp.cmake) ────────────────────────
265+
// ── cl2cpp (faithful port of cmake/cl2cpp.cmake) ────────────────────────
297266
static std::string cl_escape(std::string lines) {
298267
std::string t;
299-
// \r removal + trailing \n + tabs→2 spaces
268+
// \r removal + trailing \n + tabs→2 spaces
300269
for (char c : lines) if (c != '\r') t.push_back(c);
301270
t.push_back('\n');
302271
std::string u;
@@ -337,7 +306,7 @@ static std::string cl_escape(std::string lines) {
337306
} else x.push_back(w[i++]);
338307
}
339308
if (!x.empty() && x.front() == '\n') x.erase(0, 1);
340-
// escape backslash, quote; newline → \n" <newline> "
309+
// escape backslash, quote; newline → \n" <newline> "
341310
std::string y;
342311
for (char c : x) {
343312
if (c == '\\') y += "\\\\";
@@ -597,7 +566,7 @@ jpeg16 3rdparty/libjpeg-turbo/src/jutils.c
597566
#define MEM_SRCDST_SUPPORTED 1
598567
599568
/* Use accelerated SIMD routines when using 8-bit samples */
600-
#define WITH_SIMD 1
569+
/* #undef WITH_SIMD */
601570
602571
/* This version of libjpeg-turbo supports run-time selection of data precision,
603572
* so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
@@ -711,7 +680,7 @@ typedef signed int INT32;
711680
#define D_ARITH_CODING_SUPPORTED 1
712681
713682
/* Use accelerated SIMD routines. */
714-
#define WITH_SIMD 1
683+
/* #undef WITH_SIMD */
715684
716685
#endif
717686
]==],
@@ -2165,10 +2134,10 @@ bool MLASCALL MlasHGemmSupported(CBLAS_TRANSPOSE, CBLAS_TRANSPOSE) { return fals
21652134
["mcpp_generated/modules/core/version_string.inc"] = [==[
21662135
"\n"
21672136
"General configuration for OpenCV 5.0.0 =====================================\n"
2168-
" Version control: 313f01d\n"
2137+
" Version control: 68a3f62\n"
21692138
"\n"
21702139
" Platform:\n"
2171-
" Timestamp: 2026-07-19T20:10:34Z\n"
2140+
" Timestamp: 2026-07-19T20:36:17Z\n"
21722141
" Host: Windows 10.0.26100 AMD64\n"
21732142
" CMake: 4.4.0\n"
21742143
" CMake generator: Ninja\n"
@@ -2221,8 +2190,7 @@ bool MLASCALL MlasHGemmSupported(CBLAS_TRANSPOSE, CBLAS_TRANSPOSE) { return fals
22212190
" Media I/O: \n"
22222191
" ZLib: build (ver 1.3.2)\n"
22232192
" JPEG: build-libjpeg-turbo (ver 3.1.2-70)\n"
2224-
" SIMD Support Request: YES\n"
2225-
" SIMD Support: YES\n"
2193+
" SIMD Support Request: NO\n"
22262194
" PNG: build (ver 1.6.57)\n"
22272195
" SIMD Support Request: YES\n"
22282196
" SIMD Support: YES (Intel SSE)\n"

0 commit comments

Comments
 (0)