From 75270dcaa4f4ae6a2ef11e428c62043fed5af07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schnabel?= Date: Wed, 18 Nov 2026 14:23:15 +0100 Subject: [PATCH] Add optdef2md.py to generate the GAMS doc option table from optcuopt.def --- CONTRIBUTING.md | 2 +- optdef2md.py | 160 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 1 deletion(-) create mode 100755 optdef2md.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67855b1..509240f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ GAMSDIST=/path/to/gams ./build-link.sh `build-link.sh` compiles `gmscuopt.out` for CUDA 13, sets its RPATH (needs `gcc` and `patchelf`), and copies it together with the cuOpt and CUDA libraries and the files from `assets/` into `$GAMSDIST`. Since that includes `gamsconfig_cuopt.yaml`, merge it into `gamsconfig.yaml` as described in the [README](README.md#manual-installation). The CI workflows in `.github/workflows` build the release archives for CUDA 12 and 13 on x86_64 and arm64. -New or changed cuOpt options go into `assets/optcuopt.def` and have to be passed on to cuOpt in `gmscuopt.c`. +New or changed cuOpt options go into `assets/optcuopt.def` and have to be passed on to cuOpt in `gmscuopt.c`. The option table of the cuOpt page in the GAMS documentation is generated from this file with `python3 optdef2md.py`, which writes `optcuopt_s.md`. ## Testing diff --git a/optdef2md.py b/optdef2md.py new file mode 100755 index 0000000..8bb5eff --- /dev/null +++ b/optdef2md.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 +"""Generate the option table of the GAMS solver manual from a GAMS option definition file. + +Reads e.g. assets/optcuopt.def and writes optcuopt_s.md in the format that the GAMS +documentation includes into the solver manual page (same layout as the tables written by +GamsOptionsSpecWriter for other solver links): one subsection per option group, one table row +per visible option, with doxygen anchors