packNGo
Package generated code in ZIP file for relocation
Description
packNGo(
packages the code files in a compressed ZIP file so that you can relocate, unpack, and
rebuild them in another development environment. The list of name-value pairs is
optional.buildInfo,Name,Value)
The ZIP file can include these types of files:
Source files (for example,
.c,.cu, and.cppfiles)Header files (for example,
.h,.cuh, and.hppfiles)MAT file that contains the build information object (
.matfile)Nonbuild-related files (for example,
.dllfiles and.txtinformational files) required for a final executableBuild-generated binary files (for example, executable
.exefile or dynamic link library.dll).The code generator includes the build-generated binary files (if present) in the ZIP file. The ignoreFileMissing property does not apply to build-generated binary files.
CMake configuration files (
CMakeLists.txt) that you use to generate makefiles or projects for a compiler environment.
Use this function to relocate files. You can then recompile the files for a specific target environment or rebuild them in a development environment in which MATLAB® is not installed. By default, the function packages the files as a flat folder structure in a ZIP file within the code generation folder. You can customize the output by specifying name-value pairs. After relocating the ZIP file, use a standard ZIP utility to unpack the compressed file.
The packNGo function can potentially modify the build information
passed in the first packNGo argument. As part of code packaging,
packNGo can find additional files from source and include paths
recorded in the build information. When these files are found, packNGo
adds them to the build information.
To ensure that packNGo finds
header files, add their paths to buildInfo by using the
addIncludePaths function.
Note
When generating standalone code by using the
codegencommand, you can use the-packageoption to both generate code and package the code in a ZIP file in a single step.packNGocan modify thebuildInfoargument. These modifications are reflected in further use ofbuildInfo, including in subsequent calls topackNGo.
Examples
Input Arguments
Name-Value Arguments
Limitations
The function operates on source files only, such as
*.c,*.cpp,cuh, and*.hfiles. The function does not support compile flags, defines, or makefiles.The function does not package source files for reusable library subsystems.
Unnecessary files might be included. The function might find additional files from source paths and include paths recorded in the build information, even if those files are not used.