From: Holger V. <hol...@un...> - 2001-11-23 18:01:37
|
Dear all, I have successfully compiled NG-Spice-Rework 13 for WIN32 using CYGWIN. This is the procedure: Install CYGWIN from http://sources.redhat.com/cygwin/ Install Xfree XServer and X11 support for WIN32 from http://xfree86.cygwin.com/ Download ng-spice-rework-13 and expand into a directory G:\ng-spice-rework-13. Open CYGWIN console box. cd /cygdrive/g/ng-spice-rework-13 (CYGWIN notation) edit configure.in old: AC_CHECK_LIB(Xext, XShmAttach,X_LIBS="$X_LIBS -lXext",AC_MSG_ERROR(Couldn't find Xext librairies), $X_LIBS $X_EXTRA_LIBS) new: AC_CHECK_LIB(Xext,main,X_LIBS="$X_LIBS -lXext",AC_MSG_ERROR(Couldn't find Xext librairies), $X_LIBS $X_EXTRA_LIBS) autoconf ./configure edit ngspice.h line 102 // added for CYGWIN #ifndef HUGE #define HUGE HUGE_VAL #endif edit test_cx_ph.c line 11 // added for CYGWIN #include "defines.h" edit outitf.c line 31 // added for CYGWIN #include <float.h> to get rid of linking errors with x libraries: edit makefile in /src line 128 old: #LIBS = -lm -lncurses -L/usr/X11R6/lib -lX11 -lXt -lXext -lXaw -lXmu -lSM -lICE new: LIBS = -lm -lncurses -liberty -L/usr/X11R6/lib -lXaw -lXt -lXmu -lXext -lX11 -lXpm -lSM -lICE line 142 old: #X_LIBS = -L/usr/X11R6/lib -lX11 -lXt -lXext -lXaw -lXmu new: X_LIBS = -L/usr/X11R6/lib -lXaw -lXt -lXmu -lXext -lX11 -lXpm missing link to asprintf in -liberty (this might better be changed in configure.in, I guess) remaining link errors: RESLoad get_... change to makefile in line 92 old: # ngspice_LDADD = spice.o frontend/libfte.a frontend/plotting/libplotting.a $(DYNAMIC_DEVICELIBS) spicelib/analysis/libckt.a spicelib/devices/libdev.a frontend/parser/libparser.a frontend/help/libhlp.a spicelib/parser/libinp.a maths/deriv/libderiv.a maths/cmaths/libcmaths.a maths/poly/libpoly.a maths/ni/libni.a maths/sparse/libsparse.a misc/libmisc.a new: ngspice_LDADD = spice.o frontend/libfte.a frontend/plotting/libplotting.a spicelib/devices/dev.o $(DYNAMIC_DEVICELIBS) spicelib/analysis/libckt.a spicelib/devices/libdev.a frontend/parser/libparser.a frontend/help/libhlp.a spicelib/parser/libinp.a maths/deriv/libderiv.a maths/cmaths/libcmaths.a maths/poly/libpoly.a maths/ni/libni.a maths/sparse/libsparse.a misc/libmisc.a Now a double definition errors of function StrongInversionNoiseEval(vgs, vds, model, here, freq, temp) is removed by creating StrongInversionNoiseEvalV1(vgs, vds, model, here, freq, temp) and StrongInversionNoiseEvalV2(vgs, vds, model, here, freq, temp) in b3v1noi.c and b3v2noi.c, line 47, 256 and 271 respectively 'make' now creates all binaries. Then I have put all binaries in a G:\ng-spice-rework-13\bin directory, also created /help, /man and /scripts directories. After starting the XServer, NG-Spice may be run by by the following batch script: REM************************************************************************* set PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;G:\ng-spice-rework-13\bin;C:\cygwin\bin;C:\cygwin\usr\x11r6\bin SET SPICE_NO_DATASEG_CHECK=TRUE SET SPICE_HELP_DIR=../help SET MANPATH=../man SET SPICE_SCRIPTS=../scripts cd G: cd G:\ng-spice-rework-13\bin run ./rxvt -sb -e ./ngspice.exe REM ngspice.exe ../examples/adder.cir -b -r ../examples/adder_ng.out -o ../examples/adder_ng.log REM ngspice.exe ../Exam_BSIM3/adder_mos.cir -b -r ../Exam_BSIM3/adder_mos.out -o ../Exam_BSIM3/adder_mos.log run c:/cygwin/usr/x11r6/bin/xman.exe REM**************************************************************** Using rxvt, ngspice will open up in the rxvt-window on the X screen. The two line commented out with REM will start the batch mode (here in a DOS box). Things are by far not perfect, e.g. reaction to keyboard entries is strange on non alphanumeric keys (I need SHIFT BACKSPACE for doing BACKSPACE ...), the -o log file in batch mode does not show CPU time and memory used. But NG-Spice runs and simulates examples (e.g. adder.cir from UCB or adder_mos.cir with BSIM3v3.2, which I derived fron adder.cir). Plotting is done via X on top of Windows. So this seems to be a nice start for ngspice on WIN32. Regards Holger Vogt |