Build Process Support for File and Folder Names - MATLAB & Simulink (original) (raw)

Filenames with Spaces

For the build process that uses ToolchainInfo objects, only these toolchains support the use of filenames containing spaces:

The build process that uses template makefiles does not support the use of filenames containing spaces.

Folder Names with Spaces

On a Windows system, the code generator maps a drive corresponding to the MATLAB® installation folder for either of these conditions:

These folder paths can contain spaces:

If your work environment includes one or more of the preceding scenarios, use the following support mechanisms for the build process:

With either build approach, when there is an issue with support for creation of alternate names (short names), build errors can occur on Windows. If a build generates an error message similar to the following message, see Troubleshooting Errors When Folder Names Have Spaces.

NMAKE : fatal error U1073: don't know how to make ' ...

When using operating system commands, such as system or dos, enclose paths that specify executable files or command parameters in double quotes (" "). For example:

system('dir "D:\Applications\Common Files"')

This table provides a summary of build folder support and limitations for Windows.

Build Process Folders Approach for Paths with UNC or Spaces Support for Windows
matlabroot folderThematlabroot value is derived from the MATLAB installation location. During a build, a UNC location such as:\\networkdrive\matlab\R20xxbcould be remapped as:T:\During a build on a Windows system with short filename (8.3) support (default for Windows using NTFS), the build process uses the Windows APIgetShortPathName() for the folder location.During a build on a Windows system without short filename (8.3) support (systems using ReFS or using NTFS with 8.3 support disabled), a location with spaces in the path such as:C:\Program Files\MATLAB\R20xxbcould be remapped as:T:\R20xxb Build process folder support available independent of file system (NTFS or ReFS) or file system configuration for short filename support.**Limitations:**On systems that require drive mapping for the installation location, the build process requires that a drive letter is available for mapping.On systems without short filename (8.3) support (using ReFS or using NTFS with 8.3 support disabled), the final folder in the installation location cannot contain spaces. For example, a final folder name:C:\Program Files\MATLAB\R20xxb sp1is not supported.
Code generation folderSimulation cache folderCustom code source file locations—among others, these locations include folders specified by:rtwmakecfg.mModel configuration parameter Additional build informationCode replacement library For UNC locations, build process temporarily maps a drive by using the shell commands pushd andpopd. Build process folder support is available independent of file system (NTFS or ReFS) or file system configuration for short path name support.
For paths with spaces, build process uses the Windows short path name (8.3) by using the Windows API:getShortPathName() Build process folder support depends on NTFS file system and requires Windows default support. Registry sets value of 2 or 0 for:NtfsDisable8dot3NameCreationLimitations: Build process does not support spaces in the path to these folders for: NTFS file system with short path name support disabled ReFS file system (this file system does not support short path names)

Troubleshooting Errors When Folder Names Have Spaces

On Windows, when there is an issue with support for creation of short filenames, build process errors can occur. When this issue affects a build, you see an error message similar to:

NMAKE : fatal error U1073: don't know how to make 'C:\Work\My'

This message can occur if a space in the folder name (C:\Work\My Models) prevents the build process from finding the model or a file to build. For descriptions of the build-related folders that are sensitive to a space in the folder name or path, see Folder Names with Spaces.

To avoid issues from folder names with spaces when Windows short filename support for filenames is disabled, do not use paths with spaces. For example, install third-party software to paths without spaces. Do not use paths with spaces for folders containing your models, source files, or libraries.

An issue can occur with builds that use folder names with spaces, because it is possible to disable Windows alternate name support. The build process uses this alternate name support on Windows systems. There are many terms for this file, folder, and path alternate name support:

Verify the type of file system that the drive uses. In Windows Explorer, right-click the drive icon and select properties.

The error could stem from an issue with short filename support on a system using NTFS. Check the Windows registry setting that enables the creation of short names for files, folders, and paths.

  1. Open the Windows command prompt, running as administrator. For example, from the Windows Start menu, type cmd, right-click thecmd.exe icon, and select Run as administrator.
  2. Change to the windows\system32 folder and query theNtfsDisable8dot3NameCreation status by typing:
  3. If the registry state of NtfsDisable8dot3NameCreation is not 0 (enable 8dot3 name creation for all volumes on the system), change the value to 0 by typing:
    For more information about enabling creation of short names. See https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/ff621566(v=ws.11).
    Changing the registry setting enables creation of short names only for files and folders that are created after the change.
  4. To create short names for files created while short name creation was disabled, at the Windows command line, use the fsutil utility.
    To set the short name, the syntax is:

    fsutil file setshortname
    For example, to create the short name PROGRA~1 for the long name C:\Program Files, type:
    fsutil file setshortname "C:\Program Files" PROGRA~1
    The C:\Program Files folder name is in quotations because it has spaces.

  5. To verify that the short name was created, use the dir command with /x option to show short names.

Folder Names with Special Characters

The build process might produce an error if a build-related folder path contains:

Very Long Folder Paths

For the MinGW® compiler, the build process produces an error when the command line length exceeds the Windows limit of 32,767 characters. If this error occurs, check the length of include paths. You can reduce the command line length by building the generated code in a code generation folder that has a shorter name

See Also

addAttribute

Topics

External Websites