vasco
vasco

Reputation: 1542

Any SPICE library/API written in C?

I am looking for some implementation of SPICE (electronic circuits simulator) written in C language which can be used as library.

I found some SPICE clone for Python and for Java, but not for C.

So far, I am using ngspice. It is very good clone of SPICE3, it is written in C, it has very good documentation. Is it possible to use it as library (so I can compile it into shared library and use it in my C project)? I compiled ngspice from source, but the result is CLI interface. Is there any option I can compile it into shared library?

But I am fine with any other SPICE clone.

Upvotes: 2

Views: 4073

Answers (2)

EML
EML

Reputation: 10280

ngspice now (mid-2013) now has an option to build as a shared library or dll to link into your app - it's documented in chapter 19 of the June 2013 manual (not the manual in the ngspice-25 release).

Upvotes: 6

Burton Samograd
Burton Samograd

Reputation: 3638

The 'Unix Way' would be to use the CLI program as is and use the 'system' standard library call to execute the binary (or fork/exec). Much less work than what you are trying to propose and with the amount that you are going to be calling the external application the overhead of doing the system call will be negligible.

Upvotes: 2

Related Questions