Comment 18 for bug 1630676

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Hi Holger,

We really appreciate your assistance here and your efforts on providing ngspice as a shared library. Now we have implemented a few workarounds to fix all the problems we have faced using libngspice, but perhaps you have other ideas how to solve the problems in a more efficient way. This is what we fixed:

- Ngspice in certain situations (IIRC an error during param value evaluation) asked user for the input, but there was no way to answer, so in the end the whole application hung up. It is fixed in the git repository (and requires unsetting interactive mode), though it is not available in the current stable release, hence we use a script to build the right version [1].
- There is a problem with codemodel libraries on platforms other than Linux. Ngspice during the configuration step hardcodes the path to spinit file directory, which works fine for Linux packages. For Windows/msys2, it stores the absolute unix-style path (/path/to/spinit), but it is not possible to open a path like this in Windows environment (even when running in mingw shell). Due to this, we need to load spinit files by hand.
- The other consequence of above is that spinit contains the absolute unix-style paths to codemodel libraries, so even we load the spinit file manually, it still points to a file that cannot be loaded due to the path style.

The two points above currently have a workaround that is likely to be applied soon in KiCad [2]. I do not blame ngspice here, as I do not have any ideas how to solve the problem in an elegant way, neither on KiCad nor ngspice side. Perhaps relative paths in spinit file or using a ngspice variable, as we did in the described workaround [2]?

Regarding the shared library, I think it would be helpful if there was a versioning scheme for the library. Currently it is built as libngspice.so.0.0.0 or libngspice-0.dll. One day the interface may change, but there will be no way to determine the library version used in the system.

Regards,
Orson

1. https://orson.net.pl/pub/libngspice/get_libngspice_so.sh
2. https://lists.launchpad.net/kicad-developers/msg26647.html