On 2025-03-10 16:21, Christopher Howard wrote:
According to ngspice documentation, it doesn't have a GUI. There are
many GUIs you can use though.
Properly speaking, ngspice does not have a GUI to drive commands. However, ngspice comes
with a "plot" command, which per this tutorial, is supposed to make a graph
appear in a graphical window.
https://ngspice.sourceforge.io/ngspice-tutorial.html
With some more investigation last week, I determined that ngspice has a --with-x option,
and I believe that the ngspice package in Guix is not using the option. However, I tried
building ngspice myself using this option and I quickly ran into a build error, related
to it not being able to find an an Xaw library. Even with -D libxaw, configure reports
"configure: error: Couldn't find Xaw library". So, perhaps the package was
simply unable to build ngspice --with-x.
I don't really care much about this now, though, as I figured out that ngspice's "plot" command can be replaced by a
similar "gnuplot" command which causes the same graph to be constructed with gnuplot. This works well most of the time.
However, "gnuplot" command does require an extra argument (specifying the image file to save to) and it doesn't handle
axis ranges in quite the same way, so "gnuplot" is not quite a drop-in replacement for "plot" in tutorials.
Oh! OK! Now I get what you meant!
I managed to make it build with the viewport and also moved some deps
from the library to the package itself.
Here's the patch for it. I'll review carefully and commit it during the
next days.
If you want to add anything, please do.
From e349d634209621bb20ae96c0aec1d5310341ec15 Mon Sep 17 00:00:00 2001
Message-ID:
<e349d634209621bb20ae96c0aec1d5310341ec15.1741648445.git.eka...@elenq.tech>
From: Ekaitz Zarraga <eka...@elenq.tech>
Date: Tue, 11 Mar 2025 00:12:44 +0100
Subject: [PATCH] WIP: ngspice
Change-Id: I00e8766947d2c5dfea20d42e3eb02b0e9e15879a
---
gnu/packages/engineering.scm | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 28c1996df90..8fa123bc617 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2200,10 +2200,10 @@ (define-public libngspice
(delete-file-recursively
(string-append #$output
"/share/ngspice/scripts")))))
- #:configure-flags #~(list "--enable-openmp" "--enable-ciderlib"
+ #:configure-flags #~(list "--enable-openmp" "--enable-cider"
"--enable-xspice" "--with-ngshared")))
(native-inputs (list bison flex))
- (inputs (list libxaw openmpi))
+ (inputs (list openmpi))
(home-page "https://ngspice.sourceforge.net/")
(synopsis "Mixed-level/mixed-signal circuit simulator")
(description
@@ -2222,19 +2222,16 @@ (define-public ngspice
(inherit libngspice)
(name "ngspice")
(arguments
- (substitute-keyword-arguments
- (strip-keyword-arguments
- (list #:tests?)
- (package-arguments libngspice))
+ (substitute-keyword-arguments (package-arguments libngspice)
+ ;; Tests require a X server running, so we keep them disabled
((#:configure-flags flags)
- #~(cons "--with-readline=yes"
- (delete "--with-ngshared"
- #$flags)))
+ #~(cons* "--enable-rpath" "--with-x" "--with-readline=yes"
+ (delete "--with-ngshared" #$flags)))
((#:phases phases)
#~(modify-phases #$phases
(delete 'delete-scripts)))))
(native-inputs (list perl))
- (inputs (list libngspice readline))))
+ (inputs (list libngspice readline libxaw libx11))))
(define trilinos-serial-xyce
;; Note: This is a Trilinos containing only the packages Xyce needs,
so we
base-commit: 90b0d2936b90e7a892fc43bf176977a8043ff732
--
2.48.1