A tiny instruction of compiling ngspice with CUDA using Visual Studio 2015

This commit is contained in:
h_vogt 2017-09-23 21:40:17 +02:00 committed by rlar
parent 4cec0aac03
commit 70fc339c3e
1 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,59 @@
ngspice may be compiled by MS Visual Studio Community 2015.
For compilation you need the GNU bison parser generator.
A ready for windows compiled variant can be downloaded as
win_flex_bison-latest.zip
from
http://sourceforge.net/projects/winflexbison/files/
Create the directory
../../flex-bison
relative from this directory right here, and unzip there.
We will invoke the win_bison.exe file
in this directory during the visual studio compilation.
Install CUDA
(tested with CUDA 8.0 from https://developer.nvidia.com/cuda-downloads)
Only valid for Visual Studio 2015.
VS 2017 is not supported by actaul CUDA 8.0 (as of Sept. 2017)!
XSPICE and CIDER are not supported.
fftw is not yet supported.
OpenMP is not yet supported (It will compile, but ngspice.exe segfaults).
Visual Studio is started by double click on cuspice.sln.
Select 'Build' 'Configuration Manager' and then choose one
of the build options, e.g. 'Active solution configuration'
with its Debug or Release GUI versions or the
equivalent console version (no GUI, no graphical interface),
and 'Active solution platform', only available with 'x64',
that is 64 bit code.
Selection of 'Build' and then 'Rebuild solution' will build
complete ngspice, starting with CUDA, where nvcc.exe is used
to compile the CUDA files named *.cu, and afterwards all
other files are compiled and ngspice.exe is generated. Finally
make-install-vngspice.bat is called to copy ngspice.exe,
spinit into a directory tree, that resembles the one
generated by mingw 'make install'. Some warnings pop up
that some files cannot be copied (these are in fact the code
models not being available). An example tree is given
below.
C:\Spice64\
bin\
ngspice.exe
vcomp140.dll
share\
ngspice
scripts\
spinit
If spinit is not found in the directory cited above,
ngspice.exe also searches for spinit in its own directory.
You may edit spinit to remove all line starting with 'codemodel'
to avoid warnings after starting ngspice.