CLM(1)

NAME
clm - Clean compiler (make)

SYNOPSIS
clm -V clm ---version clm [options] main_module_name [-o application_name]

DESCRIPTION
Makes an application from clean (.icl and .dcl) file(s). The main_module_name should be specified without (.icl) extension.

If '-o application_name' is not used, the name of the application is 'a.out'. (and is stored in the working directory)

CONFIGURATION OPTIONS

-V  print version information and variables.

--version
    print version information.

-I path
    append `path` to the search path.

-P pathlist
    search path is `pathlist`.

MAIN MODULE OPTIONS

-w -nw
    enable/disable warnings. (default: -w)

-d -nd
    enable/disable the generation of readable label names. (default: -nd)

-d -nd
    enable/disable strictness analysis. (default: -sa)

PROJECT OPTIONS

-mv verbose output of the make process.

-ms silent make process.

-O  only generate object (.o) file of main module.

-S  only generate assembly (.s) file of main module.

-ABC
    only generate abc (.abc) file of main module.

-PO only generate object (.o) files of modules in the project.

-PS only generate assembly (.s) files of modules in the project.

-PABC
    only generate abc (.abc) files of modules in the project.

-c  only syntax check main module. (note: compilation only considers the main module)

-lt -nlt
    enable/disable listing only the inferred types. (default -nlt)

-lat -nlat
    enable/disable listing all the types. (default: -nlat)

-lset
    list the types of functions for which not all strictness information has been exported.

-ci -nci
    enable/disable array indices checking. (default: -nci)

-ou -nou
    enable/disable optimizing uniqueness typing. (default: -ou)

-fusion
    enable/disable optimizing by fusion transformation. (default: -nfusion)

-pt -npt
    enable/disable the generation of code for time profiling. (default: -npt)

-pg -npg
    enable/disable the generation of code for callgraph profiling. (default: -npg)

-desc
    generate all descriptors.

-exl
    export local labels.

-dynamics
    enable support for dynamics.

-funcmayfail
    enable the function totality checker.

-warnfuncmayfail
    enable the function totality checker but only emit it as a warning.

LINKER OPTIONS

-ns disable stripping the application.

-no-opt-link
    disable the optimizing linker.

-l object_file
    include the file <object_file>.

-sl file
    include the shared library or linked option file (SEE LINK OPTIONS FILES) <file>.

-e symbol
    export the label name <symbol> for shared libraries.

-E file
    same as -e, but the exported label names are specified in the file <file>, separated by newlines.

COMPILER APPLICATION OPTIONS

-clc file
    Use <file> as the compiler executable.

-aC,option(s)
    pass comma separated <option(s)> to the compiler (e.g. to set the compiler's heap size: -aC,-h,100m).

-RE file
    redirect the compiler stderror to <file>

-RO file
    redirect the compiler stdout to <file> same as -e, but the exported label names are specified in the file <file>,

APPLICATION OPTIONS

-h size
    set the heap size to size in bytes (note: append k, K, m, or M to denote kilobytes or megabytes). (default: 2m)

-s size
    set the stack size to size in bytes (note: append k, K, m, or M to denote kilobytes or megabytes). (default: 512k)

-b -sc
    display the basic values or the constructiors. (default: -sc)

-t -nt
    enable/disable displaying the execution times. (default: -t)

-gc enable/disable displaying the heap size after garbage collection. (default: -ngc)

-st -nst
    enable/disable displaying the stack size before garbage collection. (default: -nst)

-gcm
    use marking/compacting garbage collection.

-gcc
    use copy/compacting garbage collection.

-gcf n
    multiply the heap size with <n> after garbage collection. (default: 20)

-gci size
    set the initial heap size to <size> in bytes (note: append k, K, m, or M to denote kilobytes or megabytes). (default: 100k)

-nortsopts
    disable RTS command line arguments in the generated application

MAKING A PROJECT
Clm makes a project in the following way:

1.  All .icl files in the project which are no longer up to date are compiled. The .icl files in the project are the main module and all modules imported (directly and indirectly) by this module, except system modules. A .icl file is considered not up to date if:

    -   no corresponding .abc file exists for this module.

    -   the .abc file contains parallel code, does not contain stack lay out information or is generated with an other compiler version.

    -   the .abc file is older than a corresponding .icl or .dcl file.

    -   the .icl file is the main module and the .abc file is compiled with different compiler options (except for (not)verbose).

    -   the .abc file is older than any of the .dcl files which are imported by this module.

    If a module has to be compiled the following compiler options are used:

    -   for the main module: the options specified to clm.

    -   for other modules: if a corresponding .abc file exists, the options which were use to generate this .abc file, otherwise the default options. So the compiler options are remembered (in the abc file) after the first successfull compilation. If you want to change the options for such modules, compile the module with -ABC, -S or -O and the required options. Then, if the compilation succeeds, the options are remembered.

2.  Code is generated for all .abc files in the project which are no longer up to date. The .abc files in the project are all .abc files for which a corresponding clean module exists which is the main module, or is imported (directly or indirectly) by the main module. A .abc file is considered not up to date if:

    -   no corresponding .o file exists.

    -   the corresponding .o file is older than the .abc file.

    After generating code for a module, the assembler is called.

3.  An application is build using the linker.

FINDING FILES

Clm searches files in the directories specified by the CLEANPATH environment variable. If the file is not found in any of these directories, it searches the clean library directory, then the working directory. CLEANPATH should contains a list of directories seperated by ':'.

The .abc,.s and .o files are normally generated in the same directory as the directory which contains the .icl file.

But it is possible to generate these files in an other directory by defining the environment variable CLEANABCPATH. clm will then search this directory first for .abc, .s and .o files.

It is also possible to generate .o files in an other directory by defining the environment variable CLEANOPATH. clm will then search .o files first in this directory. If CLEANABCPATH is also defined, it will not search the directory specified by CLEANABCPATH for .o files.

LINK OPTION FILES
Link option files consist of two parts separated by an = sign.

The first section consists of options that are passed on to the linker by clm.

The second section lists all the modules that clm should *not* pass to the linker, because they are already combined in one of the libraries mentioned in the first section. clm does not check if these modules are up-to-date.

The names between parentheses are the modules on which the the first module depends.