diff --git a/proto-opencl/host.c b/proto-opencl/host.c index 4cfb2cb02..541958450 100644 --- a/proto-opencl/host.c +++ b/proto-opencl/host.c @@ -11,6 +11,10 @@ // // Build: see README.md (macOS -framework OpenCL, Linux -lOpenCL, Windows cl.exe + OpenCL.lib), or build.sh / build.bat. +#if !defined(_WIN32) && !defined(__APPLE__) && !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 200809L /* clock_gettime and strtok_r under -std=c99 on Linux (glibc hides them without it; the kit build of 7 October 2026) */ +#define _DEFAULT_SOURCE +#endif #define _CRT_SECURE_NO_WARNINGS #define CL_TARGET_OPENCL_VERSION 120 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS diff --git a/tools/class-v5/kits-remote.sh b/tools/class-v5/kits-remote.sh index 2223ea780..7618207e9 100755 --- a/tools/class-v5/kits-remote.sh +++ b/tools/class-v5/kits-remote.sh @@ -49,7 +49,9 @@ g++ -std=c++17 -O2 -Wall -Wextra -I proto-cuda/nvrtc -I /usr/local/cuda/include step windows-cuda-worker x86_64-w64-mingw32-g++ -std=c++17 -O2 -Wall -Wextra -static -I proto-cuda/nvrtc -I /usr/local/cuda/include -o \$S/bin/windows/igneum-worker-cuda.exe proto-cuda/nvrtc/worker.cpp 2> \$T/cuda-win.log && x86_64-w64-mingw32-strip \$S/bin/windows/igneum-worker-cuda.exe || { fail "windows cuda worker"; head -20 \$T/cuda-win.log; } step windows-opencl-worker -x86_64-w64-mingw32-gcc -std=c99 -O2 -Wall -Wextra -Wno-stringop-truncation -Wno-format-truncation -static -DIGNEUM_CL_DYNAMIC -DCL_TARGET_OPENCL_VERSION=120 -I /usr/include -I proto-cuda/packs/igneum-devnet-v4-epoch0 -DIGNEUM_KERNEL_PATH='"kernel_bound.cl"' -o \$S/bin/windows/igneum-worker-opencl.exe proto-opencl/host.c 2> \$T/cl-win.log && x86_64-w64-mingw32-strip \$S/bin/windows/igneum-worker-opencl.exe || { fail "windows opencl worker"; head -20 \$T/cl-win.log; } +# the Khronos CL headers alone (never -I /usr/include: that puts glibc's stdint.h ahead of mingw's) +mkdir -p \$T/inc && cp -r /usr/include/CL \$T/inc/ +x86_64-w64-mingw32-gcc -std=c99 -O2 -Wall -Wextra -Wno-stringop-truncation -Wno-format-truncation -static -DIGNEUM_CL_DYNAMIC -DCL_TARGET_OPENCL_VERSION=120 -I \$T/inc -I proto-cuda/packs/igneum-devnet-v4-epoch0 -DIGNEUM_KERNEL_PATH='"kernel_bound.cl"' -o \$S/bin/windows/igneum-worker-opencl.exe proto-opencl/host.c 2> \$T/cl-win.log && x86_64-w64-mingw32-strip \$S/bin/windows/igneum-worker-opencl.exe || { fail "windows opencl worker"; head -20 \$T/cl-win.log; } if [ $SKIP_EMU = 0 ]; then step emu-check-v5 # the CPU emulation (proto-cuda/nvrtc/emu/test.sh's build) with pack A = the class v5 pack and pack B = the v4 control @@ -65,6 +67,7 @@ if [ $SKIP_EMU = 0 ]; then grep -E '^check PASS|self-test|FAIL|error' \$T/emu-check.log | cut -c1-400 fi fi +if [ \$rc != 0 ]; then echo "KIT not written: a step failed (rc \$rc)"; mkdir -p /srv/builds/_log/v5-class/kits-$STAMP && cp \$T/*.log /srv/builds/_log/v5-class/kits-$STAMP/; echo "LOGS /srv/builds/_log/v5-class/kits-$STAMP"; rm -rf \$T; exit 1; fi step stage for p in v4-genesis v5-genesis v5-dn3-epoch0; do mkdir -p \$S/packs/\$p; cp proto-cuda/packs-ca3-v5/\$p/* \$S/packs/\$p/; done cp proto-cuda/nvrtc/worker.cpp proto-cuda/nvrtc/packfile.h proto-cuda/nvrtc/cuda_api.h proto-opencl/host.c proto-opencl/cl_dynamic.h proto-newpow/class-v5/bench.cu proto-newpow/class-v5/run.sh proto-metal/packbench.swift \$S/src/ @@ -105,8 +108,10 @@ echo "LOGS /srv/builds/_log/v5-class/kits-$STAMP" rm -rf \$T ( exit \$rc ) EOF2 +set +e BR_KIND=build BR_COMMAND="class v5 kits (packfile-test, emu --check v5, Linux and Windows workers, kit zip)" BR_TARGET="x86_64-linux+windows" BR_ARTEFACTS="" \ - bs_remote_run "$WT" "$BS_WT class-v5 kits" "$CMD" 2>&1 | tee "/tmp/v5-kits-$STAMP.log" | grep -E '^(STEP|FAIL|KIT|BIN|LOGS|check PASS|self-test|packfile-test|emu:| v5|build-remote: RESULT)' || true -rc=${PIPESTATUS[0]} + bs_remote_run "$WT" "$BS_WT class-v5 kits" "$CMD" 2>&1 | tee "/tmp/v5-kits-$STAMP.log" | grep -E '^(STEP|FAIL|KIT|BIN|LOGS|check PASS|self-test|packfile-test|emu:| v5|build-remote: RESULT)' +rc=${PIPESTATUS[0]} # the remote runner's status, read before anything else runs (the first run read `true`'s and called a failed build built) +set -e bs_wt_unlock [ "$rc" = 0 ] && bs_log "class v5 kits built: $ZIP" || bs_die "class v5 kits FAILED (rc $rc); full log /tmp/v5-kits-$STAMP.log"