diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-10 05:00:43 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:27:03 +0200 |
| commit | c64c45ef1e42bbbae45d78b4f832163e461f141d (patch) | |
| tree | 8941eed35cef54cb81b72570ca27245afd14d1bb | |
| parent | 585ce41a3647bff2a17f42fbdf4223a92ab81413 (diff) | |
| download | ffwd-c64c45ef1e42bbbae45d78b4f832163e461f141d.tar.gz ffwd-c64c45ef1e42bbbae45d78b4f832163e461f141d.zip | |
build: allow FP reassociation/contraction, keep finite-math off
| -rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,7 +1,11 @@ CC = gcc -# Keep IEEE math semantics by default. Some GCC/OpenBLAS Linux builds produced -# NaN embeddings with -ffast-math. -CFLAGS_BASE = -Wall -Wextra -O3 -march=native +# Allow FP reassociation and contraction so reduction loops vectorize, but do +# not assume finite math or approximate libm calls: full -ffast-math produced +# NaN embeddings on GCC/OpenBLAS Linux builds (-ffinite-math-only and +# -fapprox-func are the unsafe parts and stay off). +CFLAGS_BASE = -Wall -Wextra -O3 -march=native \ + -fno-math-errno -ffp-contract=fast -fno-trapping-math \ + -fno-signed-zeros -fassociative-math -freciprocal-math LDFLAGS = -lm -lpthread CJSON_CFLAGS ?= $(shell sh -c 'pkg-config --cflags libcjson 2>/dev/null') CJSON_LDFLAGS ?= $(shell sh -c 'pkg-config --libs libcjson 2>/dev/null') |
