« Setting Cygwin's window title | Main | Car warranty deception »

Building SNNS on Cygwin

Here is what I did to get SNNSv4.2 to build on Cygwin. Someone may wish to improve my methods and submit them back to the authors. For now, this should get you through.

  • Run the Cygwin setup program and make sure Bison and X11 are installed. In particular the xorg-x11-devel package is necessary. Other packages are necessary too, but I already had them installed.
  • Download and uncompress SNNSv4.2.
  • Run ./configure in the extracted SNNSv4.2 directory. I passed in the --enable-global flag to enable installation in /usr/local/bin, but that’s up to you.
  • The first change is to define MAXSHORT and friends. Cygwin calls these constants SHRT_MAX etc. (as defined in limits.h). The best place I found to make the change is in SNNSv4.2/kernel/sources/glob_typ.h. There could be a better place.

I added these lines:

 #include <limits.h>
 #define MAXSHORT SHRT_MAX
 #define MINSHORT SHRT_MIN
 #define MININT INT_MIN
 #define MAXINT INT_MAX
  • Next, Cygwin does not define the SIGIOT signal. Rather than make it up when there’s probably a good reason it is not defined, I removed reference to it from SNNS. To do so, I commented out line 393 of SNNSv4.2/tools/sources/snnsbat.c. It looks like a catch-all line anyway.

snnsbat.c:393

//  signal( SIGIOT,  emergency_exit );
  • Now it appears that if the X11 libraries are installed when you run the configure script, all will run smoothly. If instead, you get a linker error at the last step, edit Makefile.def to include the X libs directory:

Makefile.def:97

X_LIBS             =  -L/usr/X11R6/lib
  • Run make, then if you wish, make install. I ended up moving all the SNNS executables (there’s analyze, batchman, convert2snns, feedback-gennet, ff_bignet, isnns, linknets, mkhead, mkout, mkpat, netlearn, netperf, pat_sel, pat_sel_simple, snns2c, snnsbat, td_bignet and xgui) into their own directory and just created a symlink to xgui.

  • Start X using startx, and from within the xterm, run xgui.

Leave a comment if you try these steps.

TrackBack

TrackBack URL for this entry:
http://heath.hrsoftworks.net/cgi-bin/mt-tracker.cgi/113

Comments

i recon...

step 1
you're a nerd!

Step 2
go nerd yourself

step 3
buy me some flowers

step 4
go find another nerd

Step 5
tie your shoelaces to the other nerd

Step 6
Stand up and run

Step 7
now that you're on the ground, stay there :)

words of advice:
lie down before you hurt yourself

Post a comment