Replace ngspice-26 shared library by ngspice-28 shared lib

Bug #1780595 reported by Holger Vogt on 2018-07-08
This bug affects 3 people
Affects Status Importance Assigned to Milestone

Bug Description

Exchange libngspice-0.dll by ngspice-28 version, available e.g. at

Add the command
set ngbehavior=ps
to the eeschema-ngspice interface (e.g. right before the commands loading the XSPICE code models).

This enables reading PSPICE device libraries (and LTSPICE device models like VDMOS), that are commonly offerd by the semiconductor manufacturers as their design support.

Application: eeschema
Version: (5.0.0-rc3-dev-2-g101b68b61), release build
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:

tags: added: ngspice
Nick Østergaard (nickoe) wrote :

I don't quite understand the purpose of this. Is it describing a bug, or is it a request to use the latest ngspice, or some guide lines on how to be able to use the latest ngspice release?

tags: added: ngpsice
removed: ngspice

It is both:

a request to replace the old ngspice (dating from 2014) with the newest
one, offering improvements (PSPICE compatibility) to the KiCad users.

If the team decides to do so, it is advisable to add the command
set ngbehavior=ps
to the eeschema sources, similar other commands are sent to ngspice.
Reason is that KiCad does not offer a spinit or .spiceinit file for
setting up ngspice, but has decided to send all set-up data via the
internal interface.

If useful, I might offer a patch.

Am 08.07.2018 um 14:04 schrieb Nick Østergaard:
> I don't quite understand the purpose of this. Is it describing a bug, or
> is it a request to use the latest ngspice, or some guide lines on how to
> be able to use the latest ngspice release?
> ** Tags removed: ngspice
> ** Tags added: ngpsice

Maciej Suminski (orsonmmz) wrote :

I am afraid ngspice-28 has not been so well tested with KiCad as was the case with ngspice-26. I suggest upgrading the library in 5.1 or 6.0, it is a bit late to do it for 5.0.

Nick Østergaard (nickoe) wrote :

I sort of agree with that, but I don't see too much trouble with it. I guess people on linux have been using 27 and 28 for some time now.

I have just updated the windows nightly to 27. I didn't upgrade to 28 yet, because the package in msys2 is not updated yet. Upgrading to 27 makes sure I don't need to checkout the one where the kicad fixes were in.

Nick Østergaard (nickoe) wrote :

As far as I understand ngspice 28 also works with current kicad withour any patching, and the init setting is only to enable new features.

Maciej Suminski (orsonmmz) wrote :

Ngspice-27 might have received some testing, as it is available in the most recent Ubuntu, but version 28 is most likely used only by the rolling-release distributions.

IIRC, we never had any particular issues with ngspice on Linux, all KiCad-specific fixes (mostly path setting) have been done for Windows and macOS.

Jeff Young (jeyjey) wrote :

I'm happy with 5.1 (or even 5.0.1), but not real excited about 5.0 at this point.

Wayne Stambaugh (stambaughw) wrote :

I prefer to lean towards the tested option. Ngspice 28 may work just fine but we really don't have a lot of testing to confirm this so for 5.0, I would prefer that we not get ahead of ourselves. I would like the 5.0 roll out to be as painless as possible.

Holger Vogt (h+vogt) wrote :

With the MS Windows distribution I agree immediately. It is possible for the user to exchange ngspice-26 by ngspice-28 without large efforts at his or her own 'risk' (I don't see any).

I have no clues about MacOS.

With Linux, I don't know if this is of importance: Debian has listed ngspice-26 in its 'non-free' section due to some licensing issues. This has been (hopefully) settled for ngspice-28, Carsten Schoenert cares for the update.

Jeff Young (jeyjey) wrote :

Queueing up for 5.1.

Changed in kicad:
milestone: none → 5.1.0
status: New → Triaged
importance: Undecided → Wishlist
Wayne Stambaugh (stambaughw) wrote :

I do not want to bump the ngspice rev for 5.1. This could limit the number of linux distros that we could build on. Lets keep the minimum version 26 (even though it is not set in CMakeLists.txt) until 28 is widely available.

Jeff Young (jeyjey) on 2018-07-22
Changed in kicad:
milestone: 5.1.0 → 6.0.0-rc1
Holger Vogt (h+vogt) wrote :

ngspice-30 is available.

All KiCad demo simulations are fine.

Nick Østergaard (nickoe) wrote :

I think ngspice 28 is fairly widely available according to repology. So we may not feel that bad about adding the new thing to the startup. What will happen if people use and older ngspice and the new set ngbehavior=ps? Will it stop working, or will they just get a warning?

Holger Vogt (h+vogt) wrote :

Nothing will happen. It will be ignored.

Nick Østergaard (nickoe) wrote :

Ok, so to me it looks like there is essentially no reason to hold off for 5.1.0.

Why does there exist two version 30 tags in the ngspice repo? ngspice-30 and ngspice-30-2?

Holger Vogt (h+vogt) wrote :

Mid of December Debian installed a new libedit version, unfortunately incompatible with its 15 year old ngspice implementation, leading to a compile error. This surfaced up on Dec. 30th (, when I already had tagged ngspice for version 30. Just to keep the release date 1. Jan. 2019, I agreed upon a patch with Carsten, and uploaded it with the tag 30-2. The whole ngspice-30 distribution is based on this tag. Because this libedit version (1.42.2) will trickle slowly through all Linux, Cygwin, etc. distributions, the patch is inevitable (It is just that the return type of a fuuction changed from void to int).

Thanks to Carsten, ngspice-30 is meanwhile available in Debian sid, buster and stretch backports, I guess the fastest upload to Debian ever :). In addition it is available in Ubuntu Disco and ArchLinux and maybe others.

May I recommend that you add ngspice-30 to KiCad release 5.1, using the ngspice-30-2 release? I have used eeschema for testing the shared ngspice lib under Windows, and in addition it contains a bug fix that previously led to a heap corruption, surfacing up from time to time in Windows 10.

Nick Østergaard (nickoe) wrote :

OK, cool. Thank you for the reply.

tags: added: ngspice
removed: ngpsice
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers