Ton Spek's Platon/System S is often updated almost daily with bug
fixes and/or new features. Thus, manually downloading, extracting
and compiling each update can become quite tedious.
A solution that makes a daily update qiute trivial is to use a script that will download the updated version and compile up the code. An example script and getting it working is given below. |
The script uses the snarf program for grabbing
files off the internet via the UNIX command line.
Go to the following Snarf website. Download and compile snarf.
On UNIX operating systems such as FreeBSD, Snarf is included as one of the optional packages that can be installed. |
Thus following is an example UNIX script to do this for you.
Just change the directories and instructions as required.
Click here to download an example script file. This file is in tar.gz format to minimise problems that can occur if the file is not a UNIX ASCII file for some OS varients. (cutting and pasting the script from a web-browser window can possibly be dangerous for some OS's) Extract the tar.gz file by using gzip -d < script.tar.gz | tar xvof - Ensure the script file is executable. chmod +x install.script Edit the install.script file with a text editor and change the directories and options as required by your own system.
#!/bin/sh # Example script file for Lachlan's Linux Laptop # Modify as required. (do a "which sh" to find where # shell file is located) # Note that if problems occur where basic things such as # the cd command are not recognised, it could be that the # file has somehow become a non-UNIX ASCII file. echo "Changing to source code directory" echo "" cd /usr/local/bin/source echo "Changed to source code directory" echo "" echo "Removing old platon source files" echo "" rm -rf platon* echo "Removed old platon files" echo "" echo "Grabbing updated platon source code file" echo "" # Snarf can be downloaded and compiled from: # http://www.xach.com/snarf/ echo "Choose site or mirror to get Platon from." echo "Be wary to check that mirror is working correctly" echo "and has latest version." echo "" # snarf ftp://xraysoft.chem.uu.nl/pub/unix/platon.tar.gz # cp /root/platon.tar.gz . snarf http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/platon-spek/pub/unix/platon.tar.gz # snarf ftp://ftp.ccp14.dl.ac.uk/ccp14/ftp-mirror/platon-spek/pub/unix/platon.tar.gz # snarf ftp://ftp.minerals.csiro.au/pub/xtallography/ccp14/ccp/ccp14/ftp-mirror/platon-spek/pub/unix/platon.tar.gz # snarf http://ccp14.sims.nrc.ca/ccp/ccp14/ftp-mirror/platon-spek/pub/unix/platon.tar.gz echo "Extracting tar.gz file" echo "" gzip -d < platon.tar.gz | tar xvof - echo "Extracted tar.gz file" echo "" echo "Change to newly extracted platon source directory" echo "" cd /usr/local/bin/source/platon echo "Uncompressing platon fortran file" echo "" uncompress platon.f.Z echo "Uncompressed platon fortran file" echo "" echo "Uncompressing platon xrdvr.c file" echo "" gzip -d xdrvr.c.gz echo "Uncompressed platon fortran file" echo "" echo "Compile up Platon" # SGI IRIX and Default UNIX # f77 -o platon platon.f xdrvr.c # Redhat Linux 6.x f77 -o platon platon.f xdrvr.c -L /usr/X11R6/lib -lX11 # FreeBSD Unix with G77 # g77 -o platon platon.f xdrvr.c -I/usr/X11R6/include -L /usr/X11R6/lib -lX11 # FreeBSD with default f2c # f77 -NL400 -Nn802 -Nx800 -o platon platon.f xdrvr.c -I/usr/X11R6/include -L /usr/X11R6/lib -lX11 echo "Platon Compilation finished" echo "" echo "Copy platon and check.def file to binary directory" echo "" cp check.def /usr/local/bin cp platon /usr/local/bin |
To use, first check if there is an updated Platon
Run the Platon auto-download and compile script - ./install.script In theory, all done. Though check the output that everything has gone as expected. |