Build solvcon¶
All workflows are driven through make from the repository root. The Makefile
wraps CMake and sets PYTHONPATH so the in-tree _solvcon extension is picked
up without installation.
make: build the_solvconPython extension (the default target).make pilot: build the Qt pilot GUI binary.make clean/make cmakeclean: remove build artifacts.
Build Types¶
CMAKE_BUILD_TYPE selects one of CMake’s three standard build types. Each
gets its own build tree, so switching between them never invalidates another
one’s cache. <pyvminor> is the active Python major and minor version, e.g.
314.
|
Build tree |
Flags |
|---|---|---|
|
|
|
|
|
|
|
|
|
The default is RelWithDebInfo: optimized, and carrying the debug symbols
that let a debugger name a function and a line. It is what you want unless
you have a reason to want something else.
Release drops the symbols, which compiles noticeably faster and leaves a
much smaller build tree, so it suits a session that is only going to run the
test suite. It is not merely the default minus -g: pybind11 gives the
extension module a set of extras for every build type except Debug and
RelWithDebInfo, so under Release the module is also link-time optimized
and stripped. Stripping is why a debugger can name a frame inside
_solvcon under the default and not under Release.
Debug turns the optimizer off. Reach for it when you need to step through
code and inspect variables, which RelWithDebInfo does poorly because -O3
inlines functions and discards variables.
The trees are separate but they all write the extension module to solvcon/,
so whichever built last is the one Python imports. Building a tree whose
objects are already current does not relink, which means switching build types
alone does not replace the installed module. Build the type you want last, or
touch a source to force the relink.
Build Options¶
The Makefile configures through cmake --preset, so the defaults are the ones
in CMakePresets.json: dev-reldbg, dev-rel, and dev-dbg for the three
build types above. It adds only the ABI-tagged build directory, the generator,
and whatever options are set below, each of which becomes a -D flag layered
on the preset. Set CMAKE_PRESET to build a different preset, for instance
one of your own from CMakeUserPresets.json.
Key options can be set on the command line, in setup.mk (which is read by
Makefile), or as environment variables:
Variable |
Default |
Purpose |
|---|---|---|
|
|
see the table above |
|
|
build the Qt GUI components |
|
|
build Metal GPU support (macOS) |
|
|
enable the runtime profiler |
|
|
run clang-tidy during the build |
|
|
use ccache when it is installed |
Install ccache (brew install ccache, apt install ccache) to make a
rebuild after make cmakeclean mostly cache hits; a host without it builds
the same way as before, and an MSVC build skips the cache either way. The
configure log says use ccache or not use ccache. An existing build tree
picks up an install or an uninstall on its next configure, which
make cmakeclean forces.
CMake itself is configured through CMakePresets.json; see
CMake Presets for the preset a Windows build or an IDE selects, and
for where the paths of a local dependency prefix belong.