Setting up Linux Machines for use of SPARK Ada and why3 via File Manager (Computer Science, Swansea University)
The following are the steps for configuring the settings in the Linux
Lab so that SPARK Ada and why3 can be started from the file Manager without
using the Command Shell.
Please study the file
Basic Terminology
in Linux explaining the basic terminology of Linux
such as directory, ~/bin etc.
Download the git repository using
these instructions
Then go in the file manager in the git repository downloaded to the directory
exampleCodeForTesting/
- Rightclick on the file main.gpr → open with
→ open with other Appliction
- Choose "Use a custom command" which appears below all the applications
- Browse and go to "/usr/local/gnat/bin/gnatstudio" (not a smilar file ending with exe)
- If you have installed it on your own machine, you need to navigate to where
gnatstudio is installed.
- During installation the system will tell you to adapt the path, which will includie
the path to gnatstudio.
- If you have set the path but forgotten where it is you can try on a terminal "which gnatstudio" -- this shows where this file is located.
- Click on "Use as default for this kind of file (you can always change it
by using the same procedure).
Once why3 is installed (it will be installed later since it is not
needed yet) we will similarly associate files with extension .mlw with the
why3 program
Make sure that you don't use file names and paths containing blanks.
- We had in the past problems that
Spark Ada doesn't work when the file name or any file name in the path
contains a blank.
- Simply replace blanks by underscore "_".
If you now navigate using a new file manager to a directory containing
a SPARK Ada project, and left click on main.gpr gnatstudio is opened for this
directory.
We need to change the preferences for executing programs using the terminal xterm.
- In gnatstudio, go to
edit → preferences → External commands → on right side
change "xterm -hold -e" to "xterm -hold"
- Just delete -e, don't copy from the webpage since it might replace - by a
similar but different symbol.
- If you accidentially changed it or have problems later just enter from the keyboard
"xterm -hold"
Now study basic usage instructions of SPARK Ada