This collects some questions and answers related to the intersection of the Wire-Cell toolkit and the UPS software ecosystem.
A “UPS product” of the name wirecell provides programs, libraries and configuration files derived from the Wire-Cell Toolkit (WCT) project. WCT source files are in the GitHub repository wire-cell-toolkit that is part of the GitHub organization named “WireCell”. There is nothing named wirecell which is part of WCT. The main WCT program is named wire-cell and the sibling project wire-cell-python produces a suite of programs named wirecell-<name>. The name wirecell should refer only to the UPS product.
WCT finds its configuration files, including the .json.bz2 file from wire-cell-data via:
WIRECELL_PATH
This is the only variable WCT uses (though LD_LIBRARY_PATH is implicitly used to locate plugins).
First “setup” your UPS environment so that it provides the dependencies that WCT provides. One way to do this is to setup an existing wirecell UPS product that provides WCT or a higher level package (eg larsoft) that depends on wirecell.
Next, communicate the location of dependencies provided by UPS to wcb configure with a number of --with-<name> flags. In some cases the more specific --with-<name>-include and --with-<name>-lib may be required. Hints can be found in the official “SSI build shim” script.
The given --prefix <prefix> which determines where WCT will be installed may be freely chosen. If the goal is to use WCT in a stand alone manner, you are done. See also questions about running larsoft with custom WCT and building larsoft with custom WCT.
First, build WCT in a UPS context and then place the installed <prefix>/bin/ directory at the front of your PATH and the <prefix>/lib/ directory at the front of your LD_LIBRARY_PATH.
In principle, this should be enough. The UPS wirecell product defines a number of other environment variables. If there is any UPS or other code that you will use that is sensitive to these you may need to define them to point to your own WCT installation under <prefix>. The list of variables include:
WIRECELL_DIRWIRECELL_FQ_DIRWIRECELL_INCWIRECELL_LIBWIRECELL_VERSION
Take care that exercising various “setup” scripts in the UPS ecosystem, including use of “mrb” development areas may overwrite these non-standard UPS environment variables or the standard Unix PATH variables with values pointing to the nominal wirecell UPS product.
In some cases, this is not required. See run in UPS and build in UPS. However, when using a custom WCT, it may be required to (re)build the larwirecell package from LArSoft if:
- You want to develop the
larwirecellpackage itself in coincidence with your own development version WCT. - You may not want to develop
larwirecell, per se, but the version of WCT you want to use has changed its API (or ABI) from what it was in the version supplied bywirecelland on whichlarwirecellwas original build/linked.
The simplest way assumes you are familiar with the mrb package and applies a “hack”.
- Use “mrb” to set up a development environment for
larwirecell(or package that depends onlarwirecell) and which includes a local installation of thewirecellUPS product. - Build WCT and give
--prefix <prefix>pointing to the location of thewirecellUPS product installed bymrb.
Installing WCT in this way will simply overwrite the local wirecell UPS area an “trick” mrb and the rest of your local UPS ecosystem into using your custom version of WCT.
Of course, be careful as the version used for wirecell is now a lie. A more careful hack would be to first copy the local wirecell UPS area to a sibling with a different version string and install your custom WCT into that area. The various UPS files in that area will need editing as well as the mrb files in your development area.