*BSD News Article 10678


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA466 ; Sun, 31 Jan 93 14:09:48 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!paladin.american.edu!news.univie.ac.at!email!mbirgmei
From: mbirgmei@email.tuwien.ac.at (Martin BIRGMEIER)
Subject: SNNS porting patches (was Re: values.h anyone ??)
Message-ID: <1993Feb2.073232.15238@email.tuwien.ac.at>
Summary: neural network simulator - SNNS - patches for 386bsd
Keywords: neural network simulator - SNNS - patches for 386bsd
Organization: Technical University of Vienna
References: <1993Feb2.020320.14789@cm.cf.ac.uk>
Date: Tue, 2 Feb 1993 07:32:32 GMT
Lines: 333

In article <1993Feb2.020320.14789@cm.cf.ac.uk> paul@isl.cf.ac.uk (Paul) writes:
>Has anyone got a values.h file for 386BSD.
>
>I need it to port a package. (The SNNS neural network package, anyone
>done it already?)
[...]

============================== cut here ==============================
*** SNNSv2.1/tools/sources/Makefile.ORIG	Wed Sep 23 18:18:51 1992
--- SNNSv2.1/tools/sources/Makefile	Mon Feb  1 18:07:42 1993
***************
*** 1,7 ****
  all: analyze pat_sel
  
  analyze: analyze.c
! 	cc analyze.c -o analyze
  
  pat_sel: pat_sel.c
! 	cc pat_sel.c -o pat_sel
--- 1,11 ----
+ CC=gcc
+ CCFLAGS   = -g -fwritable-strings
+ CFLAGS = $(CCFLAGS)
+ 
  all: analyze pat_sel
  
  analyze: analyze.c
! 	$(CC) $(CFLAGS) analyze.c -o analyze
  
  pat_sel: pat_sel.c
! 	$(CC) $(CFLAGS) pat_sel.c -o pat_sel
*** SNNSv2.1/kernel/sources/kr_inversion.h.ORIG	Wed Sep 23 18:18:45 1992
--- SNNSv2.1/kernel/sources/kr_inversion.h	Fri Jan 29 12:10:49 1993
***************
*** 49,55 ****
  
  /* global variables for inversion method */
  
! typedef struct UnitList{
      int             no;
      FlintType       act;
      FlintType       i_act;
--- 49,55 ----
  
  /* global variables for inversion method */
  
! struct UnitList{
      int             no;
      FlintType       act;
      FlintType       i_act;
*** SNNSv2.1/kernel/sources/kr_rand.c.ORIG	Wed Sep 23 18:18:45 1992
--- SNNSv2.1/kernel/sources/kr_rand.c	Fri Jan 29 12:03:24 1993
***************
*** 12,18 ****
  
  **********************************************************************/
  
! #ifdef  __MSDOS__
  
  #ifndef  MSDOS_RAND_FUNCS
  #define  MSDOS_RAND_FUNCS
--- 12,18 ----
  
  **********************************************************************/
  
! #if defined(__MSDOS__) || defined(__386BSD__)
  
  #ifndef  MSDOS_RAND_FUNCS
  #define  MSDOS_RAND_FUNCS
*** SNNSv2.1/kernel/sources/snnsbat.c.ORIG	Wed Sep 23 18:18:45 1992
--- SNNSv2.1/kernel/sources/snnsbat.c	Thu Jan 28 18:06:10 1993
***************
*** 16,29 ****
  #include <stdlib.h>
  #include <signal.h>
  #include <ctype.h>
- #include <limits.h>
- #include <time.h>
- #include <string.h>
- #include <fcntl.h>
  #include <sys/param.h>
  #include <sys/types.h>
  #include <sys/times.h>
  #include <sys/utsname.h>
  
  #include "glob_typ.h"   /* SNNS-Kernel constants and data type definitions  */
  #include "kr_ui.h"      /* SNNS-Kernel User-Interface Function Prototypes   */
--- 16,29 ----
  #include <stdlib.h>
  #include <signal.h>
  #include <ctype.h>
  #include <sys/param.h>
  #include <sys/types.h>
  #include <sys/times.h>
  #include <sys/utsname.h>
+ #include <limits.h>
+ #include <time.h>
+ #include <string.h>
+ #include <fcntl.h>
  
  #include "glob_typ.h"   /* SNNS-Kernel constants and data type definitions  */
  #include "kr_ui.h"      /* SNNS-Kernel User-Interface Function Prototypes   */
*** SNNSv2.1/kernel/sources/init_f.c.ORIG	Wed Sep 23 18:18:45 1992
--- SNNSv2.1/kernel/sources/init_f.c	Thu Jan 28 17:22:11 1993
***************
*** 12,18 ****
  
  **********************************************************************/
  
! #include <math.h>
  
  #include "kr_typ.h"	 /*  Kernel Types and Constants  */
  #include "kr_const.h"	 /*  Constant Declarators for SNNS-Kernel  */
--- 12,18 ----
  
  **********************************************************************/
  
! #include <float.h>
  
  #include "kr_typ.h"	 /*  Kernel Types and Constants  */
  #include "kr_const.h"	 /*  Constant Declarators for SNNS-Kernel  */
***************
*** 28,33 ****
--- 28,34 ----
  #define  INIT_PARAM4( param )   param[ 3 ]  /*    contains the 4th initialisation parameter  */
  #define  INIT_PARAM5( param )   param[ 4 ]  /*    contains the 5th initialisation parameter  */
  
+ extern double sqrt(double);
  
  /*#################################################
  
***************
*** 754,760 ****
  		/* determine the hidden unit with maximum scalar product*/
  		/* between its weights and the output of the input layer*/
  		winner = (struct Unit *) NULL;
! 		maximum = (float) -HUGE_VAL;	/* -oo, see math.h	*/
  		topo_ptr = topo_hidden_ptr;
  		while ((unit_ptr = *(topo_ptr++)) != NULL)
  		{
--- 755,761 ----
  		/* determine the hidden unit with maximum scalar product*/
  		/* between its weights and the output of the input layer*/
  		winner = (struct Unit *) NULL;
! 		maximum = (float) -FLT_MAX;	/* -oo, see math.h	*/
  		topo_ptr = topo_hidden_ptr;
  		while ((unit_ptr = *(topo_ptr++)) != NULL)
  		{
***************
*** 917,923 ****
  		/* determine the hidden unit with maximum scalar product*/
  		/* between its weights and the output of the input layer*/
  		winner = (struct Unit *) NULL;
! 		maximum = (float) -HUGE_VAL;	/* -oo, see math.h	*/
  		topo_ptr = topo_hidden_ptr;
  		while ((unit_ptr = *(topo_ptr++)) != NULL)
  		{
--- 918,924 ----
  		/* determine the hidden unit with maximum scalar product*/
  		/* between its weights and the output of the input layer*/
  		winner = (struct Unit *) NULL;
! 		maximum = (float) -FLT_MAX;	/* -oo, see math.h	*/
  		topo_ptr = topo_hidden_ptr;
  		while ((unit_ptr = *(topo_ptr++)) != NULL)
  		{
*** SNNSv2.1/kernel/sources/Makefile.ORIG	Thu Jan 28 16:15:10 1993
--- SNNSv2.1/kernel/sources/Makefile	Mon Feb  1 10:59:49 1993
***************
*** 34,40 ****
  
  # -- C-Compiler Configuration --
  
! CC = cc
  CFLAGS = $(CCFLAGS) $(FPOPTIONS)
  
  # -- Archive Configuration --
--- 34,41 ----
  
  # -- C-Compiler Configuration --
  
! CC = gcc
! CCFLAGS   = -g -fwritable-strings
  CFLAGS = $(CCFLAGS) $(FPOPTIONS)
  
  # -- Archive Configuration --
***************
*** 62,72 ****
  		netperf.c version.h random.h snnsbat.c strdup.c\
  		trans_f.c update_f.c tbl_func.c sigmoid.tbl\
                  kr_inversion.h kr_inversion.c matrix.h matrix.c ext_typ.h\
! 		$(DEMOSOURCE) $(UTILIY_SOURCE)
  
  # -- Object files --
  
! KERNELOBJECTS	= kr_mem.o kernel.o kr_ui.o kr_io.o kr_inversion.o
  USR_FUNC_OBJECTS= kr_funcs.o trans_f.o update_f.o init_f.o learn_f.o tbl_func.o\
  		func_tbl.o matrix.o
  DEMOOBJECTS	= $(DEMOSOURCE:.c=.o)
--- 63,73 ----
  		netperf.c version.h random.h snnsbat.c strdup.c\
  		trans_f.c update_f.c tbl_func.c sigmoid.tbl\
                  kr_inversion.h kr_inversion.c matrix.h matrix.c ext_typ.h\
! 		$(DEMOSOURCE) $(UTILIY_SOURCE) kr_rand.c
  
  # -- Object files --
  
! KERNELOBJECTS	= kr_mem.o kernel.o kr_ui.o kr_io.o kr_inversion.o kr_rand.o
  USR_FUNC_OBJECTS= kr_funcs.o trans_f.o update_f.o init_f.o learn_f.o tbl_func.o\
  		func_tbl.o matrix.o
  DEMOOBJECTS	= $(DEMOSOURCE:.c=.o)
***************
*** 98,104 ****
  all:	$(KERNELDEMO)
  
  install:
! 	strip $(KERNELDEMO)
  	cp $(KERNELDEMO) $(KERNELBINDIR)
  	cp $(LIBKERNEL) $(KERNELLIBDIR)
  	cp $(LIBFUNCS) $(KERNELLIBDIR)
--- 99,105 ----
  all:	$(KERNELDEMO)
  
  install:
! #	strip $(KERNELDEMO)
  	cp $(KERNELDEMO) $(KERNELBINDIR)
  	cp $(LIBKERNEL) $(KERNELLIBDIR)
  	cp $(LIBFUNCS) $(KERNELLIBDIR)
*** SNNSv2.1/xgui/sources/ui_inversion.c.ORIG	Fri Jan 29 12:49:17 1993
--- SNNSv2.1/xgui/sources/ui_inversion.c	Fri Jan 29 12:47:10 1993
***************
*** 272,278 ****
      ui_invBox = XtCreateManagedWidget("form", formWidgetClass, ui_invpop, 
  				      NULL, ZERO);
      doneButton = ui_xCreateButtonItem("done", ui_invBox, NULL, NULL);
!     XtAddCallback(doneButton, XtNcallback, ui_inv_popupDone);
      helpButton = ui_xCreateButtonItem("help", ui_invBox, doneButton, NULL);
      XtAddCallback(helpButton, XtNcallback, ui_invHelp, FALSE);
      eta_lab = ui_xCreateLabelItem("eta           =", ui_invBox,120,
--- 272,278 ----
      ui_invBox = XtCreateManagedWidget("form", formWidgetClass, ui_invpop, 
  				      NULL, ZERO);
      doneButton = ui_xCreateButtonItem("done", ui_invBox, NULL, NULL);
!     XtAddCallback(doneButton, XtNcallback, ui_inv_popupDone, 0);
      helpButton = ui_xCreateButtonItem("help", ui_invBox, doneButton, NULL);
      XtAddCallback(helpButton, XtNcallback, ui_invHelp, FALSE);
      eta_lab = ui_xCreateLabelItem("eta           =", ui_invBox,120,
***************
*** 399,405 ****
      ui_invHBox = XtCreateManagedWidget("form", formWidgetClass, ui_invHelp, 
  				      NULL, ZERO);
      doneButton = ui_xCreateButtonItem("done", ui_invHBox, NULL, NULL);
!     XtAddCallback(doneButton, XtNcallback, ui_inv_helpDone);
  
  
      if(fromMain){
--- 399,405 ----
      ui_invHBox = XtCreateManagedWidget("form", formWidgetClass, ui_invHelp, 
  				      NULL, ZERO);
      doneButton = ui_xCreateButtonItem("done", ui_invHBox, NULL, NULL);
!     XtAddCallback(doneButton, XtNcallback, ui_inv_helpDone, 0);
  
  
      if(fromMain){
***************
*** 731,737 ****
          XtRemoveWorkProc(ui_workProcId); /* kill old workProc */
      ui_workType = 99;
      INV_RUNNING = 1;
!     ui_workProcId = XtAppAddWorkProc(ui_appContext, ui_do_inversion); 
  }
  
  
--- 731,737 ----
          XtRemoveWorkProc(ui_workProcId); /* kill old workProc */
      ui_workType = 99;
      INV_RUNNING = 1;
!     ui_workProcId = XtAppAddWorkProc(ui_appContext, ui_do_inversion, 0); 
  }
  
  
*** SNNSv2.1/xgui/sources/Makefile.ORIG	Thu Jan 28 16:15:11 1993
--- SNNSv2.1/xgui/sources/Makefile	Fri Jan 29 15:31:01 1993
***************
*** 38,47 ****
  
  XGUIDEBUG=
  #XGUIDEBUG= -g -DDEBUG
  CFLAGS= $(XGUIDEBUG) $(CCFLAGS) $(FPOPTIONS) -I$(SNNSDIR)/kernel/sources \
         -I$(SNNSDIR)/xgui/iconsXgui -I$(XH)
  LDOPTIONS= -L$(XDIR) -lm -lXaw -lXmu -lXt -lXext -lX11
- CC= cc
  
  # -- Archive Configuration --
  
--- 38,48 ----
  
  XGUIDEBUG=
  #XGUIDEBUG= -g -DDEBUG
+ CC= gcc
+ CCFLAGS   = -g -fwritable-strings
  CFLAGS= $(XGUIDEBUG) $(CCFLAGS) $(FPOPTIONS) -I$(SNNSDIR)/kernel/sources \
         -I$(SNNSDIR)/xgui/iconsXgui -I$(XH)
  LDOPTIONS= -L$(XDIR) -lm -lXaw -lXmu -lXt -lXext -lX11
  
  # -- Archive Configuration --
  
============================== cut here ==============================

============================== cut here ==============================
/* @(#) values.h MB 28 Jan 1993 */

#ifndef _VALUES_H_
#define _VALUES_H_

#include <limits.h>
#include <float.h>

#ifndef MAXSHORT
#define MAXSHORT SHRT_MAX
#endif

#ifndef MAXFLOAT
#define MAXFLOAT FLT_MAX
#endif

#endif /* _VALUES_H_ */
============================== cut here ==============================

(This values.h is just enough to get SNNS compiled :-)).

Cheers,

Martin