glm: honest short-read reporting in expert pread; Makefile: -pthread for *BSD
Two small correctness fixes surfaced by community reports on non-Linux hosts: #236 — expert_load's buffered pread paths (slab + qs scales) used perror("pread expert") on a short read. Since pread returned a short count (not -1), errno stays 0 and perror prints "Success" — a confusing message right before exit(1) in the score/bench path. New pread_full() helper loops over short reads and EINTR and reports actual/expected bytes and offset, so a truncated shard reads as such instead of "Success". #219 — Linux pulls -pthread in via -fopenmp; the *BSDs do not, so pthread_* fail to link there. Added -pthread to the generic (Linux/*BSD x86-64) and aarch64 CFLAGS/LDFLAGS. No-op on Linux, required on FreeBSD (complements #206). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+6
-5
@@ -70,18 +70,19 @@ ifneq (,$(PPC64))
|
||||
# (validated token-exact vs the transformers oracle on a POWER8 S824).
|
||||
CC = gcc
|
||||
ARCH ?= native
|
||||
CFLAGS = -O3 -mcpu=$(ARCH) -fopenmp -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function
|
||||
LDFLAGS = -lm -fopenmp
|
||||
CFLAGS = -O3 -mcpu=$(ARCH) -fopenmp -pthread -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function
|
||||
LDFLAGS = -lm -fopenmp -pthread
|
||||
EXE =
|
||||
else
|
||||
# --- Linux x86-64 (percorso originale, invariato) ---
|
||||
# --- Linux / *BSD x86-64 (percorso originale, invariato) ---
|
||||
CC = gcc
|
||||
# ARCH=native -> ottimizzato per QUESTA macchina (default, piu' veloce).
|
||||
# ARCH=x86-64-v3 -> binario PORTABILE su qualsiasi x86-64 moderno con AVX2 (per distribuire).
|
||||
# ARCH=x86-64 -> massima compatibilita' (niente AVX2: usa il path scalare di fallback).
|
||||
# -pthread: Linux lo tira dentro via -fopenmp, i *BSD no e le pthread_* non risolvono (#219).
|
||||
ARCH ?= native
|
||||
CFLAGS = -O3 -march=$(ARCH) -fopenmp -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function
|
||||
LDFLAGS = -lm -fopenmp
|
||||
CFLAGS = -O3 -march=$(ARCH) -fopenmp -pthread -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function
|
||||
LDFLAGS = -lm -fopenmp -pthread
|
||||
EXE =
|
||||
endif
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user