I would like to use a UNIX command-line program (Berkeleys SPICE) in an iOS app. What is the process to compile it into a usable library? : <p>I am trying to use <a href="https://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/" rel="noreferrer">Berkeley's SPICE</a> tool in an iOS app, but am having trouble compiling it for iOS.</p>

<p>It is a command-line program that I can call from a terminal like:</p>

<pre><code>./spice3f5 &lt;arguments&gt;
</code></pre>

<p>Which works well, and I would like this functionality in my iOS app, but I don't think I can just copy the executable over to Xcode and call it from Swift.</p>

<p>I've done some research and found the following:</p>

<ul>
<li>There is an updated version of SPICE called <a href="http://ngspice.sourceforge.net/" rel="noreferrer">ngspice</a>, which is relatively new (2014 release)</li>
<li>I'm fairly sure there are apps out there than have used either SPICE or ngspice, so I'm sure it can be done somehow.</li>
<li>I have read an article about a guy who says that <a href="http://alexandria.ucsb.edu/downloads/7m01bk898" rel="noreferrer">ngspice has been compiled as a shared library</a>(ctrl+f "ngspice"), and he made an app with it. I have emailed him but he unfortunately he has not responded.</li>
</ul>

<p>The reason I am asking here is because when googling for "ngspice iOS", I came across <a href="https://sourceforge.net/p/ngspice/discussion/127605/thread/4d8b0a0c/" rel="noreferrer">this thread</a> which has a lot of smart people trying to compile a <em>static</em> library, which seems way out of my scope. I learned that <em>dynamic</em> libraries are allowed as of iOS8. So would it be easier to compile a *.dylib than it is a static library?</p>

<p>How would I goabout using ngspice or SPICE in an iOS app?</p>

<p>Thanks</p>
