Skip to content

Instantly share code, notes, and snippets.

@kocsenc
Last active June 18, 2023 19:21
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kocsenc/10130261 to your computer and use it in GitHub Desktop.
Save kocsenc/10130261 to your computer and use it in GitHub Desktop.
Installing jSpin for Unix/Linux and Mac

jSpin for Mac and Linux

This is a quick simple guide to getting jSpin setup for Mac and Linux.

Prereq's

You will need:

  • Java (1.5 +)
  • GCC Compiler (most should have this already)
  • Mac only: brew

Install for Mac

  1. brew install spin
  2. At this point you can just run spin file.pml to run spin. If you still want jSpin, carry on.
  3. Download the jspin*.zip file from their download site or direct link for 5.0
  4. Unzip it
  5. Download config.cfg below and place it in the unzipped folder.
  6. Replace config.cfg line 12 => SPIN=/usr/local/bin/spin
  7. Replace config.cfg line 27 => C_COMPILER=/usr/bin/gcc
  8. Double click on jSpin.jar or run java -jar jSpin.jar

Install for Linux

  1. Download the sources and follow the instructions on their site. Do not install iSpin just spin. The file build.sh may be helpful for you.
  2. Make sure you make the spin executable available at /usr/bin/spin. You can use symlinks.
  3. Download the jspin*.zip file from their download site or direct link for 5.0
  4. Unzip it
  5. Download config.cfg below and place it in the unzipped folder.
  6. Pay attention to line 12 of config.cfg as it should link to the spin executable you installed earlier.
  7. Double click on jSpin.jar or run java -jar jSpin.jar

Troubleshooting

The best I got for troubleshooting is to simply walk through the config.cfg file and make sure all the paths check out to actual binaries. Under no circumstance try to install windows for this to work. You can do it.

Also

Remember jSpin is a java based IDE for spin. You don't need to use it! You can also use spin in the command line to compile and run your promela files (C style) or other IDE's such as iSpin.

#!/bin/env bash
# Has to be ran inside of the jspin unzipped directory! Linux only, not Mac
javac jspin/*.java
javac spinSpider/*.java
javac filterSpin/*.java
jar cfm jSpin.jar jspin/MANIFEST.MF jspin/*.class spinSpider/*.class filterSpin/*.class
#jSpin configuration file
#Kocsen Chung => For Linux/Unix machines
#Wed Dec 15 09:27:07 IST 2010
VERIFY_OPTIONS=-a
FONT_SIZE=14
PAN_OPTIONS=-X
WIDTH=1000
INTERACTIVE_OPTIONS=-i -X
SELECT_MENU=5
WRAP=true
SELECT_BUTTON=220
SPIN=/usr/bin/spin
LR_DIVIDER=400
CHECK_OPTIONS=-a
VERIFY_MODE=Safety
VARIABLE_WIDTH=10
MSC=false
SOURCE_DIRECTORY=jspin-examples
TAB_SIZE=4
RAW=false
C_COMPILER_OPTIONS=-o pan pan.c
VERSION=6
COMMON_OPTIONS=-g -l -p -r -s
TRAIL_OPTIONS=-t -X
MAX_DEPTH=2000
TRANSLATE_OPTIONS=-f
C_COMPILER=/bin/gcc
STATEMENT_TITLE=Statement
DOT=/bin/dot
ABOUT_FILE_NAME=txt/copyright.txt
FONT_STYLE=0
MIN_DIVIDER=50
HELP_FILE_NAME=txt/help.txt
PROCESS_TITLE=Process
HEIGHT=700
SINGLE_QUOTE=false
UNEXECUTABLE=false
PAN=pan
RANDOM_OPTIONS=-X
FONT_FAMILY=Lucida Sans Typewriter
NEGATE_LTL=true
POLLING_DELAY=200
STATEMENT_WIDTH=18
SEED=0
SELECT_HEIGHT=70
PROCESS_WIDTH=7
FAIRNESS=true
MAX_STEPS=250
TB_DIVIDER=500
LINES_PER_TITLE=20
@akandiah
Copy link

akandiah commented Oct 6, 2015

Jspin does not work well with Java 1.7 and greater. The GUI is severely affected when you attempt to run it.

@Darigitin
Copy link

Thanks for the guide, this got things working great for my colleges concurrency class. One note I'll make though, in your config.cfg gcc might not always be in /bin my install had it in /usr/bin so depending on the install you might have to change line 27.

@faezehkhoobi
Copy link

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment