FunctionCompileおよび関連関数で使用可能なコンパイラ環境を作る.
CreateCompilerEnvironment
FunctionCompileおよび関連関数で使用可能なコンパイラ環境を作る.
詳細とオプション
- CreateCompilerEnvironmentはCompilerEnvironmentObjectを返す.
- CompilerEnvironmentAppendToでCompilerEnvironmentObjectに宣言が追加できる,
- 次は,使用可能なオプションである.
-
TargetSystem Inherited ターゲットとするマシンアーキテクチャ - TargetSystemの可能な値はリスト$TargetSystemsで与えられる.
例題
すべて開く すべて閉じる例 (2)
env = CreateCompilerEnvironment[]CompilerEnvironmentAppendTo[env, {FunctionDeclaration[AddTwo, Typed[{"Integer64"} -> "Integer64"]@Function[arg, 2 + arg]]}];cf = FunctionCompile[Function[{Typed[arg, "Integer64"]}, AddTwo[arg]], CompilerEnvironment -> env]cf[2]env = CreateCompilerEnvironment[TargetSystem -> "Windows-x86-64"]env[TargetSystem]オプション (1)
TargetSystem (1)
Inheritedのデフォルト値は,現行プラットフォーム用の環境を生成する:
CreateCompilerEnvironment[]CreateCompilerEnvironment[TargetSystem -> "Linux-x86-64"]env = CreateCompilerEnvironment[TargetSystem -> {"MacOSX-x86-64", "MacOSX-ARM64"}]env[TargetSystem]Automaticの設定では,複数のコアプラットフォームが作成される:
env = CreateCompilerEnvironment[TargetSystem -> Automatic]FunctionCompileでこれを使うことができる:
comp = FunctionCompile[Function[{Typed[arg, "Integer64"]}, arg + 1], TargetSystem -> Automatic, CompilerEnvironment -> env]CompiledCodeFunctionオブジェクトには,これらすべてのプラットフォーム用のコードが含まれている:
Information[comp, "LLVMBinary"]テクニカルノート
関連するガイド
テキスト
Wolfram Research (2021), CreateCompilerEnvironment, Wolfram言語関数, https://reference.wolfram.com/language/ref/CreateCompilerEnvironment.html.
CMS
Wolfram Language. 2021. "CreateCompilerEnvironment." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CreateCompilerEnvironment.html.
APA
Wolfram Language. (2021). CreateCompilerEnvironment. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CreateCompilerEnvironment.html
BibTeX
@misc{reference.wolfram_2026_createcompilerenvironment, author="Wolfram Research", title="{CreateCompilerEnvironment}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/CreateCompilerEnvironment.html}", note=[Accessed: 12-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_createcompilerenvironment, organization={Wolfram Research}, title={CreateCompilerEnvironment}, year={2021}, url={https://reference.wolfram.com/language/ref/CreateCompilerEnvironment.html}, note=[Accessed: 12-September-2026]}