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 src/tools/dev/scripts/bv_support. For purposes of the rest of this section, <module> will be named foo.

Running 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: bv_foo_info, bv_foo_host_profile, and build_foo. 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 bv_foo_depends_on.

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. See bv_qt.sh as an example of allowing system or also an alternate (already installed but not system) qt. bv_qt_system_qt and bv_alt_qt_dir were added and other functions were modified to support this for qt.

Once 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:

  1. bv_foo_initialize

  2. bv_foo_info

  3. bv_foo_[enable|disable]

  4. bv_foo_is_enabled

  5. bv_foo_initialize_vars (if defined)

  6. bv_foo_ensure

  7. bv_foo_is_enabled

  8. bv_foo_is_installed

  9. bv_foo_depends_on

  10. bv_foo_build

  11. bv_foo_host_profile