주요 콘텐츠

빌드 구성

출력 파일 이름, 위치, 유형, 언어와 같은 빌드 설정 구성

이진 코드 생성을 위한 빌드 프로세스를 제어하고 구성하기 위한 많은 파라미터와 설정이 있습니다. 이러한 설정은 출력 빌드 유형(MEX, lib, dll 또는 exe)과 C 및 C++ 언어와 같은 특성을 제어합니다. 다른 빌드 설정을 사용하면 가독성, 성능, 외부 코드 통합 등의 특정 요구 사항에 따라 빌드 출력을 사용자 지정할 수 있습니다. 앱이나 명령줄에서 코드 생성 구성 객체의 빌드 옵션을 수정할 수 있습니다. coder.config를 사용하여 구성 객체를 생성할 수 있습니다. open을 사용하여 편집 앱에서 객체를 엽니다. 함수 코드 내부에서 추가 빌드 파일과 플래그를 지정하려면 coder.updateBuildInfo를 사용하십시오.

함수

모두 확장

coder.config코드 생성 구성 객체 만들기
coder.updateBuildInfoUpdate RTW.BuildInfo build information object
target.addAdd target object to internal database
target.clearClear all target objects from internal database (R2023a 이후)
target.createCreate target object
target.exportExport target object data
target.getRetrieve target objects from internal database
target.removeRemove target object from internal database
target.updateUpdate target objects in internal database (R2023a 이후)
target.upgradeUpgrade existing definitions of hardware devices
addCompileFlagsAdd compiler options to build information
addDefinesAdd preprocessor macro definitions to build information
addIncludeFilesAdd include files to build information
addIncludePathsAdd include paths to build information
addLinkFlagsAdd link options to build information
addLinkObjectsAdd link objects to build information
addNonBuildFilesAdd nonbuild-related files to build information
addPreincludeFilesAdd preinclude files to build information (R2024a 이후)
addSourceFilesAdd source files to build information
addSourcePathsAdd source paths to build information
addUndefinesAdd undefine preprocessor directives to build information (R2024a 이후)
removeIncludePathsRemove include paths from build information (R2023b 이후)
removeSourceFilesRemove source files from build information object (R2021b 이후)
removeUndefinesRemove undefine preprocessor macros from build information (R2024a 이후)
findBuildArgFind a specific build argument in build information
findIncludeFilesFind and add include (header) files to build information
getBuildArgsGet build arguments from build information
getCompileFlagsGet compiler options from build information
getDefinesGet preprocessor macro definitions from build information
getFullFileListGet list of files from build information
getIncludeFilesGet include files from build information
getIncludePathsGet include paths from build information
getLinkFlagsGet link options from build information
getNonBuildFilesGet nonbuild-related files from build information
getPreincludeFilesGet preinclude files from build information (R2024a 이후)
getSourceFilesGet source files from build information
getSourcePathsGet source paths from build information
getUndefinesFrom build information, get preprocessor macros to undefine (R2024a 이후)
setTargetProvidesMainDisable inclusion of code generator provided (generated or static) main.c source file during build
updateFilePathsAndExtensionsUpdate files in build information with missing paths and file extensions
updateFileSeparatorUpdate file separator character for file lists in build information

코드 구성 설정

모두 확장

빌드 유형Output to build from generated C/C++ code
언어Language to use in generated code
언어 표준Language standard to use for the generated code
사용자 지정 출력 파일Name of code generation output file
코드만 생성Generation of only source code
검증 모드Code verification mode
빌드 폴더Folder type for files generated during build process
빌드 폴더 경로Folder path for files generated during build process
작업 폴더Current working folder type for build process
작업 폴더 경로Current working folder path for build process
CTRL+C와 그래픽스 새로 고침에 대한 반응 활성화Responsiveness checks
외재적 호출 유지Extrinsic function call support
메모리 무결성 검사Memory integrity checking
정수 오버플로 시 포화Integer overflow support
순수 정수만 지원Detection of floating-point code
nonfinite 숫자 지원Support for nonfinite values
루프 풀기 임계값Threshold on the number of iterations that determines whether to automatically unroll a for-loop and a parfor-loop
진입점 함수에 대한 입력 데이터 유지Whether to protect entry-point input data from modification
가능한 경우 OpenMP 라이브러리 활성화Parallelization of parfor-loops
자동 병렬화 활성화Automatic parallelization of for loops
최대 CPU 스레드 개수Maximum number of CPU threads to run parallel for-loops
타깃 하드웨어 확장 명령어 집합 활용SIMD instruction set for target hardware
FMAWhether to use SIMD instructions for fused multiply add operations
사용자 작성 MATLAB 함수를 위한 인라인 전략Control inlining between user-written functions
MathWorks 작성 MATLAB 함수를 위한 인라인 전략Control inlining between MathWorks functions
MathWorks 함수와 사용자 함수 간의 호출을 위한 인라인 전략Control inlining between user-written functions and MathWorks functions
축소 최적화Generate SIMD code for reduction operations | Parallelize for-loops performing reduction operations
하드웨어 SIMD 가속Level of SIMD intrinsics
전역 데이터 동기화 모드Global data synchronization mode
가변 크기 조정 활성화Variable-size array support
동적 메모리 할당 활성화Enable dynamic memory allocation for variable-size arrays
동적 메모리 할당 임계값Size threshold for dynamic memory allocation of variable-size arrays
고정 크기 배열을 위한 동적 메모리 할당 활성화Dynamic memory allocation for fixed-size arrays
동적 메모리 할당 인터페이스Dynamically allocated array at generated function interface
배열 레이아웃Row-major array layout
배열 차원 유지N-dimensional indexing
스택 사용량 최댓값Maximum stack usage per application
재진입 코드 생성Multi-instance, reentrant code
미사용 필드와 속성 유지Preserve unused class properties or structure fields in the generated C/C++ code
생성 파일 분할 방법File partitioning mode
큰 상수 생성Whether to write large deep learning constants to binary data files
큰 상수 임계값Threshold above which the code generator writes DNN constants to binary data files
주석 포함Comments in generated code
주석 스타일Comment style in the generated code
MATLAB 소스 코드를 주석으로 삽입Inclusion of MATLAB source code as comments in generated code
MATLAB 소스 코드 주석 라인 번호Include line numbers of MATLAB source code as comments in the generated code
MATLAB 함수 도움말 텍스트 MATLAB function help text in function banner
요구 사항 요약을 주석으로 삽입Include requirements links as comments
if-elseif-else 패턴을 switch-case 문으로 변환Conversion of if-elseif-else patterns to switch-case statements
함수 선언에 extern 키워드 유지Preservation of the extern keyword in function declarations
고정소수점 연산 및 2의 거듭제곱이 곱해지는 연산에 부호 있는 왼쪽 시프트 사용Replacement of multiplications by powers of two with signed left bitwise shifts
부호 있는 정수에 대한 오른쪽 시프트 허용Signed right bitwise shifts in generated code
괄호Parenthesization level in the generated code
최대 식별자 길이Maximum number of characters in generated identifiers
헤더 가드 스타일Style of preprocessor directive in generated code
들여쓰기 스타일Style for placement of braces in the generated code
들여쓰기 크기Number of characters per indentation level
열 제한Maximum number of columns before a line break in the generated code
데이터형 대체Data type replacement in generated code
사용자 지정 데이터형 대체 활성화Custom names for data types in generated code
외부 헤더 파일에서 사용자 지정 유형 가져오기Whether to import type definition from external header files
헤더 파일External header files that contain custom type definitions
전역 변수Custom identifier format for global variable identifiers
전역 유형Custom identifier format for global type identifiers
전역 유형의 필드 이름Custom identifier format for field names in global type identifiers
로컬 함수Custom identifier format for local function identifiers
로컬 임시 변수Custom identifier format for local temporary variable identifiers
상수 매크로Custom identifier format for constant macro identifiers
EMX 배열 유형Custom identifier format for EMX array types
EMX 배열 유틸리티 함수Custom identifier format for EMX array utility functions
생성된 소스 및 헤더 파일 이름 형식File name customization macro
코드 생성 템플릿 파일Code generation template for file and function banners
사용할 코드 형식 툴 선택Formatting tool for generated code
clang 형식 구성 파일 사용 제어Control generation of clang-format file
C/C++ 컴파일러 디버그 모드 활성화C compiler debugging mode
런타임 오류 검사 생성Run-time error detection and reporting in generated code
상세 컴파일러 출력값 표시Code generation progress display
항상 리포트 생성Code generation report
MATLAB에서 차이점 보고Potential differences reporting
잠재적 데이터형 문제 강조 표시Highlighting of potential data type issues in the code generation report
잠재적인 행 우선 문제 강조 표시Potential row-major layout issues
묵시적 확장으로 인해 발생할 수 있는 잠재적 문제 강조 표시Highlight potential implicit expansion issues
coder.loop 함수 사용 시 발생할 수 있는 잠재적 문제 강조 표시Highlight potential loop control issues
정적 코드 메트릭 리포트 생성Static code metrics report
코드 대체 리포트 생성Code replacement report
리포트가 생성된 경우 자동으로 실행Automatic open of code generation report
리포트 정보를 변수로 내보내기Name of variable containing code generation report information
SIL 또는 PIL에 대한 소스 수준 디버그 활성화Debugging of generated code during a SIL or PIL execution
상수 입력값 검사Constant input checking mode for a SIL or PIL execution
전역 데이터 동기화Global data synchronization mode for a SIL or PIL execution
진입점 실행 프로파일링 활성화Execution time profiling during a SIL or PIL execution
함수 실행 프로파일링 활성화Execution time profiling of functions called within entry-point functions during a SIL or PIL execution
프로파일링 저장 옵션 지정Collection and storage of execution-time measurements
진입점 스택 프로파일링 활성화Stack usage profiling during a SIL or PIL execution
C/C++ 코드 커버리지 활성화Analysis of C/C++ code coverage
실행 프로파일링 활성화Instrumentation for profiling
코드 대체 라이브러리Code replacement library for generated code
내장 FFTW 라이브러리 사용Generate code that uses the FFTW library shipped with MATLAB
사용자 지정 FFT 라이브러리 콜백Callback class for FFTW library calls
사용자 지정 BLAS 라이브러리 콜백BLAS callback class
사용자 지정 LAPACK 라이브러리 콜백LAPACK callback class
미리 컴파일된 라이브러리 사용Whether to use precompiled libraries in generated code
소스 파일Code to appear near the top of generated .c or .cpp files
헤더 파일Custom code that appears at top of generated C/C++ header files
초기화 함수Custom code to include in the generated initialize function
종료 함수Code that appears in the generated terminate function
추가 include 디렉터리Include folders to add to include path for compiling generated code
추가 소스 파일Source files to compile and link with the generated code
추가 라이브러리Static library files to link with the generated code
코드 생성 후처리 명령Command to customize build processing
예약된 이름Names that code generator must not use for functions or variables
하드웨어 보드Name of hardware board
프로덕션 장치 세부 정보: 장치 공급업체Manufacturer of production hardware
프로덕션 장치 세부 정보: 장치 유형Type of production hardware
프로덕션 장치 세부 정보: charLength in bits of the C char data type
프로덕션 장치 세부 정보: shortLength in bits of the C short data type
프로덕션 장치 세부 정보: intLength in bits of the C int data type
프로덕션 장치 세부 정보: longLength in bits of the C long data type
프로덕션 장치 세부 정보: long longLength in bits of the C long long data type
프로덕션 장치 세부 정보: floatLength in bits of the C floating-point data type
프로덕션 장치 세부 정보: doubleLength in bits of the C double data type
프로덕션 장치 세부 정보: 머신 워드Microprocessor native word size
프로덕션 장치 세부 정보: pointerLength in bits of pointer data
프로덕션 장치 세부 정보: size_tLength in bits of size_t data
프로덕션 장치 세부 정보: ptrdiff_tLength in bits of ptrdiff_t data
프로덕션 장치 세부 정보: 바이트 순서Significance of the first byte of a data word
프로덕션 장치 세부 정보: 산술 시프트로 부호 있는 정수에 대한 오른쪽 시프트 수행Implementation of signed integer right shift as arithmetic right shift
프로덕션 장치 세부 정보: long long형 사용Long long data type support
프로덕션 장치 세부 정보: 최대 아토믹 정수 크기Largest atomic integer size for production hardware
프로덕션 장치 세부 정보: 최대 아토믹 부동소수점 크기Largest atomic floating-point size for production hardware
프로덕션 장치 세부 정보: 부호 있는 정수 나눗셈의 반올림 방식Rounding for division of two signed integers
타깃 장치 세부 정보: 장치 공급업체Manufacturer of test hardware
타깃 장치 세부 정보: 장치 유형Type of test hardware
테스트 장치 세부 정보: charLength in bits of the C char data type
테스트 장치 세부 정보: shortLength in bits of the C short data type
테스트 장치 세부 정보: intLength in bits of the C int data type
테스트 장치 세부 정보: longLength in bits of the C long data type
테스트 장치 세부 정보: long longLength in bits of the C long long data type
테스트 장치 세부 정보: floatLength in bits of the C floating-point data type
테스트 장치 세부 정보: doubleLength in bits of the C double data type
테스트 장치 세부 정보: 머신 워드Microprocessor native word size
테스트 장치 세부 정보: pointerLength in bits of pointer data
테스트 장치 세부 정보: size_tLength in bits of size_t data
테스트 장치 세부 정보: ptrdiff_tLength in bits of ptrdiff_t data
테스트 장치 세부 정보: 바이트 순서Significance of the first byte of a data word
테스트 장치 세부 정보: 산술 시프트로 부호 있는 정수에 대한 오른쪽 시프트 수행Implementation of signed integer right shift as arithmetic right shift
테스트 장치 세부 정보: long long형 사용Long long data type support
테스트 장치 세부 정보: 최대 아토믹 정수 크기Largest atomic integer size for test hardware
테스트 장치 세부 정보: 최대 아토믹 부동소수점 크기Largest atomic floating-point size for test hardware
테스트 장치 세부 정보: 부호 있는 정수 나눗셈의 반올림 방식Rounding for division of two signed integers
툴체인Toolchain to use for building a C/C++ library or executable program
사용자 지정 툴체인 옵션Custom settings for tools in selected toolchain
빌드 구성 Compiler optimization or debug settings for toolchain
테스트 하드웨어가 프로덕션 하드웨어와 동일함Equivalence of production and target hardware characteristics
C++ 네임스페이스Namespace name for generated C++ code
인터페이스 스타일Interface style for generated C++ code
C++ 인터페이스 클래스 이름Interface class name for generated C++ code
MATLAB 네임스페이스에서 C++ 네임스페이스 생성Generate C++ namespaces for MATLAB namespaces
MathWorks 코드를 위한 네임스페이스Place C++ code generated for MathWorks code in a separate namespace
MATLAB 클래스에서 C++ 클래스 생성Generate C++ classes for MATLAB classes
MATLAB 열거형에서 C++ 열거형 클래스 생성Whether to generate C++ enumeration classes for MATLAB enumerations
형변환 모드Data type casting level
상수 폴딩 제한 시간Maximum number of instructions to be executed by the constant folder
컴파일타임 재귀 제한Maximum number of function specializations for compile-time recursion
초기화 함수 자동 실행Automatically run the initialize function
초기화 함수 필요함Initialize function generation
종료 함수 필요함Terminate function generation
알려진 MISRA 위반에 대한 정당화 사유 주석 생성Add annotations to suppress known MISRA/AUTOSAR violations
샘플 메인 생성Example C/C++ main file generation
변수 이름 유지Variable names to preserve in the generated code
종료 세미콜론이 없는 표현식 에코Expression echoing
makefile 생성Makefile generation
외재적 호출 자동 도입Automatic extrinsic function calls
배열 인덱싱 단순화Strength reduction optimization
벡터 할당에 memcpy 사용 Whether to enable memcpy optimization
memcpy 임계값(바이트):Minimum size for memcpy or memset optimization
memset를 사용하여 부동소수점 및 double형을 0.0으로 초기화Assignment of float and double zero with memset
상수 입력값Constant input checking mode
MEX의 빌드 유형에 대해 JIT 컴파일 사용Just-in-time (JIT) compilation mode
사용되는 경우 nonfinite 지원 파일 생성Generate support files for nonfinite data only if nonfinite data is used
진입점 함수에 대한 참조 방식으로 구조체 전달Pass structures by reference
항상 switch에 대한 디폴트 case 생성Default case for all switch statements
코드 추적성 활성화Traceability in code generation report
Embedded Coder 기능 사용Whether to use Embedded Coder features
묵시적 확장 활성화Implicit expansion capabilities in generated code
자동 병렬화 리포팅 활성화Reporting for automatic parallelization of for loops
런타임 재귀 활성화Run-time recursion support
동적 배열 데이터 캐시Dynamic array optimization
SIL/PIL 세부 정보 표시Display communication I/O information during SIL or PIL execution
SIL/PIL 프로파일링 메트릭PMU metric

객체

coder.MexCodeConfigConfiguration parameters for MEX function generation from MATLAB code
coder.CodeConfigConfiguration parameters for C/C++ code generation from MATLAB code
coder.EmbeddedCodeConfigConfiguration parameters for C/C++ code generation from MATLAB code with Embedded Coder
coder.HardwareImplementationHardware-specific configuration parameters for C/C++ code generation from MATLAB code
coder.hardwareCreate hardware board configuration object for C/C++ code generation from MATLAB code
coder.ReplacementTypesConfiguration parameter to specify custom names for MATLAB built-in data types in C/C++ code generation
RTW.BuildInfo생성 코드를 컴파일하고 링크하기 위한 정보 제공

클래스

coder.ExternalDependencyInterface to external code
target.AliasCreate alternative identifier for target object
target.CMakeSpecify CMake installation for building generated code (R2022b 이후)
target.CMakeBuilder Configure how CMake builds generated code (R2022b 이후)
target.CMakeBuildTypeDescribe CMake build type or build configuration (R2022b 이후)
target.CMakeCacheEntryConfigure a CMake cache entry (R2022b 이후)
target.EnvironmentConfigurationConfigure system environment for toolchain (R2022b 이후)
target.HardwareComponentSupportDescribe support for a hardware component (R2022b 이후)
target.LanguageImplementationProvide C and C++ compiler implementation details
target.ObjectBase class for target types
target.ProcessorProvide target processor information
target.ToolchainCapture high-level information about toolchain (R2022b 이후)

네임스페이스

target타깃 하드웨어 및 빌드 툴 정보 관리

도움말 항목

빌드 구성 기본 사항

특정 빌드 옵션

문제 해결하기

추천 예제