Skip to content

Commit

Permalink
doc: explain how to run stringspinner (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Jun 4, 2024
1 parent 5fa658d commit 0feac45
Showing 1 changed file with 32 additions and 13 deletions.
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,53 @@
- [fmt](https://fmt.dev/)
- [meson](https://mesonbuild.com/)
- [ninja](https://ninja-build.org/)

StringSpinner is included as a `git` submodule.
- [StringSpinner](https://gitlab.com/albikerbizi/stringspinner) is already included as a `git` submodule

## Building

Build using `meson`. For example, let
- `$source_dir` be the `clas-stringspinner` source code directory (contains this `README.md`)
- `$build_dir` be the build directory
- `$install_dir` be the installation destination, which must be an absolute path
- `$source_dir` be this `clas-stringspinner` source code directory (contains this `README.md`)
- `$build_dir` be the build directory (will be created)
- `$install_dir` be the installation destination, which must be an absolute path (will be created)

Build and install with:
1. Setup the build directory:
```bash
meson setup $build_dir $source_dir --prefix $install_dir
```
2. Set build options (see **Build Options** section below); the defaults should be sufficient for most users, so this step is **optional**.
3. Build and install:
```bash
meson install -C $build_dir
```
4. Test:
```bash
meson test -C $build_dir
```

### Build options

## Build options
In addition to the built-in options, the following table shows the project options:

| Option | Description |
| --- | --- |
| `stringspinner:install_example` | Install the StringSpinner example |
| Option | Description |
| --- | --- |
| `stringspinner:install_example` | Install the [StringSpinner example](https://gitlab.com/albikerbizi/stringspinner/-/blob/master/dis.cc) |

For more details, run:
For more details and current option values, run
```bash
meson configure $build_dir
```

To set a build option named `opt` to value `val`, run:
```bash
meson configure $build_dir -Dopt=val
meson configure $build_dir -D opt=val
```

## Running StringSpinner

The installed binary `stringspinner` is the main executable Monte Carlo generator; assuming you have not changed certain build options, run
```bash
$install_dir/bin/stringspinner --help
```
for the usage guide.

> [!TIP]
> For easier usage, add the installed `$install_dir/bin` directory to your `$PATH`, or make a symbolic link pointing to the `stringspinner` executable.

0 comments on commit 0feac45

Please sign in to comment.