Master Coder — C

Every C command and flag for Grok16 @ 16.1.1. Use g16 only — it detects .c / -std=gnu17 and runs g16-cc.

C commands & driver

#ItemShortDetail
1g16Unified driverSingle ELF at bin/g16. Inspects argv[0], -std=, -x, and source extensions (.c vs .cpp). Dispatches to libexec/grok16/g16-cc for C. No separate C command — always g16.
2g16-ccC backendRelocated GCC C driver after install. Real ELF from upstream program-transform. Unified g16 execv() here when C mode is detected.
3g16 -std=gnu17Default C standardG16_C_STD defaults to gnu17 (C17 + GNU extensions). Applied when compiling .c files or when -std=gnu17|c17|… is passed. Override per translation unit.
4verify (C leg)C smoke compilegrok16-toolchain.sh verify compiles verify.c with g16 -std=${G16_C_STD}. Proves unified driver reaches g16-cc and frontend accepts gnu17.
5PROFILE cC compile flagspythong grok16-profile-flags.py field_opt c — emits -std=gnu17 -O3 -march=native plus profile -D macros. Use for C kernels and L0 glue.
6PROFILE c_linkC link flagsSame link_flags as CXX profiles (LTO/OpenMP). Unified g16 still auto-selects g16-cc for link when inputs are C-only.
7PROFILE c_pgo_genC PGO generateAdds -fprofile-generate=${GROK16_ROOT}/data/pgo to C flags. Run profile command, then rebuild consumers with G16_ENABLE_PGO=1.
8PROFILE c_pgo_useC PGO useAdds -fprofile-use for C builds after training. Pairs with cxx_pgo_use for mixed projects.
9G16_C_STDC standard envExported by grok16-config.sh from data/grok16-version.json. Default gnu17. Used by verify, CMake GROK16_C_STD, and manual g16 invocations.
10G16_FORCE_C=1Force C backendOverride detection — unified g16 always execs g16-cc even for .cpp (debug only).
11bootstrapFirst buildFetch GCC 15, patch BASE-VER 16.1.1, host-build, install, relocate backends, install unified g16. Produces working C path without separate gcc binary name.
12rebuildSelf-hostSelf-host uses libexec/g16-cc and g16-cxx as CC/CXX during gcc_rebuild — not the unified wrapper — avoiding bootstrap recursion.
13installPost-installRegenerates VERSION, cmake, manifest. Confirms g16 -dumpversion == 16.1.1. Re-runs driver/Makefile install if present.
14pathsPaths dumpPrints G16_DRIVER, G16_BACKEND_CC, G16_C_STD, GROK16_ROOT, G16_PREFIX. Use before scripting C builds.
15bench (C future)C benchmarks16.1.1 benches remain CXX-first; C flags available via PROFILE c for mixed stacks. Add examples/minimal-c-project to CI smoke.
16build-cpp.shWRDT L2World_Redata C++ engine; C sources in redata use host python. Grok16 C path validates toolchain for embedded .c in future L2 splits.
17libexec/grok16/Backend dirg16-cc and g16-cxx live here after relocate. Marker .relocated prevents double-move on reinstall.