Anybody compiled from source with ngspice simulator enabled? [linux]

Yes, ngspice is installed.

For some reason the CMake recipe to find it fails. I’ve played with path variables a bit, but without any success.

To have the simulator working, you need libngspice, not ngspice itself. Unfortunately, at the moment a package containing the library is only provided by Arch Linux, so for other platforms it has to be build from source. There is a script [1] that does the dirty job for you and should work on Linux, Windows (mingw64) & OS X. I will add a message explaining the problem when CMake fails.

  1. https://orson.net.pl/pub/libngspice/get_libngspice_so.sh
2 Likes

The script didn’t run without a few modifications:

cd ${SRC_DIR} || ( echo “*** ngspice has not been built yet”; exit 1 )

etc…

But that doesn’t seem to be 100% correct either…

More specifically, this line

cd “${SRC_DIR}” || echo “*** An error occurred when downl… the source code ***”; exit 1

results in

[…]
Checking connectivity… done.

  • ‘[’ 0 ‘!=’ 0 ‘]’
  • cd /tmp/libngspice_so/ngspice
  • exit 1

So the “exit 1” should not be executed.

I have just applied a few fixes and it is building on my two test machines (Arch & Debian). Can you try to download the script again? What is your shell?

GNU bash, version 4.2.53(1)-release (x86_64-suse-linux-gnu

Wrapping in (…) puts stuff into a subshell. This doesn’t work nicely here, sorry. “exit 1” only exits the subshell, but doesn’t terminate the script.

This version appears to behave on my system. More text though.

get_libngspice_so.sh (2.3 KB)

Thank you madworm. I have just updated the script to include your changes.

Seems to work on OS X 10.11 (El Capitan) as well. Quite a few warnings but no errors.