![]() |
RoveComm C++ 3.0.0
Welcome to the RoveComm C++ repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of RoveComm C++. The RoveComm C++ project is the RoveComm interface for high level systems and should not be used for microcontrollers.
|
Classes | |
| class | Args |
| class | ANSI |
Functions | |
| None | print_ansi (str message, *ANSI codes) |
| None | print_if_verbose (str message, *ANSI codes) |
| None | print_separator () |
| None | print_key_values (str key, list[str] values, int length) |
| Never | print_error_and_exit (str message) |
| pathlib.Path | relative_or_full_path (pathlib.Path path) |
| tuple[int,...]|None | parse_llvm_version (str path_str) |
| str|None | get_llvm_std_module (str search) |
| pathlib.Path|None | find_vs_path () |
| list[str] | get_module_flags (str name, pathlib.Path module_output_path) |
| bool | compile_module (str name, list[pathlib.Path] paths, pathlib.Path module_output_path) |
Variables | |
| parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
| _ = parser.add_argument("files", action="store", nargs="*", help="the source file(s) to compile") | |
| args = Args(parser.parse_args(args=None if len(sys.argv) > 1 else ["--help"])) | |
| ANSI_INFO = ANSI.fg_bright_blue | |
| ANSI_ERROR = ANSI.fg_bright_red | |
| ANSI_SUCCESS = ANSI.fg_bright_green | |
| ANSI_SEPARATOR = ANSI.fg_bright_yellow | |
| ANSI_TRY_ALL = ANSI.fg_bright_magenta | |
| bool | no_color = "" |
| list | source_paths = [pathlib.Path(file) for file in args.files] |
| list | child_args = [arg for arg in sys.argv[1:] if arg not in ("-y", "--try-all")] |
| list | compilers = [] |
| list | standards = ["c++17", "c++20", "c++23"] |
| pathlib | workspace_path = pathlib.Path(__file__).parent.parent.resolve() |
| float | compile_start = time.perf_counter() |
| list | warnings_as_errors = "cl" else ["-f-Werror"] |
| list | command |
| compile_result | |
| str | compiler = "" |
| pathlib | vs_path = find_vs_path() |
| list | defines = args.define[:] |
| list | deps = args.deps[:] |
| bool | disable_exceptions = "true" |
| list | flags = args.flag[:] |
| list | includes = args.include[:] |
| dict | modules = {name: files.split(",") for module in args.module for name, files in (module.split("="),)} |
| str | output = args.output |
| list | pass_args = args.pass_args[:] |
| str | std_module = args.std_module |
| pathlib | compile_yaml = pathlib.Path.cwd() / "compile_cpp.yaml" |
| dict | raw_config = yaml.safe_load(file) or {} |
| compile_config = cast("dict[str, Any]", raw_config) | |
| pathlib | binary_path = None |
| pathlib | build_folder .Path |
| bool | auto_binary = False |
| tuple | output_path = (pathlib.Path.cwd() / output).resolve() |
| exist_ok | |
| True | |
| parents | |
| bool | use_std_module = not (std_module is None or std_module == "disable" or args.std != "c++23") |
| str | gcc_std_path = "bits/std.cc" |
| bool | success = False |
| pathlib | vc_version_path = vs_path / "VC" / "Auxiliary" / "Build" / "Microsoft.VCToolsVersion.default.txt" |
| encoding | |
| str | vc_version = vc_version_file.read().strip() |
| pathlib | vc_tools_path = vs_path / "VC" / "Tools" / "MSVC" / vc_version |
| str | clang_path = shutil.which("clang++") |
| pathlib | std_path = pathlib.Path(clang_path).parent.parent / "share" / "libc++" / "v1" / "std.cppm" |
| str | llvm_std_path = get_llvm_std_module("/usr/local/Cellar/llvm") |
| str | module_extension = "" |
| str | short_compiler = "g++" else "msvc" |
| str | suffix = f"{args.type}-{short_compiler}-cpp{args.std[-2:]}" |
| str | extension = "Windows" else "" |
| str | module_indicator = "module_" if args.as_module else "" |
| str | binary_name = f"{source_paths[0].stem}_{module_indicator}{suffix}{extension}" |
| bool | recompiled_modules = False |
| dict | module_paths = {name: [(pathlib.Path.cwd() / file).resolve() for file in files] for name, files in modules.items()} |
| dict | module_output_paths = {name: build_folder / f"{path[0].stem}_module_{suffix}{module_extension}" for name, path in module_paths.items()} |
| bool | need_recompile = True |
| list | deps_paths = [(pathlib.Path.cwd() / file).resolve() for file in deps] |
| float | binary_mod = binary_path.stat().st_mtime |
| list | include_paths = [(pathlib.Path.cwd() / folder).resolve() for folder in includes] |
| str | compiler_path | None |
| pathlib | vs_pwsh_path = vs_path / "Common7" / "Tools" / "Launch-VsDevShell.ps1" |
| int | max_length = 16 |
| float | run_start = time.perf_counter() |
| subprocess | run_result |
██████ ███████ ████████ ██ ██ ██████ ███████ █████ ██████ ██████ ██████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██████ ███████ ██ ███████ ██████ █████ ███████ ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██████ ███████ ██ ██ ██ ██ ██ ███████ ██ ██ ██████ ███████ ██ ██████ ██████ ███████ `BS::thread_pool`: a fast, lightweight, modern, and easy-to-use C++17/C++20/C++23 thread pool library v5.1.0 (2026-01-03) By Barak Shoshany <baraksh@gmail.com> <https://baraksh.com/> Copyright (c) 2021-2026 Barak Shoshany. Licensed under the MIT license. If you found this project useful, please consider starring it on GitHub! If you use this library in software of any kind, please provide a link to the GitHub repository https://github.com/bshoshany/thread-pool in the source code and documentation. If you use this library in published research, please cite it as follows: Barak Shoshany, "A C++17 Thread Pool for High-Performance Scientific Computing", doi:10.1016/j.softx.2024.101687, SoftwareX 26 (2024) 101687, arXiv:2105.00613 This Python script can be used to compile simple C++ programs (with only a few source and/or header files) using a variety of compilers, C++ standards, and other options. It also includes support for C++20 modules and C++23 Standard Library modules. It is used in the thread pool library's development environment to compile and run the test program using different compilers and C++ standards. It is not part of the library itself, but users of the library may find it useful, especially if they wish to use the library as a C++20 module.
| bool compile_cpp.compile_module | ( | str | name, |
| list[pathlib.Path] | paths, | ||
| pathlib.Path | module_output_path ) |
Compile a module with the given name. The first path in `paths` is the module file, and the rest are its dependencies. Returns True if the module was recompiled, False if it was up to date.

| pathlib.Path | None compile_cpp.find_vs_path | ( | ) |
Find the Visual Studio installation path, if it exists.
| str | None compile_cpp.get_llvm_std_module | ( | str | search | ) |
Get the path to the LLVM standard library module on Linux or macOS. If multiple paths are found, return the one with the latest LLVM version.

| list[str] compile_cpp.get_module_flags | ( | str | name, |
| pathlib.Path | module_output_path ) |
Get the appropriate flags to import a module with the given name from the given output path.
| tuple[int, ...] | None compile_cpp.parse_llvm_version | ( | str | path_str | ) |
Extract the LLVM version from a path and returns it as a tuple of integers.

| None compile_cpp.print_ansi | ( | str | message, |
| *ANSI | codes ) |
Print a message. Uses the given ANSI codes if specified. Does not add newline. Does not print color if the `NO_COLOR` environment variable is set.

| Never compile_cpp.print_error_and_exit | ( | str | message | ) |
Print an error message followed by a newline in red and exit.


| None compile_cpp.print_if_verbose | ( | str | message, |
| *ANSI | codes ) |
Print a message followed by a newline, but only if the verbose flag is set. Uses the given ANSI codes if specified.


| None compile_cpp.print_key_values | ( | str | key, |
| list[str] | values, | ||
| int | length ) |
Print a key-value pair with the key left-aligned to the given length, but only if the verbose flag is set.

| None compile_cpp.print_separator | ( | ) |
Print a separator line, but only if the verbose flag is set.


| pathlib.Path compile_cpp.relative_or_full_path | ( | pathlib.Path | path | ) |
If the path is relative to the current working directory, return it as a relative path; otherwise, return it as a full path.
|
protected |
| compile_cpp.ANSI_ERROR = ANSI.fg_bright_red |
| compile_cpp.ANSI_INFO = ANSI.fg_bright_blue |
| compile_cpp.ANSI_SEPARATOR = ANSI.fg_bright_yellow |
| compile_cpp.ANSI_SUCCESS = ANSI.fg_bright_green |
| compile_cpp.ANSI_TRY_ALL = ANSI.fg_bright_magenta |
| compile_cpp.args = Args(parser.parse_args(args=None if len(sys.argv) > 1 else ["--help"])) |
| bool compile_cpp.auto_binary = False |
| float compile_cpp.binary_mod = binary_path.stat().st_mtime |
| str compile_cpp.binary_name = f"{source_paths[0].stem}_{module_indicator}{suffix}{extension}" |
| pathlib compile_cpp.binary_path = None |
| tuple compile_cpp.build_folder .Path |
| list compile_cpp.child_args = [arg for arg in sys.argv[1:] if arg not in ("-y", "--try-all")] |
| str compile_cpp.clang_path = shutil.which("clang++") |
| list compile_cpp.command |
| compile_cpp.compile_config = cast("dict[str, Any]", raw_config) |
| compile_cpp.compile_result |
| float compile_cpp.compile_start = time.perf_counter() |
| pathlib compile_cpp.compile_yaml = pathlib.Path.cwd() / "compile_cpp.yaml" |
| str compile_cpp.compiler = "" |
| str compile_cpp.compiler_path | None |
| list compile_cpp.compilers = [] |
| list compile_cpp.defines = args.define[:] |
| list compile_cpp.deps = args.deps[:] |
| list compile_cpp.deps_paths = [(pathlib.Path.cwd() / file).resolve() for file in deps] |
| bool compile_cpp.disable_exceptions = "true" |
| compile_cpp.encoding |
| compile_cpp.exist_ok |
| str compile_cpp.extension = "Windows" else "" |
| list compile_cpp.flags = args.flag[:] |
| str compile_cpp.gcc_std_path = "bits/std.cc" |
| list compile_cpp.include_paths = [(pathlib.Path.cwd() / folder).resolve() for folder in includes] |
| list compile_cpp.includes = args.include[:] |
| str compile_cpp.llvm_std_path = get_llvm_std_module("/usr/local/Cellar/llvm") |
| int compile_cpp.max_length = 16 |
| str compile_cpp.module_extension = "" |
| str compile_cpp.module_indicator = "module_" if args.as_module else "" |
| dict compile_cpp.module_output_paths = {name: build_folder / f"{path[0].stem}_module_{suffix}{module_extension}" for name, path in module_paths.items()} |
| dict compile_cpp.module_paths = {name: [(pathlib.Path.cwd() / file).resolve() for file in files] for name, files in modules.items()} |
| dict compile_cpp.modules = {name: files.split(",") for module in args.module for name, files in (module.split("="),)} |
| bool compile_cpp.need_recompile = True |
| bool compile_cpp.no_color = "" |
| compile_cpp.output = args.output |
| tuple compile_cpp.output_path = (pathlib.Path.cwd() / output).resolve() |
| compile_cpp.parents |
| compile_cpp.parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) |
| list compile_cpp.pass_args = args.pass_args[:] |
| dict compile_cpp.raw_config = yaml.safe_load(file) or {} |
| bool compile_cpp.recompiled_modules = False |
| subprocess compile_cpp.run_result |
| float compile_cpp.run_start = time.perf_counter() |
| str compile_cpp.short_compiler = "g++" else "msvc" |
| list compile_cpp.source_paths = [pathlib.Path(file) for file in args.files] |
| list compile_cpp.standards = ["c++17", "c++20", "c++23"] |
| compile_cpp.std_module = args.std_module |
| pathlib compile_cpp.std_path = pathlib.Path(clang_path).parent.parent / "share" / "libc++" / "v1" / "std.cppm" |
| bool compile_cpp.success = False |
| str compile_cpp.suffix = f"{args.type}-{short_compiler}-cpp{args.std[-2:]}" |
| compile_cpp.True |
| bool compile_cpp.use_std_module = not (std_module is None or std_module == "disable" or args.std != "c++23") |
| pathlib compile_cpp.vc_tools_path = vs_path / "VC" / "Tools" / "MSVC" / vc_version |
| str compile_cpp.vc_version = vc_version_file.read().strip() |
| pathlib compile_cpp.vc_version_path = vs_path / "VC" / "Auxiliary" / "Build" / "Microsoft.VCToolsVersion.default.txt" |
| pathlib compile_cpp.vs_path = find_vs_path() |
| pathlib compile_cpp.vs_pwsh_path = vs_path / "Common7" / "Tools" / "Launch-VsDevShell.ps1" |
| list compile_cpp.warnings_as_errors = "cl" else ["-f-Werror"] |
| pathlib compile_cpp.workspace_path = pathlib.Path(__file__).parent.parent.resolve() |