Skip to content

Configuration

Matt Windsor edited this page Apr 24, 2019 · 5 revisions

act needs some configuration to work properly. It looks for a config file called act.conf in the current working directory (or, if you provide -config FILENAME, that path instead). This page describes that file.

Note: each act subcommand also takes various command-line arguments; see each subcommand's documentation, and the standard flags, for details.

The example file

act's source distribution contains a documented example file at bin/act.conf.example.

General syntax

  • The configuration file consists of multiple items, each of which is either a line of configuration or a brace-delimited, named block.
  • Each configuration line consists of a run of multiple keywords and arguments (the exact syntax depends on the line, but usually starts with one or more keywords). Arguments, at time of writing, can be identifiers (dot-separated, mostly-alphanumeric unquoted strings) or string literals (double-quoted).
  • # is the comment character, and discards up to the end of the line.
  • Lines containing only whitespace/comments are ignored.

Blocks

Main configuration

machine: set up a machine

The machine ID { ... } block tells act about a machine on which it can run compilers.

See machine configuration for more details.

Example
machine example {
  enabled off
  via ssh {
    host "example.com"
    user "johndoe"
    copy to "/home/johndoe/actscratch"
  }

  litmus {
    enabled on
    cmd "/usr/local/bin/litmus7"
  }
}

compiler: set up a compiler

The compiler ID { ... } block tells act about a compiler it can use. act uses compiler blocks both for running compiler tests, and also to compile single files in other modes.

See compiler configuration for more details.

Example
compiler gcc.x86 {
  enabled on
  style gcc
  emits x86.att
  cmd "gcc"
  argv "-m32" "-DNO_PTHREADS"
  herd on
  machine default
}

fuzz: configure fuzzer weightings

The fuzz { ... } block permits overriding act's fuzzer action weightings.

See fuzzer configuration for more details.

Example

fuzz {
  action program.make.empty weight 0
  store.make.int.single weight 1
  var.make.global weight 2
}

Helper programs

cpp: configure the C preprocessor

The cpp { ... } block tells act how to run the C preprocessor. act uses the C preprocessor whenever it needs to read a (non-Litmus) C program.

Example
cpp {
  enabled on
  cmd "cpp"
  argv "-DNO_PTHREADS" "-P" # suppress line directives and memalloy pthread harnesses
}

herd: configure the Herd memory model simulator

The herd { ... } block tells herd how to run the Herd memory model simulator. act uses Herd in test mode to compare C program state sets with their compiled assembly equivalents.

Example
herd {
  cmd "herd7"
  c_model "c11_lahav.cat"
  asm_model x86.att   "x86_example.cat"
  asm_model x86.intel "x86_example.cat"
}

litmus: configure the Litmus memory model investigator

See machine configuration: since litmus checks behaviours by running programs, we associate its configuration with the machine on which the programs should be run.