Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
(#721, #458)

### Changed
- Command-line tools are now implemented in `pygambit` rather than C++-based compiled programs.
The `gambit-convert` utility has been removed.
- Refreshed GUI icons and standardised dialog layout and formatting
- Improved installers for Windows, and disk-image "installer" for MacOS
- Revised `StrategySupportProfile` to expose a slimmer set of operations, and
Expand Down
77 changes: 3 additions & 74 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ACLOCAL_AMFLAGS = -I m4
include build_support/catalog/catalog.am

EXTRA_DIST = \
build_support/GAMBIT_VERSION \
build_support/msw/gambit.wxs.in \
build_support/msw/banner.bmp \
build_support/msw/dialog.bmp \
Expand Down Expand Up @@ -337,27 +338,14 @@ enumpoly_SOURCES = \
src/solvers/enumpoly/nfgpoly.cc \
src/solvers/enumpoly/enumpoly.h

noinst_HEADERS = src/gambit.h src/solvers.h src/solvers/nash.h
noinst_HEADERS = src/gambit.h src/solvers.h src/solvers/nash.h src/solvers/enumpure/enumpure.h

if IS_WIN32
AM_LDFLAGS = -static -static-libgcc -static-libstdc++
endif

bin_PROGRAMS = \
gambit-convert \
gambit-enummixed \
gambit-enumpoly \
gambit-enumpure \
gambit-gnm \
gambit-ipa \
gambit-lcp \
gambit-liap \
gambit-logit \
gambit-lp \
gambit-simpdiv

if WITH_GUI
bin_PROGRAMS += gambit
bin_PROGRAMS = gambit
endif

# Read version from GAMBIT_VERSION file for use in compilation
Expand Down Expand Up @@ -385,64 +373,6 @@ liblogit_a_SOURCES = ${logit_SOURCES}
libsimpdiv_a_SOURCES = ${simpdiv_SOURCES}
libenumpoly_a_SOURCES = ${enumpoly_SOURCES}

## Command-line tools

gambit_convert_SOURCES = \
src/tools/convert/convert.cc
gambit_convert_LDADD = libgames.a libcore.a

gambit_enummixed_SOURCES = \
src/tools/util.h \
src/tools/enummixed/enummixed.cc
gambit_enummixed_LDADD = libbimatrix.a libgames.a libcore.a

gambit_enumpoly_SOURCES = \
src/tools/util.h \
src/tools/enumpoly/enumpoly.cc
gambit_enumpoly_LDADD = libenumpoly.a libgames.a libcore.a

gambit_enumpure_SOURCES = \
src/solvers/enumpure/enumpure.h \
src/tools/util.h \
src/tools/enumpure/enumpure.cc
gambit_enumpure_LDADD = libgames.a libcore.a

gambit_gnm_SOURCES = \
src/tools/gt/nfggt.cc \
src/tools/gt/nfggnm.cc
gambit_gnm_LDADD = libgtracer.a libgames.a libcore.a

gambit_ipa_SOURCES = \
src/tools/gt/nfggt.cc \
src/tools/util.h \
src/tools/gt/nfgipa.cc
gambit_ipa_LDADD = libgtracer.a libgames.a libcore.a

gambit_lcp_SOURCES = \
src/tools/util.h \
src/tools/lcp/lcp.cc
gambit_lcp_LDADD = libbimatrix.a libgames.a libcore.a

gambit_liap_SOURCES = \
src/tools/util.h \
src/tools/liap/liap.cc
gambit_liap_LDADD = libliap.a libgames.a libcore.a

gambit_logit_SOURCES = \
src/tools/util.h \
src/tools/logit/logit.cc
gambit_logit_LDADD = liblogit.a libgames.a libcore.a

gambit_lp_SOURCES = \
src/tools/util.h \
src/tools/lp/lp.cc
gambit_lp_LDADD = libbimatrix.a libgames.a libcore.a

gambit_simpdiv_SOURCES = \
src/tools/util.h \
src/tools/simpdiv/nfgsimpdiv.cc
gambit_simpdiv_LDADD = libsimpdiv.a libgames.a libcore.a

gambit_SOURCES = \
src/gui/analysis.cc \
src/gui/analysis.h \
Expand Down Expand Up @@ -554,4 +484,3 @@ clang-tidy:
clang-tidy ${top_srcdir}/src/core/*.cc -- --std=c++20 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
clang-tidy ${top_srcdir}/src/games/*.cc ${top_srcdir}/src/games/*/*.cc -- --std=c++20 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
clang-tidy ${top_srcdir}/src/solvers/*/*.cc -- --std=c++20 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
clang-tidy ${top_srcdir}/src/tools/*/*.cc -- --std=c++20 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
36 changes: 0 additions & 36 deletions build_support/msw/gambit.wxs.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,33 +79,6 @@
<Component Id="Gambit.exe" Guid="AEB0EAF8-246A-4194-9628-A4ED3092CD93" Win64="yes">
<File Id="gambit.exe" Source="installer\gambit.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_enummixed.exe" Guid="E529AE61-6BF7-418B-8EB7-24758D2F1A32" Win64="yes">
<File Id="gambit_enummixed.exe" Source="installer\gambit-enummixed.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_enumpure.exe" Guid="2B2FBF6E-ABBF-4189-AAF2-F66F63F07FE2" Win64="yes">
<File Id="gambit_enumpure.exe" Source="installer\gambit-enumpure.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_gnm.exe" Guid="E10C0653-EAFD-4C3D-9AE1-5BDE68A28585" Win64="yes">
<File Id="gambit_gnm.exe" Source="installer\gambit-gnm.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_ipa.exe" Guid="9E5E5696-080B-4205-A8DF-75800A50497B" Win64="yes">
<File Id="gambit_ipa.exe" Source="installer\gambit-ipa.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_lcp.exe" Guid="5A9D4F65-7748-4041-B886-C41E016815AB" Win64="yes">
<File Id="gambit_lcp.exe" Source="installer\gambit-lcp.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_liap.exe" Guid="BD9D75A2-D2A4-460F-AAB2-C3EA34488A1A" Win64="yes">
<File Id="gambit_liap.exe" Source="installer\gambit-liap.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_logit.exe" Guid="FA43C551-4B1D-4914-8D5B-596830142257" Win64="yes">
<File Id="gambit_logit.exe" Source="installer\gambit-logit.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_lp.exe" Guid="81CCED15-E164-4F1B-B57D-FBEB7F877E4B" Win64="yes">
<File Id="gambit_lp.exe" Source="installer\gambit-lp.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit_simpdiv.exe" Guid="354FC5CE-9067-4910-83CB-6014CC4318EF" Win64="yes">
<File Id="gambit_simpdiv.exe" Source="installer\gambit-simpdiv.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Gambit.copying" Guid="F3CFB57F-7C3E-4E9C-AA80-C9BED8B1FAF4" Win64="yes">
<File Id="copying.txt" Source="COPYING" Name="COPYING.txt" KeyPath="yes"/>
</Component>
Expand All @@ -130,15 +103,6 @@
</DirectoryRef>
<Feature Id="Complete" Level="1">
<ComponentRef Id="Gambit.exe"/>
<ComponentRef Id="Gambit_enummixed.exe"/>
<ComponentRef Id="Gambit_enumpure.exe"/>
<ComponentRef Id="Gambit_gnm.exe"/>
<ComponentRef Id="Gambit_ipa.exe"/>
<ComponentRef Id="Gambit_lcp.exe"/>
<ComponentRef Id="Gambit_liap.exe"/>
<ComponentRef Id="Gambit_logit.exe"/>
<ComponentRef Id="Gambit_lp.exe"/>
<ComponentRef Id="Gambit_simpdiv.exe"/>
<ComponentRef Id="Gambit.copying"/>
<ComponentRef Id="ApplicationShortcut"/>
</Feature>
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ construction and analysis of finite extensive and strategic games.
.. grid-item-card:: 💻 Command-line interface
:columns: 3

Use Gambit's command-line tools for scripting.
Run equilibrium calculations from the command-line.

.. button-ref:: command-line
:ref-type: ref
Expand Down
6 changes: 0 additions & 6 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ The current stable release of Gambit is |release|.

`./configure --prefix=/your/path/here`

.. warning::
The graphical interface relies on external calls to other
programs built in this process, especially for the computation of
equilibria. It is strongly recommended that you install the Gambit
executables to a directory in your path!

All past releases are available on the
`GitHub releases page <https://github.com/gambitproject/gambit/releases>`__.

Expand Down
4 changes: 3 additions & 1 deletion doc/pygambit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ PyGambit

See installation instructions in the :ref:`install` section.


For newcomers to Gambit, we recommend reading through the PyGambit tutorials, which demonstrate the API's key capabilities for analyzing and solving games.
All of these tutorials assume a basic knowledge of programming in Python.

You can run the tutorials interactively as Jupyter notebooks, see :ref:`local_tutorials`.

Installing PyGambit also installs Gambit's :ref:`command-line tools <command-line>`
for computing Nash equilibria from the shell or from scripts.

New user tutorials
------------------

Expand Down
15 changes: 9 additions & 6 deletions doc/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
CLI
***

See installation instructions in the :ref:`install-cli-gui` section.

Gambit provides command-line interfaces for each method for computing
Nash equilibria. These are suitable for scripting or calling from
other programs. This chapter describes the use of these programs.
For a general overview of methods for computing equilibria,
see the survey of :cite:p:`McKMcL96`.

The graphical interface also provides a frontend for calling these
programs and evaluating their output. Direct use of the command-line
programs is intended for advanced users and applications.
.. versionchanged:: 17.0.0

These programs are now implemented in Python, as part of the
:ref:`pygambit <pygambit>` package, rather than being separate
C++ executables. Installing PyGambit (``pip install pygambit``,
see :ref:`install`) installs these command-line programs alongside
it; no separate download or build is needed. Each program's
command-line interface, options, and output are unchanged from
the previous C++ versions, except as otherwise noted.

These programs take an extensive or strategic game file, which can be
specified on the command line or piped via standard input, and output
Expand Down Expand Up @@ -49,4 +53,3 @@ documentation.
tools.logit
tools.gnm
tools.ipa
tools.convert
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,21 @@ dependencies = [
"numpy",
"scipy",
"pandas",
"click",
]

[project.scripts]
gambit-enumpure = "pygambit.cli.enumpure:main"
gambit-logit = "pygambit.cli.logit:main"
gambit-enummixed = "pygambit.cli.enummixed:main"
gambit-lcp = "pygambit.cli.lcp:main"
gambit-lp = "pygambit.cli.lp:main"
gambit-liap = "pygambit.cli.liap:main"
gambit-simpdiv = "pygambit.cli.simpdiv:main"
gambit-gnm = "pygambit.cli.gnm:main"
gambit-ipa = "pygambit.cli.ipa:main"
gambit-enumpoly = "pygambit.cli.enumpoly:main"

[project.optional-dependencies]
test = ["pytest", "pytest-subtests", "nbformat", "nbclient", "ipykernel"]
doc = [
Expand Down Expand Up @@ -124,7 +137,7 @@ markers = [
]

[tool.setuptools]
packages = ["pygambit"]
packages = ["pygambit", "pygambit.cli"]
package-dir = { "pygambit" = "src/pygambit" }

[tool.setuptools.package-data]
Expand Down
22 changes: 22 additions & 0 deletions src/pygambit/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is part of Gambit
# Copyright (c) 1994-2026, The Gambit Project (https://www.gambit-project.org)
#
# FILE: src/pygambit/cli/__init__.py
# Command-line tools for computing Nash equilibria, implemented in Python
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
"""Command-line tools for computing Nash equilibria, implemented in Python."""
Loading
Loading