Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LTspice Linux Runner

An unofficial, reproducible, headless LTspice batch runner for Linux. It uses rootless Podman and Wine so LTspice can serve as a compatibility reference when checking simulations performed with ngspice or another SPICE implementation.

LTspice is useful here as a reference simulator, not as an absolute source of truth. Simulator differences can come from device equations, parameter defaults, initial conditions, integration methods, tolerances, or measurement semantics. A disagreement should be investigated and reported, not silently resolved in favor of either simulator.

Status and supported version

Version 0.1 supports Linux x86-64, rootless Podman, and this exact LTspice release:

LTspice Installer Required SHA-256
26.0.2 LTspice64.msi 485dabd2d7d8293de733a399719f6538efda4a54b48b181a14e07271186984d3

The container base is also pinned by digest. A future LTspice release requires an explicit version and checksum update followed by the full validation suite.

The project does not provide GUI support, Docker support, or a general-purpose waveform comparison engine.

Requirements

  • Linux x86-64
  • Rootless Podman
  • fuse-overlayfs is recommended; the runner automatically uses the normal rootless Podman store when it is unavailable
  • At least 6 GiB free on the filesystem holding Podman's image storage
  • The official Windows x64 LTspice64.msi installer for version 26.0.2
  • GNU Bash and standard GNU command-line utilities
  • ngspice only for the optional comparison example

Download LTspice directly from the Analog Devices LTspice page. You are responsible for obtaining the installer and reviewing the LTspice end user license agreement. Do not add the installer to this repository.

Build and run

Build the locally tagged image:

scripts/ltspice build /path/to/LTspice64.msi

The build refuses an installer with the wrong checksum, an existing target image, or a Podman storage filesystem with less than 6 GiB available. It uses the single tag localhost/ltspice-linux:26.0.2; no latest tag is created.

Inspect the executable and environment identity:

scripts/ltspice version

Run one netlist:

scripts/ltspice run path/to/circuit.cir

Run every top-level .cir file in a directory, sorted by filename:

scripts/ltspice batch path/to/decks

The deck directory is mounted read-write because LTspice writes its .log, usually .raw, and for measured results .db output beside the input. Each run also creates a NAME.ltspice-run.txt provenance sidecar. Batch mode continues after a failed deck, creates ltspice-batch-summary.txt, and returns a failure status if any deck failed.

The runner reports failure when the container exits unsuccessfully, LTspice does not produce a fresh non-empty log, or the log contains a tested fatal error signature. A .raw file is recorded when present but is not universally required.

Portable RC comparison

The example uses a 1 kOhm resistor and 1 uF capacitor, giving the analytic 63.212% rise time

tau = R C = 1 ms

After building the image and installing ngspice, run:

examples/rc-transient/compare.sh

The script uses separate temporary working directories, extracts the t63 measurement from both logs, and requires LTspice, ngspice, and the analytic result to agree within 0.5%. This verifies the runner and comparison procedure; it does not establish general equivalence between the simulators.

Storage safety

When fuse-overlayfs is installed and usable, the runner prefers a project-owned Podman store. Its persistent graph data is under $XDG_DATA_HOME/ltspice-linux (or $HOME/.local/share/ltspice-linux) and its runtime state is under $XDG_RUNTIME_DIR/ltspice-linux. The runner supplies the storage settings on every Podman command; it does not modify or migrate the normal Podman store or write storage.conf.

If fuse-overlayfs is absent or the isolated-store probe fails, the runner uses the normal rootless Podman store as a supported fallback. Both backends use an explicit keep-id mapping so Wine remains the unprivileged image user (internal UID/GID 1000) while generated files belong to the invoking host user, regardless of that user's host UID. On native OverlayFS, containers/storage may retain approximately one additional ownership-remapped copy of the application layers. This affects storage and the first container creation, not the LTspice solver. For v0.1, an SELinux-enabled host also uses the normal-store fallback unless a future dedicated-store labeling design can be validated without changing host configuration.

Builds retain reusable shared image layers but force removal of intermediate build containers, including after a failed build. The runner does not expose an automatic cleanup command and never invokes a broad prune, reset, image removal, or volume deletion.

Inspect relevant image identity, containers, and overall Podman usage with:

scripts/ltspice storage

If cleanup is ever needed, inspect and remove exact project-owned image or container IDs manually. Do not use a broad prune: the same Podman store may contain unrelated project images.

The measurements, ownership model, backend mechanism, and upstream references are documented in Storage backends.

Development checks

Static and fake-Podman tests do not start or build containers:

tests/run.sh

The real integration test is intentionally separate because a container build is large. After building the image, run it only after reviewing the static-test result and current Podman storage inventory:

tests/integration/run.sh

It verifies image identity, a successful transient run, host output ownership, real LTspice missing-model detection, mixed batch behavior, and the RC/ngspice comparison. Every simulation uses an ephemeral --rm container and a temporary working directory.

Licensing and trademarks

The scripts and documentation in this repository are licensed under GPL-3.0-or-later. That license does not cover LTspice, Wine, Debian packages, Analog Devices models, the LTspice installer, or a resulting container image.

LTspice is a trademark of Analog Devices, Inc. This project is unofficial and is not affiliated with or endorsed by Analog Devices. Do not distribute the LTspice installer, extracted LTspice files, or a built container image through this repository or a public container registry.

About

Reproducible headless LTspice runner for Linux using rootless Podman and Wine.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages