Setting up your toolchain Index

We will be running your code using the following software:

Even if you're working alone, it's still useful to set up a source control system. Subversion works well. Windows users should install TortoiseSVN. If you're going to be working in a group, contact CETS about setting up a UNIX group on ENIAC so that you can all share a repository.

If you set up a repository, try to avoid checking in binary files. You don't need to add OMake's .omc files to version control either.

All course tools should be installed on ENIAC. You can save yourself an hour by working over SSH, but we're including these instructions in case you'd like to use your own equipment.

To use the tools on ENIAC, you'll have to add cis341 directories to your path: export PATH=/home1/c/cis341/pub/bin:/home1/c/cis341/pub/usr/local/bin:$PATH export OMAKEPATH=/home1/c/cis341/pub/usr/local/lib/omake:$OMAKEPATH

You can safely stop here. For all assignments we fully support working on ENIAC.

You can get OCaml from the official site (including a Windows installer) In addition, OCaml should be installed and running on eniac-l.

If you don't have it already, you should use your free MSDNAA access to download a copy of Visual Studio 2008. After doing so, you can elect to download the port based on the Microsoft toolchain. Make sure to run all command-line utilities from the Visual Studio 2008 Command Prompt—otherwise, ocamlopt (and friends) will complain about missing executables.

Using OMake is much more convenient than using traditional makefiles. You can get it from its official site.

If your distribution does not have an up-to-date OCaml or OMake package, you can still build from source. OCaml's configure script accepts an option -prefix that allows you to dictate where make install drops files; OMake provides a similar lever through the INSTALL_ROOT environment variable. Check the software's respective INSTALL files for details, and feel free to send mail to the class list if you have any trouble.

Windows users should download Microsoft's Debugging Tools for Windows for windbg.exe.

If you have a working copy of the GNU binutils (as any proper Linux or OS X installation should), it is likely that you already have a working version of GAS. Try as --version to make sure. Windows users can download a Win32-native binutils from the mingw32 project (choose the latest version of the binutils package). If you do this, you'll have to configure your paths yourself. In Windows XP, you can right-click on My Computer, select Properties, select Advanced, then Environment Variables, then Path (a user variable). I added C:\Program Files\Debugging Tools for Windows (x86) and C:\mingw-binutils\bin.

Download the project1 archive and extract it to somewhere convenient. It is important that you do not change the directory structure. We'll refer to the directory containing 'projects' as cis341 (so when we talk about the file cis341/projects/OMakeroot, it's the file from the archive's projects directory).

To be reasonably certain that you have everything right, open a shell at cis341/projects/smoketest and type: omake omake test At some point in the process, you will have to provide interactive input to your machine's debugger. Look for this message: ******************************************************* *** Quit gdb with 'q' followed by return. If you're *** *** on Windows, just close windbg. *** ******************************************************* Close before it should be: No smoke unless we segfault! Result: 0 Finally, once you quit the debugger, you should not see any messages about failed tests.

  • 'cl' is not recognized as an internal or external command: cl is not on your path. Did you remember to run omake in a Visual Studio 2008 Command Prompt?
  • There is a known issue with this test on OS X. If you are using OS X, look for the message X86asld.AsmLinkError("./c_bin/runSOMEHEX.bin", "Signaled with -10.") If you can find it, then you're in good shape.

If you have any more suggestions for OCaml editors, please send them to the class list.

SciTE is a nice barebones text editor with support for OCaml syntax highlighting. If you elect to use it, you can (after a fashion) configure it to build OCaml programs straight from the editor window. First, make sure to fix your fonts and tab settings (Options/Global Options): # Indentation tabsize=2 indent.size=2 use.tabs=0 font.base=font:Consolas,size:10 font.small=font:Consolas,size:8 font.comment=font:Consolas Italic,size:10 font.code.comment.box=$(font.comment) font.code.comment.line=$(font.comment) font.code.comment.doc=$(font.comment) font.text=font:Consolas,size:10 font.text.comment=font:Consolas,size:10 font.embedded.base=font:Consolas,size:10 font.embedded.comment=font:Consolas,size:10 font.monospace=font:Consolas,size:10 font.vbs=font:Consolas,size:10 In caml.properties (Options/caml.properties): command.compile.*.ml=omake $(FileDir)\$(FileName).cmo command.compile.*.mli=omake $(FileDir)\$(FileName).cmi command.build.$(file.patterns.caml)=omake command.build.directory.$(file.patterns.caml)=$(FileDir) If any of these keys are already set, you should overwrite the old definitions. If you're on Windows, you will need to run SciTE in an environment with the Visual Studio variables set. You can do this by writing a small batch file: call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 start C:\local\path\to\SciTE.exe