ngspice/INSTALL

759 lines
27 KiB
Plaintext
Raw Normal View History

2008-11-06 10:22:54 +01:00
Ngspice installation instructions
=================================
2021-11-01 14:48:21 +01:00
Important notice: since ngspice-35 there has been an update
to the XSPICE code models (analog.cm etc.). Therefore it
is not sufficient to only re-make the main executable,
you will have to compile and install the code models as well,
e.g. with --enable-xspice.
2008-11-06 10:22:54 +01:00
Table of contents
2012-01-27 23:24:00 +01:00
1 Ngspice installation (LINUX)
2008-11-06 10:22:54 +01:00
1.1 Prerequisites
2022-10-23 15:23:49 +02:00
1.2 Install from tarball (e.g. ngspice-38.tar.gz)
1.3 Install from git repository
1.4 ngspice as a shared library
1.5 Advanced Install
1.5.1 Most useful options
1.5.2 Options Specific to Enable Ngspice as a shared library
1.5.3 Options Useful for Debugging Ngspice
1.6 Installation on Red Hat, Oracle or Centos Linux
2008-11-06 10:22:54 +01:00
2 Compilers and Options
3 Compiling For Multiple Architectures
4 Installation Names
5 Optional Features
6 Specifying the System Type
7 Sharing Defaults
8 Operation Controls
9 NGSPICE COMPILATION UNDER WINDOWS OS
2008-11-29 23:50:23 +01:00
9.1 How to make ngspice with MINGW and MSYS
2022-10-23 15:23:49 +02:00
9.2 make ngspice with MS Visual Studio 2019 or 2022
2008-11-06 10:22:54 +01:00
9.3 make ngspice with pure CYGWIN
2012-01-27 23:24:00 +01:00
9.4 ngspice console app with MINGW or CYGWIN
2017-08-24 11:11:38 +02:00
9.5 cross compiling ngspice for Windows from LINUX
2021-11-01 14:48:21 +01:00
10 NGSPICE COMPILATION UNDER macOS
10.1 Use precompiled binary package
10.2 Compile NGSPICE manually from a tarball
10.3 Compile NGSPICE manually from git
10.4 About compilers
2008-11-06 10:22:54 +01:00
This file describes the procedures to install ngspice from sources.
2012-01-27 23:24:00 +01:00
1 Ngspice Installation (LINUX, maybe others)
2008-11-06 10:22:54 +01:00
====================
2008-11-06 10:22:54 +01:00
1.1 Prerequisites
2017-08-23 23:48:28 +02:00
Ngspice is written in C and thus a complete C compilation environment
is needed. Almost any LINUX offers a complete C development environment.
2014-01-04 15:42:57 +01:00
Ngspice is developed on GNU/Linux with gcc and GNU make.
2008-11-06 10:22:54 +01:00
2021-03-28 12:07:35 +02:00
Ngspice may be compiled in three different variant, each with its own
configure settings. Standard ngsoice executable, ngspice as a shared
library and ngspice as a tcl/tk library.
The following software must be installed in your system to compile
ngspice as a standard executable (command-line input, file and graphics
output):
2021-03-28 12:07:35 +02:00
bison, flex, X11 headers and libs, Xaw, Xmu, Xext, Xft, FontConfig,
2021-01-03 09:27:04 +01:00
Xrender, and freetype headers (e.g. libX11-devel) and libs (e.g. libX11-6),
and readline.
2008-11-06 10:22:54 +01:00
ngspice as a shared library (no graphics and no command-line interfaces)
will need bison and flex only.
If libfftw is detected on your system, it will be used instead of the
2021-11-01 14:48:21 +01:00
internal fft algorithms.
If you want to compile the source from the git repository you need
2021-01-03 09:27:04 +01:00
additional software: autoconf, automake, libtool.
2008-11-06 10:22:54 +01:00
The following software may be needed when enabling additional features:
editline, tcl/tk, adms.
2014-01-04 15:42:57 +01:00
Please have a look at the actual ngspice manual, downloadable at
http://ngspice.sourceforge.net/docs.html, which gives you much more
information on ngspice and its usage.
For compiling ngspice as a shared library, see section 1.4.
2014-01-04 15:42:57 +01:00
2021-11-01 14:48:21 +01:00
1.2 Install from tarball (e.g. ngspice-36.tar.gz)
2014-01-04 15:42:57 +01:00
This covers installation from a release distribution (for example
2021-11-01 14:48:21 +01:00
ngspice-36.tar.gz, the so called tar ball).
2014-01-04 15:42:57 +01:00
After downloading the tar ball to a local directory unpack it using:
2021-11-01 14:48:21 +01:00
$ tar -zxvf ngspice-36.tar.gz
2014-01-04 15:42:57 +01:00
Now change directories in to the top-level source directory (where this
INSTALL file can be found).
You should be able to do:
2014-01-04 15:42:57 +01:00
$ mkdir release
$ cd release
$ ../configure --with-x --with-readline=yes --disable-debug
$ make
$ sudo make install
2014-01-04 15:42:57 +01:00
The default install directory for executables is /usr/local/bin.
2014-01-04 15:42:57 +01:00
A simple ../configure might be sufficient for a basic ngspice, but the preferred
arguments to ../configure are
--with-x --with-readline=yes and --disable-debug
providing you with a comfortably working ngspice (see section 1.4 for details).
2014-01-04 15:42:57 +01:00
See the section titled 'Advanced Install' for instructions about additional arguments
that can be passed to ../configure to customise the build and installation.
Do not use the script ./autogen.sh, because it is not required for
compiling and installing ngspice from the tarball.
2014-01-04 15:42:57 +01:00
A fully featured ngspice on LINUX may be obtained with the following commands:
$ mkdir release
$ cd release
2014-01-04 15:42:57 +01:00
$ ../configure --with-x --enable-xspice --disable-debug --enable-cider --with-readline=yes --enable-openmp
$ make 2>&1 | tee make.log
$ sudo make install
2014-01-04 15:42:57 +01:00
To remove the executables and libraries from the install directory, you may call
$ sudo make uninstall
2014-01-04 15:42:57 +01:00
1.3 Install from the git repository
2011-05-28 21:33:35 +02:00
This section describes how to install from source code taken directly
from the git repository. It is intended for those who want to use the most
2014-01-04 15:42:57 +01:00
recent enhancements of ngspice and for developers. For user install
instructions using source from a released distributions, please see the
sections titled 'Install from tarball' and 'Advanced Install'.
Download ngspice sources from the git repository as described on the sourceforge project page
2022-10-23 15:23:49 +02:00
(see https://ngspice.sourceforge.io/download.html and click on the git link)
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
Now change directories in to the top-level source directory (where this
INSTALL file can be found).
2014-01-04 15:42:57 +01:00
The project uses the GNU build process. The compile output should go into a separate
directory, so to e.g. maintain separate debug and release versions.
2008-11-06 10:22:54 +01:00
$ ./autogen.sh
2011-05-28 19:35:56 +02:00
$ mkdir debug
$ cd debug
2014-01-04 15:42:57 +01:00
$ ../configure --with-x --with-readline=yes
2008-11-06 10:22:54 +01:00
$ make
$ sudo make install
2014-01-04 15:42:57 +01:00
See the section titled 'Advanced Install' for instructions about arguments
that can be passed to ./configure to customize the build and installation.
2014-01-04 15:42:57 +01:00
2010-06-20 12:04:50 +02:00
Preferred arguments to ./configure to obtain a comfortably working ngspice may be
2014-01-04 15:42:57 +01:00
--with-readline=yes and --disable-debug (for a smaller and speed optimized
2014-01-04 15:42:57 +01:00
executable).
2010-09-25 17:07:23 +02:00
A fully featured ngspice on LINUX may be obtained with the following commands:
$ ./autogen.sh --adms
2011-05-28 19:35:56 +02:00
$ mkdir release
$ cd release
2011-05-28 21:33:35 +02:00
$ ../configure --with-x --enable-xspice --disable-debug --enable-cider --with-readline=yes --enable-openmp --enable-adms
2011-05-28 19:35:56 +02:00
$ make 2>&1 | tee make.log
2010-09-25 17:07:23 +02:00
$ sudo make install
2014-01-04 15:42:57 +01:00
A bash script compile_linux.sh is available including all useful options,
compiling and installation procedures.
1.4 ngspice as a shared library
2021-03-28 12:07:35 +02:00
The relevant configure options for the ngspice shared library are:
$ --with-ngshared --enable-xspice --disable-debug --enable-cider --enable-openmp
2021-01-03 09:27:04 +01:00
Typically the two aliases libngspice.so, libngspice.so.0 and the compiled
library libngspice.so.0.0.1 are made. The install locations depend on
the Linux distribution and may be set by the --prefix configure flag.
2014-01-04 15:42:57 +01:00
Again there is a bash script compile_linux_shared.sh with all useful options,
compiling and installation procedures.
2000-04-27 22:03:57 +02:00
libtool versioning is available and may be set in configure.ac, if relevant
changes to the source code have been made.
1.5 Advanced Install
2008-11-06 10:22:54 +01:00
Some extra options can be provided to './configure'. To get all available
options do:
2008-11-06 10:22:54 +01:00
$ ./configure --help
2014-01-04 15:42:57 +01:00
2008-11-06 10:22:54 +01:00
Some of these options are generic to the GNU build process that is used by
Ngspice, other are specific to Ngspice.
2008-11-06 10:22:54 +01:00
The following sections provide some guidance and descriptions for many,
but not all, of these options.
2014-01-04 15:42:57 +01:00
1.5.1 Most useful options:
--enable-osdi
Add the OSDI interface to ngspice. This interface allow to dynamically
load compiled Veriloag-A compact models. Compiling is done with
OpenVAF. Thus for the first time ngspice has access to modern
device models like BSOMBULK or BSIM_CMG.
2011-05-28 19:35:56 +02:00
--enable-cider
Cider is a mixed-level simulator that couples Spice3 and DSIM
2011-05-28 21:33:35 +02:00
to simulate devices from their technological parameters.
2014-01-04 15:42:57 +01:00
2011-05-28 19:35:56 +02:00
--enable-xspice
2011-05-28 21:33:35 +02:00
Enable XSpice enhancements,
2014-01-04 15:42:57 +01:00
A mixed signal simulator built upon spice3 with codemodel
2011-05-28 21:33:35 +02:00
dynamic loading support. See the ngspice manual for details.
2014-01-04 15:42:57 +01:00
2011-05-28 21:33:35 +02:00
--with-readline=yes
2011-05-28 19:35:56 +02:00
Enable GNU readline support for the command line interface.
2014-01-04 15:42:57 +01:00
--enable-openmp
Compile ngspice for multi-core processors.
2011-05-28 21:33:35 +02:00
Parallelization is done by OpenMP, for MOS models in BSIM3.3.0
2014-01-04 15:42:57 +01:00
BSIM4.6.0 and and BSOI4 only. See the ngspice manual for details.
2011-05-28 21:33:35 +02:00
--disable-debug
This option will remove the '-g' option passed to the compiler
and add -O2 optimization (instead of default O0).
2014-01-04 15:42:57 +01:00
This speeds up simulating significantly, and is recommended for
2011-05-28 21:33:35 +02:00
normal use.
2014-01-04 15:42:57 +01:00
--enable-oldapps
The old apllications ngsconvert ngproc2mod ngmultidec and ngmakeidx
are made only per user request, by adding this flag.
--with-fftw3=no
Disable using fftw fast fourier transform library. Use internal
fft instead. Default is 'yes'.
2014-01-04 15:42:57 +01:00
--with-editline=yes
Enables the use of the BSD editline library (libedit) instead
of readline.
2022-10-23 15:23:49 +02:00
See https://www.thrysoee.dk/editline/
--enable-shortcheck
Enables a 'make check' with strongly reduced runtime. Besides some
regression tests only BSIM3 and BSM4 devices are checked.
1.5.2 Options Specific to Enable Ngspice as a shared library
2017-08-24 11:05:46 +02:00
--with-ngshared
This option let you compile ngspice as a shared
library or dll, allowing an application controlling
ngspice. This option excludes using --with-x or
--with-wingui. Useful additional options are
--enable-xspice --enable-cider --enable-openmp.
No graphics interface is provided, this has to be
2017-08-24 11:05:46 +02:00
handled by the controlling application.
--with-tcl=tcldir
When configured with this option, the tcl module
2017-08-24 11:05:46 +02:00
"tclspice" is compiled and installed instead of
plain ngspice.
1.5.3 Options Useful for Debugging Ngspice
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
--enable-ansi
2014-01-04 15:42:57 +01:00
Configure will try to find an option for your compiler so that
2011-05-28 19:35:56 +02:00
it expects ansi-C.
2008-11-06 10:22:54 +01:00
--enable-asdebug
2011-05-28 19:35:56 +02:00
Debug sensitivity code *ASDEBUG*.
2008-11-06 10:22:54 +01:00
2014-01-04 15:42:57 +01:00
--enable-blktmsdebug
Debug distortion code *BLOCKTIMES*
2008-11-06 10:22:54 +01:00
--enable-checkergcc
2011-05-28 19:35:56 +02:00
Option for compilation with checkergcc.
2008-11-06 10:22:54 +01:00
--enable-cpdebug
2011-05-28 19:35:56 +02:00
Enable ngspice shell code debug.
2008-11-06 10:22:54 +01:00
--disable-debug
2011-05-28 19:35:56 +02:00
This option will remove the '-g' option passed to the compiler.
2014-01-04 15:42:57 +01:00
This speeds up compilation a *lot*, and is recommended for
2011-05-28 19:35:56 +02:00
normal use.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
--enable-ftedebug
2011-05-28 19:35:56 +02:00
Enable ngspice frontend debug.
2014-01-04 15:42:57 +01:00
2008-11-06 10:22:54 +01:00
--enable-pzdebug
2011-05-28 19:35:56 +02:00
Debug pole/zero code.
2014-01-04 15:42:57 +01:00
2008-11-06 10:22:54 +01:00
--enable-sensdebug
Debug sensitivity code *SENSDEBUG*.
--enable-smltmsdebug
2011-05-28 19:35:56 +02:00
Debug distortion code *SMALLTIMES*
2008-11-06 10:22:54 +01:00
--enable-smoketest
2011-05-28 19:35:56 +02:00
Enable smoketest compile.
2014-01-04 15:42:57 +01:00
2008-11-06 10:22:54 +01:00
--enable-stepdebug
2011-05-28 19:35:56 +02:00
Turns on debugging of convergence stepping??
2014-01-04 15:42:57 +01:00
If a problem is found with the build process, please submit a report
to the ngspice development team using the ngspice discussion forum at
https://sourceforge.net/p/ngspice/discussion/133842/. Please provide
information about your system and any ./configure arguments you are
using, together with any error messages. If you have fixed the
problem yourself, then the development team will love to hear from you.
1.6 Installation on Red Hat, Oracle or Centos
These OSs, widely distributed among commercial users, require some
special considerations. There is an extra document, "NGSPICE on Red
Hat Like Distributions.pdf", provided by Justin Fisher, available with
the ngspice distribution.
2008-11-06 10:22:54 +01:00
2 Compilers and Options
=====================
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
Or on systems that have the `env' program, you can do it like this:
2000-04-27 22:03:57 +02:00
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
2021-03-28 12:07:35 +02:00
On CentOS with older GCC it might be necessary to add -std=c99
2021-01-03 09:27:04 +01:00
to the CFLAGS in ./compile_linux.sh .
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
3 Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
4 Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
2005-10-15 15:59:27 +02:00
2008-11-06 10:22:54 +01:00
When installed on MinGW with MSYS alternative paths are not fully supported.
See 'How to make ngspice with MINGW and MSYS' below for details.
2005-10-15 15:59:27 +02:00
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
5 Optional Features
=================
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
6 Specifying the System Type
==========================
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
7 Sharing Defaults
================
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
8 Operation Controls
==================
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
`configure' recognizes the following options to control how it
operates.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
`--help'
Print a summary of the options to `configure', and exit.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
2000-04-27 22:03:57 +02:00
2008-11-06 10:22:54 +01:00
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
2002-01-03 23:44:21 +01:00
2008-11-06 10:22:54 +01:00
`configure' also accepts some other, not widely useful, options.
2002-01-03 23:44:21 +01:00
2008-11-06 10:22:54 +01:00
9 NGSPICE COMPILATION UNDER WINDOWS OS
====================================
2002-01-03 23:44:21 +01:00
2020-05-03 11:47:03 +02:00
9.1 How to make ngspice with MINGW and MSYS2
2014-01-04 15:42:57 +01:00
2012-01-27 23:24:00 +01:00
Creating ngspice with MINGW is a straight forward procedure,
2020-05-03 11:47:03 +02:00
if you have MSYS2/MINGW installed properly. A modern environment is
offered by MSYS2 (https://www.msys2.org/). An installation procedure for
gcc in MSYS2 is decribed in
https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2
You will need some enhancements to the standard install (git, autoconf,
automake, libtool, FLEX and BISON, all available with pacman in MSYSS2).
2014-01-04 15:42:57 +01:00
Some links are given below which describe the procedures.
2021-11-01 14:48:21 +01:00
Installing from the tarball, e.g. ngspice-36.tar.gz, is simple: After
2021-01-03 09:27:04 +01:00
expanding, you may just run ./compile_min.sh from the ngspice directory.
2014-01-04 15:42:57 +01:00
2008-11-29 23:50:23 +01:00
The default installation location of ngspice is the Windows path
C:\spice. The install path can be altered by passing --prefix=NEWPATH
as an argument to ./configure during the build process.
2014-01-04 15:42:57 +01:00
Put the install path you desire inside "", e.g. "D:/NewSpice". Be
careful to use forward slashes "/", not backward slashes "\" (something
still to be fixed). Then add --prefix="D:/NewSpice" as an argument to
2008-11-29 23:50:23 +01:00
./configure in the normal way.
The procedure of compiling a distribution (for example, a tarball from
2020-05-03 11:47:03 +02:00
the ngspice website), if you don't want to use the script named above
is as follows:
2008-11-29 23:50:23 +01:00
2021-01-03 09:27:04 +01:00
$ cd ngspice
$ mkdir release
$ cd release
2013-03-23 13:00:30 +01:00
$ ../configure --with-wingui ...and other options
2008-11-29 23:50:23 +01:00
$ make
$ make install
2014-01-04 15:42:57 +01:00
The most useful options are:
2012-01-27 23:24:00 +01:00
--enable-xspice
2008-11-29 23:50:23 +01:00
--enable-cider
--disable-debug (-O2 optimization, no debug information)
2014-01-04 15:42:57 +01:00
2010-09-25 17:07:23 +02:00
A fully featured ngspice on Windows may be obtained with the following commands:
$ ./autogen.sh --adms
2011-06-02 10:58:30 +02:00
$ mkdir release
$ cd release
2013-03-23 13:00:30 +01:00
$ ../configure --with-wingui --enable-cider --disable-debug --enable-openmp --enable-xspice --enable-adms
2010-09-25 17:07:23 +02:00
$ make install
2014-01-04 15:42:57 +01:00
However, to compile code extracted from the git repository the procedure is
2022-10-23 15:23:49 +02:00
a little different. Firstly install git, e.g. from https://git-scm.com/download/win
2014-01-04 15:42:57 +01:00
To obtain ngspice, you may do the following:
2014-01-04 15:42:57 +01:00
2014-01-04 15:42:57 +01:00
Open the git command window. Go to a directory of your choice, e.g. D:\Spice
$ cd /d/Spice
Issue the command for downloading ngspice:
$ git clone git://ngspice.git.sourceforge.net/gitroot/ngspice/ngspice
2014-01-04 15:42:57 +01:00
This will create directory /ngspice .
Go to directory ngspice
$ cd /d/Spice/ngspice
Start compiling, e.g. by calling
$ ./autogen.sh --adms
$ ./compile_min.sh
Update the ngspice files:
Go to directory ngspice
$ cd /d/Spice/ngspice
Issue command for update
$ git pull
2008-11-29 23:50:23 +01:00
2014-01-04 15:42:57 +01:00
Instead of calling ./compile_min.sh, you may choose to issue
individual commands like:
$ cd ngspice
2008-11-29 23:50:23 +01:00
$ ./autogen.sh
2011-06-02 10:58:30 +02:00
$ mkdir release
$ cd release
2013-03-23 13:00:30 +01:00
$ ../configure --enable-maintainer-mode --with-wingui ...and other options
2008-11-29 23:50:23 +01:00
$ make
$ make install
The install tree generated during 'make install' is:
2020-05-03 11:47:03 +02:00
C:\Spice64\
bin\
ngspice.exe
cmpp.exe
lib\
spice\
analog.cm
digital.cm
spice2poly.cm
extradev.cm
extravt.cm
share\
man\
man1\
cmpp.1
ngspice.1
ngspice\
scripts\
ciderinit
devaxis
devload
setplot
spectrum
spinit
The scripts in directory ngspice/scripts are somewhat outdated
(except for spinit, the basic ngspice initialization script),
but may give some hints how to use the ngspice control language.
A bash script compile_min.sh is available including all useful options,
compiling and installation procedures.
The shared library libngspice-0.dll may be created by using the
script compile_min_shared.sh.
2022-10-23 15:23:49 +02:00
9.2 make ngspice with MS Visual Studio 2019 and 2022
2008-11-29 23:50:23 +01:00
2020-05-03 11:47:03 +02:00
ngspice may be compiled with MS Visual Studio 2019 or newer.
2009-09-20 22:28:12 +02:00
2017-08-23 23:48:28 +02:00
CIDER and XSPICE are included, the code models for XSPICE
(*.cm) are made as well.
2014-01-04 15:42:57 +01:00
2009-09-20 22:28:12 +02:00
There is currently no installation procedure provided, you may
however install the executable manually as described in the
installation tree below.
2014-01-04 15:42:57 +01:00
2020-05-03 11:47:03 +02:00
The directory (visualc) with its files
2009-09-20 22:28:12 +02:00
vngspice.sln (project starter) and
vngspice.vcproj (project contents)
2020-05-03 11:47:03 +02:00
allows to compile and link ngspice with MS Visual Studio 2019.
2014-01-04 15:42:57 +01:00
2009-09-20 22:28:12 +02:00
/visualc/include contains a dedicated config.h file. It contains the
preprocessor definitions required to properly compile the code.
strings.h has been necessary during setting up the project.
2014-01-04 15:42:57 +01:00
2019-09-15 21:13:28 +02:00
Install Microsoft Visual Studio 2019 Community with C/C++. For
example, the German edition is available at no cost from
2017-08-23 23:48:28 +02:00
https://www.visualstudio.com/de/vs/community/.
2014-01-04 15:42:57 +01:00
2021-03-28 12:07:35 +02:00
Install flex/bison from https://github.com/lexxmark/winflexbison/releases.
When the ngspice sources are installed in D:\myspices\ngspice, then
create a directory D:\myspices\flex-bison and expand the contents from
https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip
into this directory.
Goto /ngspice/visualc.
2014-01-04 15:42:57 +01:00
2019-09-15 21:13:28 +02:00
Start MS Visual Studio 2019 by double click onto vngspice.sln.
2014-01-04 15:42:57 +01:00
After MS Visual Studio has opened up, select debug or release version
2020-05-03 11:47:03 +02:00
by checking 'Build' , 'Configuration Manager', 'Debug' or 'ReleaseOmp'.
2021-03-28 12:07:35 +02:00
32 bit compilation (x86) is possible, but deprecated and will be removed
in the near future. 64 bit (x64) is the preferred option.
2014-01-04 15:42:57 +01:00
2020-05-03 11:47:03 +02:00
Start making ngspice (called vngspice.exe) by selecting 'Build' and
'Rebuild vngspice'.
2014-01-04 15:42:57 +01:00
2009-09-20 22:28:12 +02:00
Object files will be created and stored in visualc/debug or visualc/release.
The executable will be stored to visualc/debug/bin or visualc/release/bin.
2014-01-04 15:42:57 +01:00
2009-09-20 22:28:12 +02:00
An installation tree (as provided with MINGW make install) and also used by
vngspice is (maybe created manually):
2014-01-04 15:42:57 +01:00
C:\Spice64\
2011-05-28 19:35:56 +02:00
bin\
ngspice.exe
lib\
spice\
analog.cm
digital.cm
spice2poly.cm
extradev.cm
extravt.cm
share\
ngspice\
2011-05-28 19:35:56 +02:00
scripts\
spinit
2014-01-04 15:42:57 +01:00
2008-11-29 23:50:23 +01:00
If you intend to install vngspice into another directory, e.g. D:\MySpice,
you have to edit /visualc/include/config.h and alter the entries:
2021-03-28 12:07:35 +02:00
#define NGSPICEBINDIR "C:/Spice64/bin"
#define NGSPICEDATADIR "C:/Spice64/share/ngspice"
2008-11-29 23:50:23 +01:00
to
#define NGSPICEBINDIR "D:/MySpice/bin"
2014-01-04 15:42:57 +01:00
#define NGSPICEDATADIR "D:/MySpice/share/ngspice"
2008-11-29 23:50:23 +01:00
If the code model files *.cm are not available, you will get warning messages,
2014-01-04 15:42:57 +01:00
but you may use ngspice in the normal way (of course without XSPICE extensions).
2021-03-28 12:07:35 +02:00
The ngspice.dll shared library may be made by selecting sharedspice.sln from
ngspice/visualc. Code models are not made (see above how to generate them), and
ngspice.dll is not installed to anywhere, but (for release) may be found in
ngspice\visualc\sharedspice\ReleaseOMP.x64.
2008-11-29 23:50:23 +01:00
2002-01-03 23:44:21 +01:00
2008-11-29 23:50:23 +01:00
9.3 make ngspice with pure CYGWIN
2014-01-04 15:42:57 +01:00
If you don't have libdl.a you may need to link libcygwin.a
2008-11-29 23:50:23 +01:00
to libdl.a symbolically.
for example:
$ cd /lib
$ ln -s libcygwin.a libdl.a.
The procedure of compiling is the same as Linux.
2012-01-27 23:24:00 +01:00
9.4 ngspice console app with MINGW or CYGWIN
2014-01-04 15:42:57 +01:00
Omitting the configure flag --with-wingui will yield a console ngspice.
You then will not have any graphics interface. In CYGWIN you may add --with-x
2012-01-27 23:24:00 +01:00
for the X11 graphics (not available in mingw). A typical configure command
may look like
2014-01-04 15:42:57 +01:00
./configure --enable-adms --enable-xspice --enable-cider --enable-openmp
2020-05-03 11:47:03 +02:00
--disable-debug CFLAGS=-m64 LDFLAGS=-m64 prefix=C:/Spice64
2013-01-07 16:12:46 +01:00
2017-08-24 11:11:38 +02:00
9.5 cross compiling ngspice for Windows from LINUX
Two scripts are available in the ngspice directory that allow cross
compiling for NMS Windows, if you are running LINUX. ngspice.exe or
ngspice.dll may be made. For details please see cross-compile.sh or
cross-compile-shared.sh.
2013-01-07 16:12:46 +01:00
2017-08-24 11:05:46 +02:00
10 NGSPICE COMPILATION UNDER macOS
2013-01-07 16:12:46 +01:00
==================================
10.1 Use precompiled binary package
1. Install an X11 interface (like Xquartz)
2021-11-01 14:48:21 +01:00
2. Packages are available from Homebrew or MacPorts
Install the downloaded NGSPICE package
It may happen though that a package has been compiled without graphics support
2013-01-07 16:12:46 +01:00
3. Open a terminal window and start using NGSPICE
10.2 Compile NGSPICE manually from a tarball
1. Install an X11 interface (like Xquartz)
2022-10-23 15:23:49 +02:00
2. Install MacPorts from https://www.macports.org
2013-01-07 16:12:46 +01:00
3. Execute this command:
2020-05-03 11:47:03 +02:00
sudo port install autoconf automake libtool bison flex ncurses
readline fontconfig freetype libomp xorg-libXaw
4. Use one of the scripts provided: compile_macos.sh or build-for-mac-os.sh
5. Or run the commands manually: Configure NGSPICE invoking "./configure".
A complete set of features is:
2013-01-07 16:12:46 +01:00
./configure --enable-cider --enable-xspice --enable-openmp --enable-pss --enable-debug=no
2020-05-03 11:47:03 +02:00
6. Compile NGSPICE invoking "make -j4"
7. Install NGSPICE invoking "make install" or "sudo make install"
2013-01-07 16:12:46 +01:00
10.3 Compile NGSPICE manually from git
1. Install an X11 interface (like Xquartz)
2022-10-23 15:23:49 +02:00
2. Install MacPorts from https://www.macports.org
2013-01-07 16:12:46 +01:00
3. Execute this command:
sudo port install automake autoconf libtool bison flex ncurses xorg-libXaw
2021-11-01 14:48:21 +01:00
readline fontconfig freetype libomp SM ICE
2013-01-07 16:12:46 +01:00
4. Execute this command:
./autogen.sh or ./autogen.sh --adms (if you want to enable ADMS)
5. Configure NGSPICE invoking "./configure". A complete set of feature is:
2020-05-03 11:47:03 +02:00
./configure --enable-cider --enable-xspice --enable-openmp --enable-pss --with-readline=yes --enable-debug=no
or (if you want to enable ADMS)
./configure --enable-adms --enable-cider --enable-xspice --enable-openmp --enable-pss --with-readline=yes --enable-debug=no
6. Compile NGSPICE invoking "make -j4"
2013-01-07 16:12:46 +01:00
7. Install NGSPICE invoking "make install" or "sudo make install"
2021-11-01 14:48:21 +01:00
Resulting dependencies of ngspice
/usr/local/opt/ncurses/lib/libncursesw.6.dylib
/usr/local/opt/gcc/lib/gcc/11/libstdc++.6.dylib
/usr/local/opt/fftw/lib/fftw3.3.dylib
/usr/local/opt/readline/lib/libreadline.8.dylib
/opt/local/lib/libXaw.7.dylib
/opt/local/lib/libXmu.6.dylib
/opt/local/lib/libXt.6.dylib
/opt/local/lib/libXext.6.dylib
/opt/local/lib/libX11.6.dylib
/opt/local/lib/libfontconfig.1.dylib
/opt/local/lib/libXrender.1.dylib
/opt/local/lib/libfreetype.6.dylib
/opt/local/lib/libSM.6.dylib
/opt/local/lib/libICE.6.dylib
/usr/local/opt/gcc/lib/gcc/11/libgomp.1.dylib
/usr/lib/libSystem.B.dylib
/usr/local/lib/gcc/11/libgcc_s.1.dylib
10.5 About compilers
A compile script compile_macos_clang.sh contains all necessary steps for compiling
with the Xcode clang/llvm compiler. This compiler however does not support -fopenmp.
Therefore you may download and install gcc, e.g. from Homebrew and run the new
compile script compile_macos_gcc.sh. OpenMp enables parallel processing of
BSIM3/4 model evaluation, thus speeding up simulation.
2021-03-28 12:07:35 +02:00