diff -cr orig/spice3f4/conf/defaults spice3f4/conf/defaults *** orig/spice3f4/conf/defaults Wed Nov 30 15:48:08 1994 --- spice3f4/conf/defaults Sat Jan 25 12:57:35 1997 *************** *** 136,142 **** # CC_OPT: Default compile options (optimization/debug level, other) ! CC_OPT = -g # CC_OPT_SAFE: Special compile options to override CC_OPT for code # which typically causes problems for most compilers (bsim1 and bsim2). --- 136,142 ---- # CC_OPT: Default compile options (optimization/debug level, other) ! CC_OPT = -O # CC_OPT_SAFE: Special compile options to override CC_OPT for code # which typically causes problems for most compilers (bsim1 and bsim2). *************** *** 212,219 **** # MIT X11r5, X11r4, and your vendor's version of X11, though listing # more doesn't hurt. ! INCX = -I$(X_DIR)/include -I$(X_DIR)/include/X11 \ ! -I$(X_DIR)/include/X11/Xmu \ -I$(X_DIR)/include/X11/Xaw # LIBX lists the options for linking with the X11 libraries. Order is --- 212,219 ---- # MIT X11r5, X11r4, and your vendor's version of X11, though listing # more doesn't hurt. ! INCX = -I$(X_DIR)/include -I$(X_DIR)/include/X11 \ ! -I$(X_DIR)/include/X11/Xmu \ -I$(X_DIR)/include/X11/Xaw # LIBX lists the options for linking with the X11 libraries. Order is *************** *** 221,228 **** # which is not available with all versions of X11. If you do not have # it, then you do not need it (delete the following reference to it). ! # LIBX = -L$(X_DIR)/lib -lXaw -lXt -lXext -lXmu -lX11 ! LIBX = -lXaw -lXt -lXext -lXmu -lX11 --- 221,227 ---- # which is not available with all versions of X11. If you do not have # it, then you do not need it (delete the following reference to it). ! LIBX = -L$(X_DIR)/lib -lXaw -lXt -lXext -lXmu -lX11 *************** *** 296,302 **** # DEFAULT_EDITOR lists where the default editor used by the "edit" # command is located. ! DEFAULT_EDITOR = jove # ASCII_RAWFILE indicates that the default format of the spice3 raw data # file should be in human-readable format ( = 1 ) or in the smaller, --- 295,301 ---- # DEFAULT_EDITOR lists where the default editor used by the "edit" # command is located. ! DEFAULT_EDITOR = vi # ASCII_RAWFILE indicates that the default format of the spice3 raw data # file should be in human-readable format ( = 1 ) or in the smaller, diff -cr orig/spice3f4/conf/gcc spice3f4/conf/gcc *** orig/spice3f4/conf/gcc Wed Nov 30 15:35:53 1994 --- spice3f4/conf/gcc Sat Jan 25 12:57:35 1997 *************** *** 1,6 **** # For use with gcc; use "build gcc" CC = gcc ! CC_OPT = -O2 ! CC_OPT_SAFE = -O2 ASM_HACK = < /dev/null --- 1,6 ---- # For use with gcc; use "build gcc" CC = gcc ! CC_OPT = -O ! CC_OPT_SAFE = -O ASM_HACK = < /dev/null diff -cr orig/spice3f4/conf/linux spice3f4/conf/linux *** orig/spice3f4/conf/linux Wed Nov 30 18:46:56 1994 --- spice3f4/conf/linux Sat Jan 25 12:57:35 1997 *************** *** 1,8 **** ! # linux config exception file ! MAKE = /usr/bin/make ! INTERFACE_OPTS = -DWANT_X11 ! CC = gcc ! CC_OPT = -O2 ! CC_OPT_SAFE = -O2 ! LDFLAGS = -lm --- 1,20 ---- ! # Linux/GNU (installs under /usr/local/spice) ! DEFAULT_EDITOR = vi ! MAKE = make ! X_DIR = /usr/X11 ! INCX = -I$(X_DIR)/include -I$(X_DIR)/include/X11 \ ! -I$(X_DIR)/include/X11/Xmu \ ! -I$(X_DIR)/include/X11/Xaw ! LIBX = -L$(X_DIR)/lib -lXaw -lXt -lXext -lXmu -lX11 ! LDFLAGS = -ltermcap -lm ! ! SPICE_DIR = /usr/local/spice ! SPICE_LIB_DIR = $(SPICE_DIR)/lib ! SPICE_EXEC_DIR = $(SPICE_DIR)/bin ! ! S_SPICE_DIR = $(SPICE_DIR) ! S_SPICE_LIB_DIR = $(S_SPICE_DIR)/lib ! S_SPICE_EXEC_DIR= $(S_SPICE_DIR)/bin ! ! INSTALL_DIRS = $(SPICE_DIR) $(SPICE_EXEC_DIR) $(SPICE_LIB_DIR) diff -cr orig/spice3f4/examples/pzt.cir spice3f4/examples/pzt.cir *** orig/spice3f4/examples/pzt.cir Wed Nov 30 19:38:46 1994 --- spice3f4/examples/pzt.cir Sat Jan 25 12:57:35 1997 *************** *** 1,5 **** test pz ! iin 1 0 0 ac r1 1 0 1Ohms l1 1 0 0.05H --- 1,5 ---- test pz ! iin 1 0 ac r1 1 0 1Ohms l1 1 0 0.05H diff -cr orig/spice3f4/lib/scripts/spinit spice3f4/lib/scripts/spinit *** orig/spice3f4/lib/scripts/spinit Fri Jun 18 17:02:40 1993 --- spice3f4/lib/scripts/spinit Sat Jan 25 12:57:36 1997 *************** *** 2,8 **** alias exit quit alias acct rusage all set x11lineararcs - * the following from spice3e2 version (NJ) - * set term=NO - set hcopydevtype=postscript - set hcopydev=laserplus --- 2,4 ---- diff -cr orig/spice3f4/readme.Linux spice3f4/readme.Linux *** orig/spice3f4/readme.Linux Thu Dec 1 02:31:59 1994 --- spice3f4/readme.Linux Sat Jan 25 12:59:41 1997 *************** *** 1,3 **** --- 1,47 ---- + This is my (re-)port of Spice3f4 to Linux version 2 (I am not the same + person who ported it before). It also wraps in the latest official + pre-3f5 patches from Berkeley I could find (found in + sp3f4.patch.tar.Z). Support for the MFB interface using the Linux + termcap library and some various Linux features have been ported. + + This was not done for the hell of it, but it seemed that something + broke due to some Linux/system/library changes, so I decided to try + porting it from scratch. In fact, if you don't have any problems with + the previous port, your probably fine then. However, if you do have + problems (e.g. exiting Spice leaves you in uppercase mode), or want + MFB for some reason, then try this. It seems to work here. + + Basically, I started out with sp3f4.kit.tar.Z. Then, I applied the + most recent patches contained in sp3f4.patch.tar.Z and wrote new Linux + build files: "linux" and "os_linux.h" (some minor mods to the source + were also necessary, protected with linux conditionals). + + Since the previous spice3f4.tar.gz port file was generally available, + there was no point in duplicating source, so I just diffed from the + spice3f4.tar.gz tree to freshly ported tree and edited or removed a + few of the diffs. A few of the changes made in spice3f4.tar.gz have + been reverted to the distribution defaults, but one notable change is + that performing the install step will install the necessary files into + /usr/local/spice. You'll need to add /usr/local/spice/bin to your + shell path. See the file conf/linux to change the installation + location (this location gets hard-coded in the spice binaries). + + This is a patched file of the original readme.Linux from + spice3f4.tar.gz, and the previous contents by Jeff@EE.Ryerson.Ca is + given below. Just follow the below instructions, so you should be + able to safely do: + + ./util/build linux + ./util/build linux install + + You should then find the spice binaries and library files + in e.g. /usr/local/spice. Example files and the man pages + are not installed, so you might want to copy them by hand. + + Andrew Veliath (veliaa@rpi.edu) + January 25, 1997 + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is my port of Spice3f4 to Linux. It required a few more changes than the porting document indicated would be necessary, mostly to do with supported/unsupported functions in Linux libc & libm. diff -cr orig/spice3f4/src/include/capabil.h spice3f4/src/include/capabil.h *** orig/spice3f4/src/include/capabil.h Fri Jun 18 12:02:46 1993 --- spice3f4/src/include/capabil.h Sat Jan 25 12:57:36 1997 *************** *** 111,118 **** # ifdef __STDC__ extern double logb(double), scalb(double, int); # else ! /* next line taken out because of inconsistent type errors (NJ) ! extern double logb(), scalb(); */ # endif #endif --- 111,117 ---- # ifdef __STDC__ extern double logb(double), scalb(double, int); # else ! extern double logb( ), scalb( ); # endif #endif diff -cr orig/spice3f4/src/include/cpstd.h spice3f4/src/include/cpstd.h *** orig/spice3f4/src/include/cpstd.h Thu Jun 17 17:34:57 1993 --- spice3f4/src/include/cpstd.h Sat Jan 25 12:57:36 1997 *************** *** 50,56 **** --- 50,58 ---- extern char *printnum(); extern int cp_numdgt; extern void fatal(); + #ifndef linux extern void setenv(); + #endif /* linux */ extern void cp_printword(); /* Externs from wlist.c */ diff -cr orig/spice3f4/src/include/os_linux.h spice3f4/src/include/os_linux.h *** orig/spice3f4/src/include/os_linux.h Wed Nov 30 19:10:57 1994 --- spice3f4/src/include/os_linux.h Sat Jan 25 12:57:36 1997 *************** *** 1,7 **** ! /* include file for linux. Just include sysv, but we also have bzero. */ ! #include "os_sysv.h" ! #define HAS_BCOPY #define HAS_POW10 #define HAS_NO_IEEE_LOGB --- 1,26 ---- ! /* ! * Linux/GNU ! */ ! #include "os_unix.h" ! #define HAS_POSIXTTY /* */ ! #define HAS_SYSVDIRS /* */ ! #define HAS_STRCHR /* strchr( ) instead of index( ) */ ! #define HAS_FLOAT_H ! #define HAS_LIMITS_H ! #define HAS_FTIME /* ftime( ), */ ! #define HAS_SYSVTIME ! #define HAS_BSDRLIMIT ! #define HAS_BSDRUSAGE ! #define HAS_ATRIGH /* acosh( ), asinh( ), atanh( ) */ #define HAS_POW10 #define HAS_NO_IEEE_LOGB + #define HAS_TERMCAP + #define HAS_STDLIB + #define HAS_BCOPY + #define HAS_BSDRANDOM /* srandom( ) and random( ) */ + #define HAS_BSDSOCKETS /* , socket( ), etc. */ + #define HAS_DUP2 + #define HAS_GETWD /* getwd(buf) */ + #define HAS_INTWAITSTATUS /* wait(3) takes an int *, not a union */ diff -cr orig/spice3f4/src/lib/cp/numparse.c spice3f4/src/lib/cp/numparse.c *** orig/spice3f4/src/lib/cp/numparse.c Wed Nov 30 18:20:48 1994 --- spice3f4/src/lib/cp/numparse.c Sat Jan 25 12:57:36 1997 *************** *** 23,29 **** d *= 10.0; return (d); } ! #endif /*HAS_POW10*/ bool ft_strictnumparse = false; --- 23,29 ---- d *= 10.0; return (d); } ! #endif bool ft_strictnumparse = false; diff -cr orig/spice3f4/src/lib/fte/grid.c spice3f4/src/lib/fte/grid.c *** orig/spice3f4/src/lib/fte/grid.c Thu Jun 17 17:32:57 1993 --- spice3f4/src/lib/fte/grid.c Sat Jan 25 12:57:36 1997 *************** *** 17,22 **** --- 17,23 ---- #include "suffix.h" #define RAD_TO_DEG (180.0 / M_PI) + #define LABEL_CHARS 20 static double *lingrid(), *loggrid(); static void polargrid(), smithgrid(); *************** *** 225,231 **** int max; static double dd[2]; int mult = 1; ! char buf[16], *s; int slim, digits; if (axis == y_axis && graph->grid.ysized) { --- 226,232 ---- int max; static double dd[2]; int mult = 1; ! char buf[LABEL_CHARS], *s; int slim, digits; if (axis == y_axis && graph->grid.ysized) { *************** *** 477,483 **** drawlingrid(graph, units, spacing, nsp, dst, lmt, hmt, onedec, mult, mag, digits, axis) GRAPH *graph; ! char units[16]; bool onedec; int nsp, spacing, mult; double hmt, lmt, dst; --- 478,484 ---- drawlingrid(graph, units, spacing, nsp, dst, lmt, hmt, onedec, mult, mag, digits, axis) GRAPH *graph; ! char *units; bool onedec; int nsp, spacing, mult; double hmt, lmt, dst; *************** *** 488,494 **** int i, j; double m, step; ! char buf[16]; /* i counts how many pixels we have drawn, and j counts which unit * we are at. --- 489,495 ---- int i, j; double m, step; ! char buf[LABEL_CHARS]; /* i counts how many pixels we have drawn, and j counts which unit * we are at. *************** *** 567,573 **** double k; double decs; double mag, gain; ! char buf[32], *s; if (axis == x_axis && graph->grid.xsized) { lmt = graph->grid.xaxis.log.lmt; --- 568,574 ---- double k; double decs; double mag, gain; ! char buf[LABEL_CHARS], *s; if (axis == x_axis && graph->grid.xsized) { lmt = graph->grid.xaxis.log.lmt; *************** *** 671,677 **** { int i, j, k, l, m; double t; ! char buf[16]; /* Now plot every pp'th decade line, with subs lines between them. */ if (subs > 1) --- 672,678 ---- { int i, j, k, l, m; double t; ! char buf[LABEL_CHARS]; /* Now plot every pp'th decade line, with subs lines between them. */ if (subs > 1) diff -cr orig/spice3f4/src/lib/fte/newcoms.c spice3f4/src/lib/fte/newcoms.c *** orig/spice3f4/src/lib/fte/newcoms.c Thu Jun 17 17:33:00 1993 --- spice3f4/src/lib/fte/newcoms.c Sat Jan 25 12:57:36 1997 *************** *** 151,156 **** --- 151,160 ---- /* Copy from the first */ vname = cp_unquote(wl->wl_word); dv = vec_get(vname); + if (!dv) { + printf("'%s' reference vector not found\n", vname); + return; + } numdims = dv->v_numdims; dims = dv->v_dims; wl = wl->wl_next; diff -cr orig/spice3f4/src/lib/mfb/mfbgnc.c spice3f4/src/lib/mfb/mfbgnc.c *** orig/spice3f4/src/lib/mfb/mfbgnc.c Thu Jun 17 17:34:25 1993 --- spice3f4/src/lib/mfb/mfbgnc.c Sat Jan 25 12:57:36 1997 *************** *** 24,31 **** --- 24,33 ---- #include "suffix.h" /* Library routines */ + #ifndef linux #ifdef HAS_FTIME extern void ftime(); + #endif #endif /* diff -cr orig/spice3f4/src/lib/misc/math.c spice3f4/src/lib/misc/math.c *** orig/spice3f4/src/lib/misc/math.c Fri Jun 18 16:13:39 1993 --- spice3f4/src/lib/misc/math.c Sat Jan 25 12:57:36 1997 *************** *** 13,20 **** #ifdef HAS_NO_IEEE_LOGB ! /* changed all instances of logb to normslogb (NJ) */ ! double normslogb(x) double x; { double y = 0.0; --- 13,20 ---- #ifdef HAS_NO_IEEE_LOGB ! double ! logb(x) double x; { double y = 0.0; *************** *** 36,44 **** return y; } - /* changed scalb to normsscalb (system routine should be OK (NJ) */ double ! normsscalb(x, n) double x; int n; { --- 36,43 ---- return y; } double ! scalb(x, n) double x; int n; { diff -cr orig/spice3f4/src/lib/sparse/spsmp.c spice3f4/src/lib/sparse/spsmp.c *** orig/spice3f4/src/lib/sparse/spsmp.c Wed Nov 30 19:12:45 1994 --- spice3f4/src/lib/sparse/spsmp.c Sat Jan 25 12:57:36 1997 *************** *** 383,397 **** #endif /* Re-normalize (re or im may be > 2.0 or both < 1.0 */ - /* have to change all of the logb function calls to normslogb (NJ) */ if (re != 0.0) { ! y = normslogb(re); if (im != 0.0) ! z = normslogb(im); else z = 0; } else if (im != 0.0) { ! z = normslogb(im); y = 0; } else { /* Singular */ --- 383,396 ---- #endif /* Re-normalize (re or im may be > 2.0 or both < 1.0 */ if (re != 0.0) { ! y = logb(re); if (im != 0.0) ! z = logb(im); else z = 0; } else if (im != 0.0) { ! z = logb(im); y = 0; } else { /* Singular */ *************** *** 407,420 **** y = z; *pExponent = x + y; ! x = normsscalb(re, (int) -y); ! z = normsscalb(im, (int) -y); #ifdef debug_print printf(" ** values are: re %g, im %g, y %g, re' %g, im' %g\n", re, im, y, x, z); #endif ! pMantissa->real = normsscalb(re, (int) -y); ! pMantissa->imag = normsscalb(im, (int) -y); #ifdef debug_print printf("Determinant 10->2: (%20g,%20g)^%d\n", pMantissa->real, --- 406,419 ---- y = z; *pExponent = x + y; ! x = scalb(re, (int) -y); ! z = scalb(im, (int) -y); #ifdef debug_print printf(" ** values are: re %g, im %g, y %g, re' %g, im' %g\n", re, im, y, x, z); #endif ! pMantissa->real = scalb(re, (int) -y); ! pMantissa->imag = scalb(im, (int) -y); #ifdef debug_print printf("Determinant 10->2: (%20g,%20g)^%d\n", pMantissa->real, *************** *** 484,493 **** int CreateIfMissing; { MatrixPtr Matrix = (MatrixPtr)eMatrix; ! ElementPtr Element = Matrix->FirstInCol[Col]; /* Begin `SMPfindElt'. */ ASSERT( IS_SPARSE( Matrix ) ); Element = spcFindElementInCol(Matrix, &Element, Row, Col, CreateIfMissing); return (SMPelement *)Element; } --- 483,495 ---- int CreateIfMissing; { MatrixPtr Matrix = (MatrixPtr)eMatrix; ! ElementPtr Element; /* Begin `SMPfindElt'. */ ASSERT( IS_SPARSE( Matrix ) ); + Row = Matrix->ExtToIntRowMap[Row]; + Col = Matrix->ExtToIntColMap[Col]; + Element = Matrix->FirstInCol[Col]; Element = spcFindElementInCol(Matrix, &Element, Row, Col, CreateIfMissing); return (SMPelement *)Element; }