nelson.compiler.build, nelson.compiler.build
Build a native executable from structured options.
📝Syntax
result = nelson.compiler.build(options)
nelson.compiler.build(options)
📥Input Arguments
Parameter Description
options One scalar nelson.compiler.BuildOptions object. No additional overrides are accepted.
📤Output Arguments
Parameter Description
result nelson.compiler.BuildResult containing output paths, dependency reports and executable digest.
📄Description

This is the structured build entry point of the optional compiler module. ncc(options) is equivalent. Use ncc('options', ...) to load the module and construct the configuration.

The builder analyzes dependencies, compiles application .m files into .nbc bytecode, packages code and data into the executable, and selects runtime dependencies. A precompiled launcher is required; no C++ compiler is needed on the build machine.

The output uses the host's native executable format: .exe on Windows and an executable file on supported Unix platforms. This is not cross-compilation. NoConsole selects the Windows windowed launcher; Mode independently selects graphics capabilities.

With RuntimeMode='bundled', distribute both the executable and the adjacent .runtime directory listed in result.Files. The runtime is selected from the dependency plan, not an unrestricted copy of the development installation. Dynamic dependencies and graphics may require larger sets of modules.

With RuntimeMode='installed', only the executable is produced. The receiving machine needs an installation matching the required architecture and engine fingerprint. A version number alone is insufficient. Runtime selection supports NELSONC_RUNTIME_ROOT and NELSON_RUNTIME_PATH; consult ncc for search rules.

The destination directory is created if needed. An existing output executable or bundled runtime destination is rejected, not overwritten. The entry source files are not needed by the deployed application after packaging.

Calling without an output still builds. Verbose controls diagnostic printing. The result is not an installer. Packaging does not promise faster numerical execution; bytecode uses the normal execution engine.

💡Examples
Build using an installed runtime
options = ncc('options', 'app_entry.m', ...
  'RuntimeMode', 'installed', 'OutputDir', 'application-build');
result = nelson.compiler.build(options);
disp(result.Executable);
🔗See Also
nccnelson.compiler.BuildOptionsnelson.compiler.BuildResultnelson.compiler.analyzecompiler_standalone_tutorial
🕔Version History
Version Description
Edit this page on GitHub