-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: conform to
clas12-mcgen
requirements (#10)
- Loading branch information
Showing
9 changed files
with
215 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
if [ $# -ne 1 ]; then | ||
echo "USAGE: $0 [EXECUTABLE]" >&2 | ||
exit 1 | ||
fi | ||
|
||
$1 --help |\ | ||
perl -pe 's/(--.*?)([^a-zA-Z-])/<font color="#ff00ff">$1<\/font>$2/g' |\ | ||
perl -pe 's/(^[^\s].*:)/<font color="#ffffff">$1<\/font>/' |\ | ||
sed 's;https://github.com.*;<a href="&">&</a>;g' \ | ||
> tmp_usage | ||
|
||
date > tmp_date | ||
|
||
cat $(dirname $0)/usage.html |\ | ||
sed $'/@usage@/{r tmp_usage\nd}' |\ | ||
sed $'/@date@/{r tmp_date\nd}' | ||
|
||
rm -f tmp_usage tmp_date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<html> | ||
<head> | ||
<title>clas-stringspinner usage guide</title> | ||
<style> | ||
body { | ||
background-color: #002222; | ||
color: #ffffff; | ||
} | ||
a { | ||
color: #00cccc; | ||
} | ||
.sec { | ||
background-color: #330033; | ||
color: #ffffff; | ||
width: 1000px; | ||
padding: 10px; | ||
margin: auto; | ||
border: 5px solid gray; | ||
} | ||
code { | ||
font-family: Consolas,"courier new"; | ||
font-weight: bold; | ||
color: #00dd00; | ||
background-color: #220022; | ||
padding: 2px; | ||
font-size: 105%; | ||
} | ||
.codeblock { | ||
padding: 5px; | ||
width: 980px; | ||
background-color: #220022; | ||
border: 2px solid green | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<center><h1>Running StringSpinner</h1></center> | ||
|
||
<div class="sec"> | ||
<h2>Executable</h2> | ||
The main executable <code>clas-stringspinner</code> is installed in <code>$install_dir/bin</code> (unless you have changed the <code>bindir</code> build option). | ||
See below for the <b>Usage Guide</b>, or run:<br/><br/> | ||
<div class="codeblock"> | ||
<pre><code>$install_dir/bin/clas-stringspinner --help</code></pre> | ||
</div> | ||
<ul> | ||
<li><b>TIP:</b> For easier usage, add the installed <code>$install_dir/bin</code> directory to your <code>$PATH</code></li> | ||
<li><b>NOTE:</b> No environment variables are required to run <code>clas-stringspinner</code></li> | ||
</ul> | ||
</div> | ||
|
||
<br/> | ||
|
||
<div class="sec"> | ||
<h2>Usage Guide</h2> | ||
<div class="codeblock"> | ||
<pre><code> | ||
@usage@ | ||
</code></pre> | ||
</div> | ||
</div> | ||
<center>Last updated: | ||
@date@ | ||
</center> | ||
<br/> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.cache | ||
/install* | ||
*.lund | ||
*.dat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,8 @@ | ||
# clas-stringspinner | ||
[StringSpinner](https://gitlab.com/albikerbizi/stringspinner) wrapper for CLAS | ||
|
||
## Dependencies | ||
|
||
- [Pythia 8](https://pythia.org/) | ||
- [fmt](https://fmt.dev/) | ||
- [meson](https://mesonbuild.com/) | ||
- [ninja](https://ninja-build.org/) | ||
- [StringSpinner](https://gitlab.com/albikerbizi/stringspinner) is already included as a `git` submodule | ||
|
||
## Building | ||
|
||
Build using `meson`. For example, let | ||
- `$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) | ||
|
||
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 | ||
|
||
In addition to the built-in options, the following table shows the project options: | ||
|
||
| Option | Description | | ||
| --- | --- | | ||
| `stringspinner:install_example` | Install the [StringSpinner example](https://gitlab.com/albikerbizi/stringspinner/-/blob/master/dis.cc) | | ||
|
||
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 -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. | ||
| Documentation | | ||
| --- | | ||
| [Setup Guide](/doc/setup.md) | | ||
| [Usage Guide](https://jeffersonlab.github.io/clas-stringspinner) | | ||
| [Configuration Files](/config) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Pythia Configuration Files | ||
|
||
If you add a new file here, re-run `meson install` to install it so that `stringspinner` can find it. | ||
This directory contains configuration files for setting Pythia parameters. | ||
|
||
> [!NOTE] | ||
> If you add a new file here, re-run `meson install` to install it so that `clas-stringspinner` can find it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Setup Guide | ||
|
||
## Dependencies | ||
|
||
- [Pythia 8](https://pythia.org/) | ||
- [fmt](https://fmt.dev/) | ||
- [meson](https://mesonbuild.com/) | ||
- [ninja](https://ninja-build.org/) | ||
- [StringSpinner](https://gitlab.com/albikerbizi/stringspinner) is already included as a `git` submodule | ||
|
||
## Building | ||
|
||
Build using `meson`. For example, let | ||
- `$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) | ||
|
||
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 | ||
|
||
In addition to the built-in options, the following table shows the project options: | ||
|
||
| Option | Description | | ||
| --- | --- | | ||
| `stringspinner:install_example` | Install the [StringSpinner example](https://gitlab.com/albikerbizi/stringspinner/-/blob/master/dis.cc) | | ||
|
||
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 -D opt=val | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.