KiCad and ngspice on Ubuntu 18.04 woes

I have been running kicad on 16.04 before without problems. After upgrading to 18.04 it still worked for a while, then suddenly the simulation stopped working. I have no clue as to why it failed. What happens is that if I invoke the simulator from eeschema the simulation window does not show and eeschema hangs idle and unresponsive so I have to force close it.

I tried to reinstall kicad but got version 4 from Canonicals official ppa, I added js-reynaud/kicad-5/ubuntu bionic ppa
and after purging the old install reinstalled from there. It did not work. Thinking that it may depend on ngspice I installed it from the official ppa, it seems to be version 27. Now it worked.

I need the pspice behaviour and that was implemented in 28 as I understand it. So I tried to download the ngspice-30 tarball and compile and install it and fixed the symlinks as per instructions elsewhere here. Simulation stopped working again. Removed the downloaded version, still no good. Reinstalled 27, still no go. Reinstalled kicad and then 27, no go. Purged everything I could find including ~/.config/kicad. Reinstalled kicad-5, no go. Reinstalled ngspice-27 and now it works again. Purged all again, reinstalled kicad-5, then ngspice-30, no go. Purged and reinstalled ngspice-5 followed by ngspice-27 and it works.

I have absolutely no clue what is going on here. Kicad can’t simulate with its companion package ngspice-kicad. Only with 27 but not 30. Anyone have a hint? What should I try?

System is intel based 64 bit. Using xubuntu as desktop environment.

By the way, the tarball makefiles have errors in the uninstall target. “-rm” does not work, changed to “rm”.

One of these links:
https://forum.kicad.info/search?q=spice%20tutorial
leads to:
http://ngspice.sourceforge.net/ngspice-eeschema.html
which has som info on installing a newer ngspice for KiCad / Eeschema.
I have not tried it myself though.

If you start KiCad and/or Eeschema from the commandline, it might also spit out some breadcrumbs with hints in your terminal window.

Thanks.

Yes, those are the links I found. The second leads to https://forum.kicad.info/t/ngspice-28-for-kicad/10968/19 talking about linking the shared objects to where they are installed by the tarball.

I start kicad from the command line but the only output I have seen is Gtk related warnings. The shared objects are normally stored in /usr/lib/x86_64-linux-gnu/ on an Ubuntu while the tarball stores them in /usr/local/lib/

Maybe that looking at the build log of the above could provide some help. I found this in

https://launchpadlibrarian.net/393828166/buildlog_ubuntu-bionic-amd64.ngspice-kicad_0.1-2~201810181532+2e5be8d~ubuntu18.04.1_BUILDING.txt.gz.

If you scroll it down by searching for ./configure, then you will see the configure flags used to make shared ngspice. You might try these with the ngspice-30 tarball.

And you probably have to use gcc 64 bit.

What tarball, and from where?

About the -rm, please see https://stackoverflow.com/questions/2989465/rm-rf-versus-rm-rf

What do you mean by ‘does not work’?

Sorry, should have been more specific.

The dash prefix tells make to ignore the exit status of a shell command in a recipe. It works fine except when make uninstall recurses into xspice. Here make for some reason isn’t recognizing the dash prefix (-rm) and fails causing make to give up. I tried to find a reason but it’s a lot of code :slight_smile:

Tarball I used comes from the link here http://ngspice.sourceforge.net/ngspice-eeschema.html

I have now tried. Used the configure line from the log file you linked. The build was error free but it did not work. Same problem.

Note that the kicad package isn’t working either. Only way to make it work is to install ngspice-27 after kicad.

Next try here is to download the ngspice-30 debian package and install it.

Finally.

This is what I had to do:
Download ngspice, libncurses6 and libtinfo6 from https://packages.debian.org/buster/
cd where the downloads are
sudo apt install ./libtinfo6_6.1+20181013-1_amd64.deb
sudo apt install ./libncurses6_6.1+20181013-1_amd64.deb
sudo apt install ./ngspice_30.2-1_amd64.deb

That worked but the two libs are in buster test and I’m not sure they are going to be backported to 18.04 LTS which is the current long time release with end of life April 2023. Next LTS should be in 2020, 20.04.

Thanks for the report. I have uploaded a fix to ngspice branch pre-master.