RAISE Tools Installation Guide for Windows (x86 + x64) Nis Schmidt DTU Informatics Technical University of Denmark February 3, 2012 Based on the 32-bit version by Andreas Andersen Kjær and Anne Haxthausen With kind assistance from Anne Haxthausen and David K Schmidt 1 Introduction This guide is tailored for students following course 02263 at DTU, it explains how to install the RAISE tools on Windows machines. There is another installation guide for Linux machines. There is also a DTU User Guide to the RAISE Tools available from the course s homepage. With few differences in screen layouts, this guide may be applied to Windows versions from XP to Windows 7. The RAISE tools were developed at UNU/IIST and may also be acquired from their netsite at http://www.iist.unu.edu/newrh/iii/3/1/page.html This installation guide has successfully been tested for a Windows 7 64-bit installation. 1.1 Overview You need to install the following software on the C-drive of your PC. If you elect to install on to another drive than C, this may be possible, though it is discouraged. It should be possible, but you are on your own if you do so. Standard ML (see Walkthrough... step 1) MikTeX 2.9 (see Walkthrough... step 3) Raise Tools with emacs editor (see Walkthrough... step 6) Be aware that... Emacs does not seem to handle paths containing spaces. Combining emacs, 1
RSL, and paths containing spaces (e.g. might cause troubles. C:\Documents and Settings\...) 1.2 Download It is advisable to collect all download materials in a separate folder (for this course), so that you can easily repeat the installation - if need be. We will from here on refer to this folderpath as <download>. Create a <download>folder (e.g. RSLDL) to store to following resources: Download the files from the Tools/Windows folder on the 02263 Course s file sharing on CampusNet. Mark all files in the Tools/Windows folder and select Download selected as zip. Rename cn.zip to RSLtools.zip and unpack it to a subfolder named RSLtools. Download MikTeX 2.9 or later from http://miktex.org Note We have used the 32-bit version of MikTeX 2.9, since the 64-bit was at time of writing labelled experimental. 2 Walkthrough of the installation How to install Standard ML of New Jersey 1. Unzip smlnj.zip into C:\sml (so you get C:\sml\bin and C:\sml\lib). 2. Set environment variables (See figure 1). (a) Add C:\sml\bin to the system environment variable Path. (b) Set the environment variable SMLNJ HOME to C:\sml. (c) Set the environment variable RSLML PATH to C:\raise\sml. Steps (b) and (c) should be performed automatically by the rsltc installation step performed later and may be omitted here. However, if you skip (b) and (c), you should verify the correct assignment of these variables after installing. (See figure 4) How to add Latex support 3. Install MikTex to C:\miktex29 - you can skip this if you already have MikTeX installed, but continue with: 4. Copy the files: boxedminipage.sty and rslenv.sty from subfolder <download>\rsltools to <MikTex folder>\tex\latex\base where <MikTex folder> is the MikTex install path. (See figure 2) 2
5. From the start menu open Programs\MikTeX 2.9\Maintenance (Admin)\MikTex Settings (Admin) On the Maintenance panel (see figure 3) of the General tab: (a) Press Refresh FNDB. Wait for completion, then: (b) Press Update Formats. Installing rsltc and emacs 6. Run <download>\raise_admin_setup.exe (a) Install to C:\raise (b) Choose components Emacs, RAISE tool and VCG (c) Restart the system when asked. After the reboot continue with the following... 7. Either replace the contents of C:\emacs\_emacs with the contents of <download>\emacswindows.txt or edit the file C:\emacs\_emacs with WordPad or NotePad: (a) At the bottom of the file, insert the lines: ;;; Facilities for RSL-Latex support ;; Loading files for RSL-Latex support (rslconvert loads tokenise): (load "rslconvert.el") ;; Function for converting RSL formulae in ascii syntax to latex ;; The formulae are placed between \RSLatex and \endrslatex (defun rsl2latex () "Do rslatex on buffer" (interactive) (do-latex)) ;; Function for undoing the above conversion (defun latex2rsl () "Undo rslatex on buffer" (interactive) (undo-latex)) ;; Setting up function keys ;; Pressing f2 invokes do-latex on the whole buffer ;; Pressing f3 invokes undo-latex on the whole buffer (global-set-key [f2] do-latex) (global-set-key [f3] undo-latex) 3
(b) Locate the following lines: ;; Support Cygwin if present (if (file-exists-p "c:/cygwin") (progn (require cygwin-mount) (cygwin-mount-activate) ;; Set up name of Cygwin shell (setq explicit-shell-file-name "c:/cygwin/bin/bash.exe") ;; can then switch to Cygwin by ;; (setq shell-file-name explicit-shell-file-name) )) (c) Comment them out, so they look like this: ;;;; Support Cygwin if present ;;(if (file-exists-p "c:/cygwin") ;; (progn ;; (require cygwin-mount) ;; (cygwin-mount-activate) ;; ;; ;; Set up name of Cygwin shell ;; (setq explicit-shell-file-name "c:/cygwin/bin/bash.exe") ;; ;; can then switch to Cygwin by ;; ;; (setq shell-file-name explicit-shell-file-name) ;; )) 8. Finalize the installation (a) Important: If you are installing on 64-bit Windows, you should now copy the file 64-bit executable <download>\rsltools\rsltc.exe to the folder C:\raise\rsl. (b) Verify the assignments of the environment variables set in 2. (c) Create a shortcut to target C:\emacs\bin\runemacs.exe for running Emacs. 9. Run Emacs to test functionality by clicking the shortcut just created. (a) Enter the follow text in the emacs *scratch* buffer and save to a file called X.rsl scheme X = class test_case [t1] 1 + 2, 4
end [t2] true \/ false After saving content to an.rsl file the RSL menu item should appear and the text should be syntax highlighted. If you do not see any syntax highlighting like in figure 5), check that the HOME environment variable is set to c:\emacs. Testing syntax and type checking (b) In order to type check the specification, select RSL Type check from the drop down menu. Testing SML execution (c) The previously created file X.rsl contains executable RSL-code. In order to execute the code, select: RSL SML Translate to SML and run from the drop down menu. If it works, you will probably see something like this: Standard ML of New Jersey v110.59 [built: Mon Jun 05 13:26:49 2006] - [opening c:/test/x.sml] [autoloading] [library $smlnj/cm/cm.cm is stable] [library $smlnj/internal/cm-sig-lib.cm is stable] [library $/pgraph.cm is stable] [library $smlnj/internal/srcpath-lib.cm is stable] [library $SMLNJ-BASIS/basis.cm is stable] [autoloading done] val it = true : bool [autoloading] [autoloading done] [autoloading] [autoloading done] val it = true : bool [autoloading] [autoloading done] [opening X_.sml] structure RT_Int : <sig> structure RT_Bool : <sig> 5
structure X : <sig> open X [t1] 3 [t2] true [t1] 3 and [t2] true are results of the execution. Testing the Latex-support (d) Create a.tex document within emacs and store it in the same folder as X.rsl. Add the following lines to the file: \documentclass{article} \usepackage{rslenv} \begin{document} % Remember: alt+x mkdoc \RAISEIN{X} \end{document} (e) Within emacs, press alt and x at the same time. It is now possible to type a command. Type mkdoc and hit enter. Emacs has now generated a file called X.tex. Select TeX-Tex File from the drop down menu. Latex will build a dvi-file with the following content: scheme X = class test case [ t1 ] 1 + 2, [ t2 ] true false end This concludes verification of the installation. 6
Screen dumps of selected operations in the above walkthrough may be found in the following appendix. A Screen dump images Figure 1: To set environment variables you need to open System Properties of My Computer. 7
Figure 2: Copy the two style files to the appropriate miktex folder. Figure 3: prompt. Test environment variables and sml compiler using a command 8
Figure 4: prompt. Test environment variables and sml compiler using a command 9
Figure 5: Check syntax highlighting. 10