# Typical Workflows

Depending on your purpose, there are different workflows that you can follow. For details, see Brett's instruction (opens new window).

# Initialize a project

Pick a new directory for your project:

wcdo.sh init
wcdo.sh wct
wcdo.sh get-image sl7krb
wcdo.sh make-project myproj sl7krb
$ ./wcdo-myproj.sh
1
2
3
4
5

# Setup standalone WCT

The previous step will put you inside the downloaded sl7krb singularity container. We then use the Fermilab UPS (opens new window) tool to configure software dependencies:

source /cvmfs/larsoft.opensciencegrid.org/products/setup
wcdo-ups-init
path-append $wcdo_ups_products PRODUCTS
wcdo-ups-declare wirecell DEVEL
setup wirecell DEVEL -q e17:prof
wcdo-ups-wct-configure-source
./wcb -p --notests install
setup wirecell DEVEL -q e17:prof
wcdo-wirecell-path default
1
2
3
4
5
6
7
8
9

The last two lines are necessary to re-setup the wirecell UPS product to have the correct LD_LIBRARY_PATH and to reset the WIRECELL_PATH. Now test with:

./wcb -p --alltests
1

If tests run, congratulations, you are ready to start real wire-cell development.

TIP

TIP: Place some of the command lines in your wcdo-local-myproj.rc file to execute them automatically when you start the singularity container.

# Run WCT code

The WCT code is run through the main program wire-cell by giving it a configuration file, where all logics and configurations are set (details later).

wire-cell -c path/to/example.jsonnet
1

# Recompile WCT

If you change any core code, you need to recompile WCT using

./wcb
./wcb install
1
2

. You can find out where these WCT libraries are installed through:

echo $LD_LIBRARY_PATH | tr : '\n' | grep wirecell
1

If you followed the above setup instruction, this path should be somewhere under /wcdo/lib/ups/wirecell/DEVEL/

# Write and run tests

The test/ directory under each WCT package is the place to put your test code in. Any .cxx files starting with test_ will be automatically compiled. After you modify existing test code or write a new test, you can compile it through

./wcb
1

Afterwards, you can find the compiled binary test programs under the /wcdo/src/wct/build/ directory, and run them individually.

# Setup WCT with LArSoft

Assuming you are familiar with LArSoft, this is only slightly more complicated than the above. I suggest you make a new directory and follow the instruction to start a new project. Taking DUNE as an example, place the following lines in your wcdo-local-myproj.rc file before executing the container:

wcdo_mrb_project_name="larsoft"
wcdo_mrb_project_version="v08_27_00"
wcdo_mrb_project_quals="e17:prof"
larwirecell_version="v08_05_10"
dunetpc_version="v08_27_00"

# setup ups and mrb
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
setup dunetpc $dunetpc_version -q $wcdo_mrb_project_quals

wcdo-ups-init
path-append $wcdo_ups_products PRODUCTS
wcdo-mrb-init
wcdo-mrb-add-source larwirecell test_wc $larwirecell_version

# build wct
wcdo-ups-declare wirecell DEVELMRB
setup wirecell DEVELMRB -q e17:prof
wcdo-ups-wct-configure-source
./wcb -p --notests install
setup wirecell DEVELMRB -q e17:prof
wcdo-wirecell-path default
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Note that you need to define the several package versions at the top. You can find the current versions here: larsoft (opens new window), larwirecell (opens new window), dunetpc (opens new window), and change accordingly.

Next you need to build larwirecell against the current wct on your local computer. First, edit the /wcdo/src/mrb/srcs/larwirecell/ups/product_deps file and change the line wirecell vxx_xx_xx to wirecell DEVELMRB. Then run the following commands:

mrbsetenv
mrb i # only for first time build
mrbslp
1
2
3

If everything compiles fine, you now have a working environment to develop and test WCT, larwirecell and LArSoft code. Note that next time you start up the container, you only need to run mrbsetenv and mrbslp to setup the environment.

TIP

TIP: You can use the ninja compiler instead of the default make to speed up the compiling. To do so, first set up ninja using setup ninja v1_8_2. Then, replace mrb i with mrb i --generator ninja.