CcCommandsDoc.tioga
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Eduardo Pelegri-Llopart, March 10, 1989 9:05:36 am PST
Carl Hauser, May 25, 1988 10:45:18 am PDT
Bill Jackson (bj) May 25, 1988 5:20:53 pm PDT
Last tweaked by Mike Spreitzer on April 27, 1990 9:24:55 am PDT
Willie-s, February 15, 1993 1:48 pm PST
CEDAR 7.0 — FOR INTERNAL XEROX USE ONLY
CcCommands
Eduardo Pelegri-Llopart
© Copyright 1988 Xerox Corporation. All rights reserved.
Abstract: CcCommands are a collection of useful commands to perform actions related to C compilations
Created by: Eduardo Pelegri-Llopart
Maintained by: Eduardo Pelegri-Llopart <Pelegri.pa>
Keywords: CC, ComplexCc, CcReset, CcStatus, CcPut, cRcopy, CheckClobber, DeleteIfEmpty, Make, StampCc
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Commands
ComplexCc
ComplexCC is used to bundle together Cedar-to-Unix file copying, C compiles, and loads, and Unix-to-Cedar file copying. This is useful for cedarboot since we keep the files on Cedar and we have to get things done in Unix.
The general paradigm is:
Make sure all the useful files are on the Unix machine
Do a C compile on Unix
Do a load if necessary.
Copy the output file (.o) back into Cedar.
There are a number of switches to indicate what you want done:
Switches
-in CFile is the source C file
-out OFile is the output O file. If not given the name is derived from the source file by adding extension ".o". Filenames are "shortnames" possibly extended with a directory part (also see -binDir below).
-class machineClass is the machine class. The default is mc68020. Other valid values would be SPARC and SPARC4.0. [For some reason (Cedar) Rsh does not work on lyrane, so currenlty this is not working]. If the machine class is not provided in the invocation, it is the value of ComplexCC.MachineClass on the user's profile, or mc68020 if none exists.
-host machineName is the name of a machine. If not given, ComplexCc will look in the users profile to get a list of machine names in the entry ComplexCc.FOO where FOO is the machine class. Then ComplexCc.MaxProcesses will be consulted. Finally the machine with the largest slack (MaxProcAllowed - CurProc) will be selected.
-cSwitch string is the string of switches to be given to C compile. In MakeDo it is "-c -g".
-lSwitch string is the string of switches to be givne to the load. In MakeDo it is "-r".
-load file1 file2 ..., indicates that (1) a load is desired, and (2) that the output of the C compile will be load with file1 ,..., fileN which will be shipped to the Unix machine; the file names must not be absolute and are interpreted relative to the directory that the output is going into. -load with no files names means do a load. This is needed by the cedarBoot loader. THIS OPTION IS OBSOLETE; -rload SHOULD BE USED INSTEAD.
-rload file1 file2 ..., indicates that (1) a load is desired, and (2) that the output of the C compile will be load with file1 ,..., fileN which will be shipped to the Unix machine; the file names must not be absolute and are interpreted relative to the current working directory. -rload with no files names means do a load. This is needed by the cedarBoot loader.
-lib string is a string with the libraries to load. The libraries are given at the end of the load command, which is what you normally want.
-int file1 ... fileN indicates that files file1 ... fileN are needed for the compilation process. These files are shipped to UNIX at the beginning of the command. Typically they are .h files.
-srcDir dir is the remote directory to be used to store the sources. dir should be a relative path. The default is ".". It is relativized to the working directory obtained from the user profile entry ComplexCc.UnixWorkingDir.
-binDir dir is the remote directory to be used to store object files. dir should be a relative path. The default is ".", and is also relative to ComplexCc.UnixWorkingDir. If there is a directory part in the filename given explicitly in the -out argument, it is used relative to the binDir; a typical -out filename is "sun3>foo.o" which indicates that binary files will be stored in the directory UnixWorkingDir/binDir/sun3.
User Profile
The following profile entries are significant to ComplexCc
ComplexCc.EncodeIt is the Unix command that will encode the RSH execution. Default is /usr/local/bin/EncodeIt.
ComplexCc.CC is the path to the C compiler to use. Default is /usr/local/bin/ccc.
ComplexCc.MachineClass is the default machine class to use.
ComplexCc.foo, where foo is a machine class, is the list of known machines of that class.
ComplexCc.MaxProcesses is a rope of the form "mach1 max1 mach2 max2 ... machN maxN" where maxI is the maximum number of processes allowed in machI. machI can also be the distinguished name "default" indicating the default maximum value. The default value is "default 3".
ComplexCc.SrcDir and ComplexCc.BinDir are the default directories to use for the -srcDir and -binDir flags.
ComplexCc.Verbose requests additional information on the progress of ComplexCc. Default is FALSE.
ComplexCc.UnixWorkingDir is a rope of the form "/palain-nfs/palain/pelegri" indicating the remote root directory to be used by ComplexCc. The server part ("/palain-nfs") is used by UnixRemoteFile to determine a file server. SrcDir and BinDir are relative to the path name in UnixWorkingDir ("/palain/pelegri").
Examples of User Profiles
The following are typical usages:
ComplexCc.UnixWorkingDir: "/palain-nfs/palain/chauser/"
Source and binary files will be placed in "/palain/chauser/". Object files with subdirectory part sun3, and sun4, will be sent to "/palain/chauser/sun3" and "/palain/chauser/sun4" respectively.
ComplexCc.UnixWorkingDir: "/palain-nfs/palain/hagmann/"
ComplexCc.BinDir: "mimosa/"
ComplexCc.SrcDir: "mimosa/"
Source and binary files will be placed in "/palain/hagmann/mimosa/". Object files with subdirectory part sun3, and sun4, will be sent to "/palain/hagmann/mimosa/sun3" and "/palain/hagmann/mimosa/sun4" respectively.
ComplexCc.UnixWorkingDir: "/palain-nfs/palain/hagmann/mimosa/"
Equivalent to the one above.
ComplexCc.UnixWorkingDir: "/palain-nfs/palain/plass/"
ComplexCc.SrcDir: "pcedar/"
Source files will be placed in "/palain/plass/pcedar/". Object files with subdirectory part sun3, and sun4, will be sent to "/palain/plass/sun3" and "/palain/plass/sun4" respectively. Object files without any such subdirectory part will be sent to "/palain/plass/".
ComplexRsh
ComplexRsh is similar to ComplexCc except that it is intended to bundle up general c-shell commands. The switches are similar to ComplexCc but slightly different.
The general paradigm is:
Make sure all the useful files are on the Unix machine
Do an csh on Unix
Copy the output files back into Cedar.
There are a number of switches to indicate what you want done:
Switches
-srcIn File1 ... Filen are the files to be insured exist on Unix. These are source files (i.e. 012's should be used)
-binIn File1 ... Filen are as before but these are binary files (i.e. no translation).
-srcOut File1 ... Filen are the files to retrieve from Unix. Source files.
-binOut File1 ... Filen as above, but binary files.
-class machineClass as in ComplexCc.
-host machineName as in ComplexCc.
-srcDir dir is the remote directory to which files will be shipped. dir should be a relative path. The default is ".". It is relativized to the working directory obtained from the user profile entry ComplexCc.UnixWorkingDir. There is no binary directory. the meaning of -srcDir is likely to change in the next few days (Feb 1, 89); in the meantime, don't use it -epll.
-cmd Command is the command to execute remotely. The command is executed in the remote directory specified via -srcDir and ComplexCc.UnixWorkingDir.
User Profile
The following profile entries are significant to ComplexRsh
ComplexRsh.EncodeIt, ComplexCc.MachineClass, ComplexCc.foo (where foo is a machine class), ComplexCc.MaxProcesses, ComplexCc.SrcDir, ComplexCc.Verbose, ComplexCc.UnixWorkingDir. ComplexRsh.EncodeIt is the encoder used for ComplexRsh. See ComplexCc for additional information on the other entries.
CcStatus
CcStatus lists all the remote hosts known to ComplexCc together with the current and maximum number of processes on them.
CcReset
CcReset restores the database of known machines according to the user's profile and sets all the current number of processes to zero.
Cc
Cc fileName is a command file for:
ComplexCC -host tregonsee -in $1.c -out $1.o -cSwitch "-c -g" -load -lSwitch "-r"
CcPut
CcPut fileName transfers the file fileName from Cedar to the Unix side, using the same conventions used by ComplexCc (i.e. to the source directory indicated by the profile entries).
cRcopy
cRcopy is intended as an alternative to the bridge RCopy command. cRcopy [-b] fromHost:fromFile toHost:toFile transfers the file fromFile in fromHost to the file toFile in toHost; no conversions are performed if (1) -b (binary transfer) is indicated, (2) the file is brought into Cedar, or (3) the file sent to Unix already has LFs in it, otherwise, CRs are replaced by LFs. "cedar" (the default) as a host name indicates the local cedar machine, and must be one of fromHost and toHost, while anything else is understood as a Unix host, in the same manner as done by ComplexCc. Unix paths are relative to ComplexCc.UnixWorkingDir unless the -x switch is indicated, in which case the remote file is relative to ComplexCc.UnixWorkingDir modified by ComplexCc.SrcDir.
StampCc
It adds a viewer button that will place a C string containing a c←stamp time stamp. This is a temporary solution and should be improved, but it is better than nothing.
DeleteIfEmpty
DeleteIfEmpty fileName deletes fileName if it has 0 bytes.
2. BUGS
The compile server should also use load information.
3. Example profile entries
ComplexCc.MachineClass: SPARC
ComplexCc.mc68020: velantia arisia
ComplexCc.SPARC: Clarissa Kimball
ComplexCc.SPARC4.0: lyrane
ComplexCc.MaxProcesses: "
lyrane 3
worsel 0
velantia 3
arisia 3
kimball 3
clarissa 0
default 3
"
ComplexCc.UnixWorkingDir: "/palain-nfs/palain/chauser/"
ComplexCc.BinDir: ComplexCc-bin/
ComplexCc.SrcDir: ComplexCc-src/