22. Creating a build_visit Module¶
To create the skeleton for a build_visit module, run
construct_build_visit_module.sh <module>, where
<module> is the name of the library you wish to build.
The script is located in
For purposes of the rest of this section,
<module> will be named
construct_build_visit_module.sh foo will create the file:
bv_foo.sh containing most of the code needed, and only a few functions will require modification.
There are three functions in the file that absolutely need to be fleshed out further:
Other build_visit modules may be helpful as examples for filling these out.
If the package being built has a decent CMake build system, please use that in the build_foo function.
Here is a list of all the functions that will be defined (listed in order of appearance in the file):
Initialize any variables controlled by command line options.
Enables the module (sets DO_FOO to yes).
Disables the module (sets DO_FOO to no).
What other modules does foo depend on. For example, the osmesa module returns llvm.
Name of the foo tarball, the version, etc.
Prints info about the foo module.
Prints how to enable the module and any other relevant command line args.
Adds the necessary information about the foo module to config-site host profile cmake file. Most often this is just the insall location, but could also be version information.
Set vars possibly needed by other modules, such as install location for the module (can use EXPORT). This is an optional function and can be removed if not needed.
Ensure the module has been downloaded and extracted properly.
Where all the steps for building and installing the module reside.
Returns true if the module is enabled, and false otherwise
Returns true if the module is installed, and false otherwise
Checks if foo is already installed, and calls build_foo if not.
Most of the above referenced functions will suit fine as originally written by the construction script.
If your module has dependencies on other build_visit modules, then also modify
If you want to allow use of a system version of your module, then
bv_foo_initialize needs work to ensure extra command line arguments are added.
bv_qt.sh as an example of allowing system or also an alternate (already installed but not system) qt.
bv_alt_qt_dir were added and other functions were modified to support this for qt.
bv_foo.sh has been updated appropriately, add the module name to
bv_support/modules.xml under the appropriate categories.
Then run the build_visit script to ensure that your module builds and installs correctly, and that the host profile entry is correct.
Order of execution of the functions:
bv_foo_initialize_vars (if defined)