cpl info <keyword>brings you help about the given CPL keyword. A CPL source file is a list of statements, and references other files through
USEstatements. Consistency is enforced. Compilation is achieved under most circumstances by the single command
cpl make <file>. If the curl command is available (on Debian,
apt install curl), cpl also checks for updates. The interactive CPL interpreter (if installed) accepts any CPL expression, statement or system command for immediate execution, either on the command line or in a full-screen editor (F1 key, or
edit <file>). Type
cplin a terminal to try it, and copy the
cpl.desktopshortcut to your Desktop.
apt install curl) and the network is available. This transparent background check at most takes place once a day, and only while cpl is being run. If a new version is found, you are offered to upgrade to it. In case the answer is
no, you won't be asked again and you will have to download the update manually from the CPLcode.net website. If the answer is
later(or any other key), you will be prompted again on the next day. This functionality can be permanently disabled, if undesired, by editing the cpl script and turning ENABLE_UPDATES to
/usr/local/fri/cpldo work, this is likely to be a PATH problem. cpl setup makes commands available to the unix shell by placing symbolic links in either $HOME/bin or /usr/local/bin. Please check that these links have been created and are within reach of your PATH. If you have to modify the PATH manually, you may find it easier to put
/usr/local/frithere. Please see your shell's instructions (man sh) for how to modify the PATH environment variable.
./Helloworld2) modify your PATH environment variable (look up instructions for your shell) 3) use cpl as your shell (either
cpl Helloworldor just
#!/usr/bin/env cplat the top of your CPL source file, and thus make it executable under the unix interpreter convention.
sh /tmp/unpack-cpl.sh -Dnofenv. If you just want to ignore floating-point errors for the scope of a single program,
cpl make <myprogram> -Dnofenv.
USE rtchecksnear the beginning of your main program file during development. rtchecks transparently adds a number of runtime checks and error messages at the expense of execution speed. You will remove it once your program is debugged.
interactive CPLicon from wherever your
fridirectory is (typically, /usr/local/fri or $HOME/fri) to your Desktop.
curlcommand is installed (on Debian,
apt install curl) and that you have write access to the parent of the fri/ directory. In case you would rather disable this feature, edit the
cplscript and turn ENABLE_UPDATES from
cplcommand there. Non-Linux ssh clients are ok too. All special and arrow keys have alphabetic equivalents for the case they may be missing or hard to combine on your keyboard. In a pinch, you can even log in from your smartphone using ConnectBot or similar.
editpops up a different editor
editcommand is used as an alias by more than one editor, including vim and other vi derivatives. You can always access the cpl editor by its unaliased name
cpl edit(with a space), or as
editwithin interactive cpl, or you can modify your PATH so the
editlink to cpl takes precedence.
editused to pop up a different editor
editpop up a different editor is your preferred behaviour, just delete the bin/edit symbolic link. You will still be able to access the cpl editor as
_and can be of any length. Upper and lower case are considered distinct. The first character of an identifier must be non-numeric. Separators can be spaces, tabs or comments (Comments) in any number and sequence; at least one separator is required between contiguous words that could otherwise be mistaken for a single identifier. Indenting is advised, to highlight statement blocks, but not enforced. Statements within a block are delimited by either newline or
;, which allows for multi-statement lines without requiring (but permitting) a
;when the statement ends at the end of a line. Multi-line statements can be broken wherever the statement is incomplete: if the given line does not make sense as is, the compiler will automatically treat newline as a separator and try to complete the statement on the next line. Continuation can also be explicitly requested wherever a separator is allowed by putting a
\as the last character before newline. Round, square and curly bracket pairs can be used interchangeably wherever a parenthesis is needed, in either declarations, statements or expressions. (see Parentheses) Subroutine and function declarations (see Functions) are on the same footing as all other VARIABLE, CONSTANT and TYPE declarations. Contrary to many other languages, declarations (Declarations) and executable statements (Statements) may be freely intermixed in the program flow. The scope of a declaration extends from the position where the declaration appears down to the end of the containing block. It is recommended that declarations appear as close as possible to the position where the declared item is used for the first time, as this enables the compiler to catch a larger number of errors automatically. In most situations, a variable can be declared and initialized in a single statement. CPL has Coactive Parameter Lists, meaning that the type definition of a function's parameter list coacts with its name in identifying the function or subroutine. In other words, functions of the same name and different parameter types are allowed and considered distinct by the language. In addition, not just commas but any non-ambiguous single characters or character sequences may be used as parameter separators in function calls, and equally cooperate in disambiguating the function (see Coactive Parameter Lists). Whereas commas will still be the commonest choice for short parameter lists, a remindful choice of separators can make long parameter lists both more understandable and more thoroughly checked by the compiler. Parameters can also be OPTIONAL, and be specified by name rather than by position. Loops and all other flow control statements (Control) implicitly define new blocks within them, just as subroutine declarations do. A block can also be explicitly delimited as a MODULE. A block can contain every declaration that the outermost block can, including further subroutines and modules, but the declared items cease to exist on exit from the block.
.cplis automatically appended if <filename> contains no dot. In addition, the directory of the USEd file becomes the present working directory for other references nested in it. The USEd file is logically treated as if it were inserted in the program sequence in place of the
USEstatement, i.e. just as if INCLUDE were in place. However, in reality the file is either compiled into a separate object file or, if a more recent object file of the same name already exists, not compiled at all. In the latter case the CPL compiler reads the outermost block only from the USEd source file and skips the inner block contents altogether, producing the same effect as a Modula-2 definition file or a C header file. In case actual headers must be generated in order to save space (or to distribute a library without source code) it is possible to USE a source file with empty subroutine bodies, since the compiler would not read the subroutine bodies anyway, provided the object file is artificially given a more recent date (for instance, through manpages.debian.org/touch.html). Missing this, empty subroutines will be recompiled with obviously unwanted results. In an interpreted program (cpl i) just as well, USE loads a separately compiled module, whose subroutines can then be executed at compiled speed, and executes its main body, if any, before passing control back to the console.
file[link options] or #include <file> [link options] in addition to being copied into the generated C code has a special meaning.
fileis expected to contain a C header or program, which is scanned for declarations by the CPL compiler. The declarations and prototypes contained in the C file thus become transparently available to the including CPL program. An include directory path (similar to the
-IC compiler directive) can be specified with #includedir
pathThe name of the corresponding object file or other linking options that need to be transmitted to the loader can follow (unquoted) the filename on the same line, or alternately be given in a separate #link link options directive. A C code excerpt may also appear embedded in the CPL source file in the form of a C SECTION. A few common libc headers, namely unistd.h stdlib.h stdio.h fcntl.h math.h limits.h float.h string.h time.h setjmp.h errno.h signal.h are pre-included in all CPL programs and need not (but may) be included again.
∗>as: <∗ C code ∗> In this case, anything that appears between
∗>is copied verbatim in the generated C code without any intervention of the CPL compiler. It is up to the programmer to ensure that the resulting code makes sense, so this construction should only be used as a last resort.
linking optionstogether with any other linking options required (e.g., -lg2c to provide the FORTRAN run time library, if g77 was used as the FORTRAN compiler).
->following the parameter declaration: FUNCTION name( <parameter declarations> )-><type> <block> END name When this syntax is used, the result type may be, or contain, an ARRAY type with dimensions depending on the formal parameters themselves (see array parameters). Any formal parameter as well may depend on the formal parameters that precede it. For example: FUNCTION transformarray[ARRAY(∗) OF REAL v]->ARRAY(v.LO..v.HI) OF REAL . Within a function's body, a variable named RESULT is implicitly declared with the type of the function's result, and can be used just as any other local variable of that type within the body of the function; the function returns the value of the variable RESULT at the time of exit. All primitive and compound types are allowed for the result of a function. The statement RETURN <value> is a shorthand for RESULT=<value>; EXIT name. The keyword FUNCTION is also used to declare variables of Subroutine type. The statement RETURN is also used in interactive session.
compile-time constant, that is an expression whose value can be known at compile time, but more generally a value which cannot appear on the left side of an assignment or have its address assigned to a POINTER. The value of the CONSTANT is usually specified in the declaration itself but occasionally later. When this happens the constant declaration takes the role of a constant prototype, and may be optionally followed by the keyword FOLLOWS. (For instance, a constant may be declared outside a MODULE, but its value only be known inside the module itself; or the value may be READ as input.) If the constant is not initialized in the declaration itself, it is understood that it will be assigned once only in the course of its block. In alternative, a statement of the form newid = value implicitly declares a CONSTANT whose type and value are the type and value of the r.h.s. (see, however, CONSTANT:Concealed Pointer Lookup. if the address of the r.h.s. is desired instead). If the r.h.s. of a CONSTANT declaration is known at compile time (what is denoted as a compile-time constant), the new identifier becomes just an alias for it and no storage is assigned. This also applies to STRINGs. An alias for any expression, even one which does not represent a compile-time constant, can always be defined through the statement newid == expression (see Delayed assignment). Subroutine formal parameters are by default CONSTANT, with the actual parameter as their value, and must be explicitly declared VARIABLE if they are to be reassigned within the subroutine's body.
int. (see Declarations) BOOLEAN values are denoted as YES or TRUE and NO or FALSE, and written as
N. On reading any complete word starting with
yis read as YES, any word starting with
char. (see Declarations) Where needed, a single-character STRING literal is implicitly converted to a CHAR constant, which is in turn implicitly converted to an INTEGER ASCII code. INTEGER to CHAR conversion must be explicit (see CHAR:Builtin).
int. Can be implicitly converted to REAL. REAL to INTEGER conversion must be explicit (see INTEGER:Builtin). See also INTEGER operator.
double. See also REAL operator, REAL:Builtin, REAL:(complex).
float. Can be implicitly converted to REAL. REAL to SINGLE conversion must be explicit (see SINGLE:Builtin).
afield. Anonymous structure fields are CPL's way to define objects that inherit the structure of other more general objects and add their own specific fields. When these objects are accessed as arguments to functions or subroutines, the appropriate function among those with the same name and different arguments is automatically selected. See also Coactive Parameter Lists, DYNAMIC.
, newline and null. In addition, C escape sequences are literals, but contrary to C must be placed outside quotes. Acharacter or a newline can be included in a literal as a concatenated escape sequence outside quotes. As an additional bash-like notation, multi-line literals containing quote characters and newlines may alternatively be introduced by <<DELIMITER and ended by DELIMITER alone on a new line, where DELIMITER can be any word that is not to be part of the literal itself. The null character is used for termination and cannot appear anywhere inside a STRING. The empty string is also a valid (zero-character-long) STRING value. Where appropriate, a single-byte literal is implicitly converted to a CHAR constant, which is in turn implicitly converted to an INTEGER ASCII code. Strings may also be concatenated among themselves and with variables, see conversion:String. Standard C functions returning a char∗ (manpages.debian.org/string) are also interpreted as producing a STRING value. Just as for all C library functions, it is the programmer's responsibility to ensure that such functions are used consistently and to free any malloc-ated space where appropriate. As an experimental feature, and an exception to the general rule for ARRAY(∗), STRING VARIABLEs may also be declared and assigned a value. Memory space for such strings is automatically allocated and freed without the programmer's intervention.
Vectortype with fields x,y,z and then perform vector operations on variables of this type.
dynamic pointers, pointers that can reference and provide type checking for objects whose type will only be known at run time. These are declared by the type declarator DYNAMIC POINTER A function call in which such a pointer appears is transparently switched at run time to the function defined for the type of the actual parameters, or an error is thrown if no such function exists. Pointers to variables of any but ARRAY(∗) and STORED type can be assigned to a DYNAMIC POINTER. If the scope of assignment is to be restricted, the declaration becomes DYNAMIC POINTER TO <type declarator> In this case only types which can be implicitly converted to <type declarator> are acceptable for the variable pointed to. The actual type a dynamic pointer points to can be tested by the IS operator.
/is reserved for REALs, and produces a REAL result even when the operands are INTEGERs. MOD is the
moduloinfix operator. If a and b are INTEGERs, a MOD b represents the remainder of the integer division of a by b. Notice on the truncation of integer division: CPL requires that a MOD b must always be a positive number, regardless of the sign of a/b. This is so that modular arithmetics can be applied to negative as well as to positive numbers, for example in array index manipulations. Since b∗(a DIV b) + a MOD b = a, consistently a DIV b must be rounded towards minus infinity, or a DIV b = FLOOR(a/b). Care should be taken when porting programs from languages that truncate negative division, such as FORTRAN or C. Operators following the C convention of truncating integer division and signed modulo are available, if needed, as CDIV and CMOD respectively.
viewof the same array (as opposed to V(∗,∗,∗,∗) which represents its original arrangement). By the same token V(∗,∗∗,∗) is the three-dimensional array obtained by compounding the two central indices into one. Bounds of a compound index can be retrieved by the LO. and HI. functions as usual. Compound indices are restricted to arrays (or portions of them) that are contiguous in memory. This generally precludes their use after subarray operations that permute, stride, or restrict the range of indices.
0(but not any other constant) can be assigned as a value to a whole array. Some Builtin functions operate on whole arrays. A larger set of vector and matrix algebra operations are supported by the rbmat:(matrix). and cbmat:(matrix). libraries. Matrix transposition is provided as the TRANSPOSED:subarray. operation. All ARRAY operations can also be applied to STORED ARRAYs and STRUCTURED ARRAYs.
$character, the Einstein convention is implied. In a contraction or in a product the Einstein index must appear exactly twice, and the result will be summed over ALL values of this index; in a sum or in an assignment, Einstein indices must appear exactly once in each and all terms including the l.h.s., and the assignment will be repeated over ALL values of these indices. For example: C($i,$j)=A($i,$j,$m)∗B($i,$m,$j)+D($j,$i) Footnote: the euro symbol would have been appropriate to match the
eof Einstein, but it is not part of the 7-bit ascii codes so we replaced it by a currency that is (the $).
=sign. The l.h.s. must be a POINTER, and the r.h.s. is required to be a value of the TYPE pointed to or to be implicitly convertible to it (see Concealed Pointer Lookup). Compound variables can be assigned as a whole if types match. Owing to their all-encompassing role, assignment and equality/inequality tests are the only situations in which pointer dereferencing must be explicit. The left side of an assignment will never be implicitly dereferenced, and must be dereferenced by a postfix
^if assignment of the value pointed to is desired. For increased clarity, the type of the object to be assigned may also be specified, as in the example (after the declaration REAL a^,b): REAL a=b equivalent to a^=b. At any position in the expression appearing on the right-hand side of an assignment the symbol ~ can be used as a placeholder for the left hand. For example: counter = ~ + 2 listelement = ~.next A(i,j,k) = 3 ∗ LOG(~) + gamma(~)
==sign, no statement is generated in place. The l.h.s. is instead defined to be an alias for the r.h.s., and the assignment will be performed (and error messages issued, if any) at the location where this alias is first used. Deferred assignment permits the appearance on the r.h.s. of yet undefined variables and functions, provided these will be defined before the l.h.s. is actually used. It also allows compile-time constants to be given symbolic names and still be recognized as such. This construction is further extended in the (symbolic)Top library.
TO <file>is omitted, stdout is implied. If <file> is present,
WRITE TOmay be omitted. <outputexpr> can be <value>[:<format>] or
,. <value> can be of any type except a POINTER (which if present undergoes Concealed Pointer Lookup). Compound types such as ARRAY and STRUCTURE are printed in a standard format which is understandable to READ. (If STRUCTURE elements are POINTERs, however, they are printed as the string
POINTERand cannot be read back.) If a SUBROUTINE named WRITE is defined with first argument of type FILE and second argument of a user-defined TYPE, it is used to print variables of such type. Primitive types are printed in a default format, unless the numeric part of a C format specifier is included after a colon. The default format is initially the C library's default, but may be changed (down to the end of the enclosing scope) by the declaration DEFAULTFORMAT, e.g. DEFAULTFORMAT 1.15 A
,in the sequence of <outputexpr>'s is printed as a tab. <outputexpr>'s may also be written one after the other without any comma, in which case they are just adjoined without any intervening space. Please pay attention that a numeric parenthesis that immediately follows a string will be interpreted as an ARRAY subscript, since the STRING is a legitimate ARRAY OF CHAR, unless space is placed between the string and the parenthesis. By default WRITE prints a newline at the end of its sequence of <outputexpr>'s. The optional symbol ./. suppresses this newline and FLUSHes the output instead. WRITE with no <outputexpr> and no ./. prints just a newline. If the optional BY NAME qualification is present, WRITE prepends each value with the expression from which it is produced, in the form name=value. If the expression is a single identifier, this format can be read back by the statement READ BY NAME. WRITE syntax may also be used to convert any expression into a string. See Stringconversion.
FROM <file>is omitted, stdin is assumed. <variable> must be a VARIABLE identifier or a POINTER to a variable, which can be of any type except a POINTER. Compound types such as ARRAY and STRUCTURE are also accepted; they are expected to appear in the same format as produced by WRITE <variable> can also be a literal STRING, which is then expected to appear verbatim in the input file. If <variable> is an ARRAY OF CHAR, characters are read until the array is full or a newline appears. In all other cases, blanks, tabs and newlines are automatically skipped. Lines starting with
!are considered as comments and skipped. <conjunction> can be
,AND or OR. If
,or AND is used, the joined variables must both be compulsorily present in the input or an I/O error results. If the conjunction is OR, only one or the other is expected to be present and the READ statement succeeds and yields control as soon as one is found. READ with no variable is also allowed and just blocks until a newline is received, skipping any other characters that precede it. This statement can be used to skip lines in a file or to create a pause in execution until a newline appears in stdin. READ may also appear as a function in a BOOLEAN expression, and should then be pronounced as the past participle of the verb
to read. In this form READ is construed just as above, but returns a BOOLEAN value saying whether reading was successful or not and never generates an I/O error. If the optional BY NAME qualifier is present, READ expects to find the value of each variable preceded by its name in the input file in the form name=value.
literal:] <variable> [, [
literal:] <variable>] has the effect that a prompt is automatically written to stderr for each variable and the value of the variable is subsequently read from stdin. The prompt is the optional
literalif present or the name of the variable followed by a
?otherwise. Console prompting can be compounded with CONSTANT declaration. If <type> is present, each variable is declared as a CONSTANT before being asked. Under cpl i, this console input functionality becomes extended: a cpl shell is opened whenever the program is waiting for input from its controlling terminal, and any number of CPL commands can be executed interactively before answering. The first expression given alone on the command line, which cpl would normally print, gets returned as input instead, and the waiting program resumes. This extension is available to either an interpreted or a compiled program, provided the latter is run under interactive cpl.
opensystem function with options O_RDWR|O_CREAT. For finer control over options, the
fopenfunction may be called directly, just as all other libc functions (see C interface).
opensystem function with options O_RDWR|O_CREAT|O_TRUNC. For finer control over options, the
fopenfunction may be called directly, just as all other libc functions (see C interface).
DOWN TOis implied. Therefore FOR <index> = <ubound> TO <lbound> BY -1 and FOR <index> = <ubound> DOWN TO <lbound> are actually equivalent. Both INTEGER and REAL types are allowed, as well as other types (for instance POINTER:INTO:) for which increment and comparison make sense. <index> may be an already existing variable or be implicitly declared by the loop itself (see Declarations). In the latter case it acquires the type of the loop bounds and behaves like a CONSTANT within the body of the loop. If the index is REAL, the BY specification cannot be omitted. FOR clauses can appear in a LOOP, DO and Looping operator. In addition to the two basic forms, they can have the following variants:
,<condition>] The EXCEPT qualifier added to any of the FOR loop constructions excludes exceptional values of the index from the iteration. <condition> may be either an expression of BOOLEAN type, meaning that the loop is skipped when the <condition> is TRUE, or an expression of the same type as the index, meaning that the given value is excluded.
states) to be executed in an a priori unknown sequence where each block decides its immediate follower. For such needs CPL provides a multiple-choice loop. A multiple-choice loop is a hybrid between a CASE and a LOOP, specified as CASE LOOP OF label1: <block> REPEAT <label> label2: <block> REPEAT <label> .............. labeln: <block> REPEAT <label> END CASE At the end of each labelled block (or nested in its interior, typically within an IF or CASE statement), execution may continue at any other label as specified by the REPEAT statement. Each labelled block is its own scope, and local variables cease to exist at the REPEAT (like at an EXIT) statement (but variables of an outer, enclosing scope are, as always, shared). If the end of a block is reached without an intervening REPEAT statement, the CASE LOOP ends. While this construct may look like unstructured code allowing an arbitrary goto (and is in fact implemented using one), it maintains statements and labels in the same order as, and is thus no less or more structured than, a CASE inside a LOOP: ENUM(label1,label2,...labeln,exit) repeat=label1 LOOP next=repeat; repeat=exit CASE next OF label1: <block> repeat=<label> label2: <block> repeat=<label> .............. labeln: <block> repeat=<label> END CASE REPEAT WHILE repeat#exit In particular notice that jumping to the inside of a labelled block, as opposed to its beginning, is not allowed. The two constructs above are functionally equivalent, but the first is more efficient and easier to write and read.
cplm) is all that is needed to compile and link the source file <program>.cpl into the executable file <program> , which you can then run by its name just like any other executable. As an alternative, the straight cpl run command compiles and then runs <program> in one shot. cpl's task is achieved by first running the CPL-to-C compiler cpl.fri, which compiles the given source and all other files USEd by it into corresponding C programs, and simultaneously lists all of the generated files and any needed pre-existing objects in the makefile <program>.d, and then running make (manpages.debian.org/make.html) on this makefile. Any arguments possibly present on the command line are passed on as options to the designated C compiler and linker, or to <program> itself if
runwas specified. The default C compiler is make's default; an alternate C compiler can be specified in the CC environment variable or as CC= on the command line. The -D and -I compiler options are interpreted by cpl.fri itself, in addition to being passed on to the C compiler, and provide pre#defined constants and include directories to both. C source and object files are kept in a local subdirectory usually named .cpl (and therefore hidden from listing under unix convention). An alternate name for this directory can be specified through the environment variable OBJDIR or the -o option. Only those source files whose corresponding object file does not exist or is older than the source are actually recompiled. In exceptional cases where a full re-compilation may be necessary, the command cpl remake <program> achieves this by deleting the object files first. cpl followed by an unrecognized word (e.g. version|usage|help) prints a short version and usage message and exits. If your system includes the curl command (on Debian you can install it as
apt install curl), cpl provides the functionality to transparently poll the CPLcode.net website for updates. See automatic updates.
cplif no confusion arises) compiles and runs <program> in one shot, or just runs it without re-compiling if an executable is found that is not older than its source code. <argument>'s are passed to <program> itself.
#!/full/path/to/cpl run(with the appropriate full path) or
#!/usr/bin/env cplas its first line is directly executable, while maintaining its compiled form. Under the hood it undergoes automatic recompilation if and when modified.
#!/usr/bin/env frias its first line. Where this convention is understood, the CPL-to-C compilation command is cpl.fri <source.cpl> On systems where the #! convention does not work as expected, this command must be expanded into fri cpl.fri <source.cpl> All this is normally handled inside the cpl driver script; direct use of the cpl.fri command is not needed.
cpl info. Typing
cpl infowith no arguments takes you to the head of the file you are now reading. Typing
cpl info <keyword>brings you help about a specific CPL keyword.
cplwhen there are no arguments). Interactive cpl's syntax is totally compatible with CPL's. Any valid CPL statement is executable at the cpl> prompt. As an extension, when an expression is typed alone at the cpl> prompt a WRITE statement is implied, thus e.g.
2+2is equivalent to
WRITE 2+2and outputs
4. In addition when a command is not recognized, it gets passed to the unix shell before giving up. A shell command can also be given explicitly by prefixing it with
?brings this manual to you.
.cplextension, this source file is automatically compiled as necessary (if it is more recent than its executable), and then executed at compiled speed but with interpreted commands available. If the name of a CPL file is given as a command with the
.cplextension included, it is loaded and executed in the interpreter as when it appears in an INCLUDE statement. Exploiting the unix interpreter convention, a CPL source program can be made directly executable by writing
#!/usr/bin/env cplas its first line and turning on the executable permission flag. (see (bash)Shell Scripts) The cpl command with no arguments launches an interactive cpl session.
cpl ifollowed by a CPL expression (possibly quoted to avoid interpretation by the shell) calculates and prints that expression.
cpl ifollowed by one or more CPL statements executes those statements and exits; however if a
-precedes the list of statements, after executing those statements an interactive session is opened. For instance, a chosen set of libraries can be loaded by default in an interactive session, if desired, by defining an alias for
cpl i -USE <libraries>.
cplwith no arguments is equivalent to
cpl i -USE rbmat,cbmat,gnuplot,rtchecks. When the input of cpl i is redirected (or piped) from an alternate source, commands from that source are interpreted on a line-by-line basis.
>in the command prompt, and can accept any interactive cpl command. Exiting this inner session with
quitresumes the suspended program, as also does pressing Enter alone on an empty line. The new commands kill or stop kill the interrupted program and return to the session where it was invoked.
cpl i <program>). V,v: view. Open a vi window at the present line in the source code, which can be explored using all vi commands. Tracing resumes on exit. (vi command :q) <space>,S,s: single step. Advance by a single instruction through the code. <tab>,F,f: finish. Finish the current block and resume tracing from the next instruction of the enclosing block. Any other key displays a single-line reminder of the above.
cpl make <program> -fopenmp. Notes: 1) If the parallel version is compiled without the -fopenmp option, #pragma is treated as a comment, that is you obtain the serial version of the program. This is intentional and conforming to C behaviour. 2) C compiler options, of which -fopenmp is one, must appear after <program> in order to be distinguished from cpl options (see cpl). 3) The
omp fordirective can only be applied to a basic
LOOP FORconstruction (see LOOP:FOR.), which gets translated to
forin the intermediate C code. Other types of LOOP or DO do not involve a
forand are not recognized by OpenMP. 4) If an
omp paralleldirective needs to be applied to a block of code that is not implicitly delimited by the subsequent instruction, this block can be delimited by
MODULE ... END MODULE(see MODULE).