Using p2c for the UTICPC

Created September 19, 1997

Yes, the UTICPC still supports Pascal. We use p2c to translate to C, and then compile the resulting C code with gcc.

Here's how to use p2c on CDF, with an example program prog.p:

  1. Make sure ~contest/publicbin is on your path so that you can find the p2c program. You need this in your path to get the submission and other scripts anyway.
  2. Translate prog.p to prog.c with the following command:
    p2c prog.p
    
  3. Compile the prog.c with the following options to get the Pascal library code and header file, e.g.:
    gcc -o prog prog.c ~contest/p2c/libp2c.a -I/homes/u2/contest/contest
    
  4. You should now have an executable program file prog.
You may want to encapsulate this procedure with a shell script.

David Neto
Fri Sep 19 11:00:02 EDT 1997