The SUIF Frequently Asked Questions List ======================================== 1. Q: ``The Makefile is broken. What does, `Must be a separator on rules line 5. Stop.' mean?'' A: It means you're not using GNU make. Try ``gmake'' instead. If gmake isn't in your path, find out where it's installed on your system and put it in your path. If gmake isn't installed, you'll need to install it. See the SUIF README file. 2. Q: ``I compile the SPEC benchmark tomcatv (or some other large FORTRAN program) with SUIF and the compilation seems to work, but when I run the resulting binary it seg faults immediately. What's wrong?'' A: You need to remove the limit on the stack size of processes. Under csh, try ``unlimit stack''. This program uses an enormous (in the MB range) local array. SUIF puts locals on the stack, so if you have low stack-size limits, which are often the default, the program will crash. 3. Q: ``When I compile a program (on a non-MIPS machine, or on a MIPS machine with -s2c), why do I get errors like: "/tmp/scc00684_5.out.c", line 227: syntax error at or near variable name "F" or other similar errors in a weird .out.c file?'' A: The s2c backend, which is run by default on non-MIPS machines, or if you specify the -s2c option to scc, converts SUIF into C and then runs your native C compiler to generate an executable. The output of s2c is ANSI-C compliant, but many C compilers are unable to handle ANSI-C code. You should use an ANSI-C compliant compiler, such as gcc, instead. You can specify the name of another compiler with the "-cc name" option to scc, such as "-cc gcc". 4. Q: ``If I want to run the output program on a different machine than the one on which I run SUIF, can I do that?'' A: Yes, this is called cross-compiling, and SUIF is generally capable of cross compiling for any target machine that has an ANSI C compiler. There are a couple of issues you should be aware of, though. They have to do with ensuring that SUIF uses information about the true target machine instead of information about that machine on which SUIF is running. Since the most common case is to target the machine on which SUIF is running (or a machine with the same processor and OS), by default SUIF uses the information about the machine on which it is running as the target information. Since SUIF is designed to facilitate cross-compilation, the assumptions about the target machine are made at only two points in the compilation: * The C pre-processor stage (note that this stage is used in Fortran compilation, not just C compilation). At the pre-processor stage, system include files are incorporated into the program by directives such as ``#include ''. These include files are highly system-dependent. Typically they are provided by the OS, mostly in /usr/include. To cross-compile, you must first run the passes that come before the C pre-processor (cpp), which is nothing for C programs, but is the ``sf2c'' pass for Fortran programs (run ``scc -.c file.f'') on the machine that runs SUIF. Then, you must transfer all the files to the target machine, run the pre-processor to generate .i files (cpp on some systems, ``cc -E'' on other systems, and other things on other systems). Then you must transfer all the .i files back to the machine running SUIF and then you can continue the compilation from the .i files. That always works. As an alternative, you can try duplicating the entire /usr/include directory tree for target machine under $SUIFHOME//include. You also have to generate the proper $SUIFHOME//predefined.txt file showing what pre-defined macros defines by default in its pre-processor (see $SUIFHOME/src/basesuif/config/README.config for details). If you can do that correctly, then all you have to do is specify ``-Target '' to scc and it will be able to run cpp on the SUIF machine and yet get everything correctly set up for as target. * The snoot pass. This pass initializes a table used by snoot and all later passes that gives informatin about the target machine, mostly sizes and alignments of data types. This information is passed along in the SUIF file, so it only needs to be set once, in snoot, and all later passes will have the correct information. By default, snoot assumes the parameters of the machine running SUIF (snoot auto-detects this information). But for cross-compiling, snoot must be given the information about the target machine. This information is kept in a table in $SUIFHOME/src/basesuif/snoot/config.h. This table may have any number of entries -- a table with a few sample entries for popular machines is distributed. A table for a new machine can be automatically constructed using the ``find_params.c'' file from snoot's source directory. See comments in that file for details. Once you have the table for the new machine, you can add it to config.h, then you must recompile snoot. After snoot is recompiled, it will understand the name you have given for your new machine as a valid target. You can use ``scc -Target '' to pass the machine name to snoot, or, if you are running snoot directly, you can use ``snoot -T''. Note that if you want to do the work to set it all up, you can get SUIF to compile straight from source to output C file (or other back-end output) on the machine running SUIF for several different targets, and choose between them by changing nothing more than the argument to the ``-Target'' option for scc.