31 May 2008 @ 8:00 上午 
 

F# 编译器参数说明 (fsc –full-help)

 

fsc --full-help

MSR F# Compiler, (c) Microsoft Corporation, All Rights Reserved

F# Version 1.9.4.17, compiling for .NET Framework Version v2.0.50727

Usage: fsc <options> [imported.dll ... ] [file1.ml [file2.ml ...] ]

基本选项:

  -I <string>: 指定包含的路径目录.

  -r <string>: 引用 F# 或 .NET 程序集.

  -R <string>: 引用 F# 或 .NET 程序集并复制到本地.

  -o <string>: 命名输出文件.

  -a: 生成 DLL.

  -g: 生成调试文件. 如果未指定 -O 时禁用优化.

  --define <string>: 定义给定的条件编译符号.

  -i: 输出程序集的推导接口.

  -doc <string>: 将程序集的 XML 文档写入指定文件.

  -Ooff: 禁用所有的优化, 包括 JIT.

  -O0: 允许 JIT 优化.

  -O1: 允许 JIT 和本地优化.

  -O: 类似 -O2 (未使用 -g 时的默认值)

  -O2: 类似 -O1, 允许跨模块优化.

  -O3: 类似 -O2, 增加内置和对 lambda 表达式的优化.

  --no-mllib:

        不引用 FSharp.Compatibility.dll 或

        open Microsoft.FSharp.Compatibility.OCaml.Pervasives,

        当希望避开对该模块的依赖时很有用.

  --all-warnings: 输出全部警告.

  --no-warnings: 不输出警告.

  --warn <int>: 报告指定的警告.

  --no-warn <string>: 不报告指定的警告.

  --all-warnings-as-errors: 将全部警告视为错误.

  --warn-as-error <int>: 将指定的警告视为错误.

  --gnu-style-errors: 输出 GNU 风格的带行号的错误.

  --namespace <string>:

        定义默认的根命名空间, 包括后来定义的 F# 子模块.

  --open <string>:

        打开指定模块作为每个源文件的初始定义.

  --fullpaths: 编译器生成完整的路径描述.

  --clr-root <string>:

        用于取代编译器寻找 mscorlib.dll 和构造组件的路径. 通常用于

        --cli-version, 编译 Silverlight 或 .NET Compact Framework

  --ml-compatibility: 忽略 OCaml 兼容性警告.

  --ml-keywords:

        将 F# 中不属于 OCaml 的关键字视为标识符.

  --copy-local <string>:

        定位搜索路径中的指定文件, 复制到本地(例如 PDB).

  --compiling-fslib: <internal use only>

  --compiling-mllib: <internal use only>

  --generate-interface-file <string>:

        输出程序集的推导接口到文件.

  --target-exe: 生成命令行可执行文件.

  --target-winexe: 生成不带 stdin/stdout/stderr 的可执行文件.

  --target-dll: 生成 DLL

  --target-module: 生成模块, 用于添加到另一个程序集.

  --auto-resolve: 自动引用 DLLs, 根据名称匹配需要的 F# 模块或命名空间. 实验性.

  -c: 编译成模块 (--target-module) 并且自动解析 (--auto-resolve). 实验性.

  --standalone:

        静态链接 F# 库和所有涉及依赖 F# 库的 DLLs 到生成的程序集. 禁止生成 F#

        接口并优化资源, 同时重命名所有 Microsoft.FSharp 开头的类型, 把它们

        置于目标程序集的内部. 静态链接的程序集中类型名不能重复, 也不能使用代码

        映射程序集中的类型, 并且也不能使用代码暴露 F# 库类型作为 API.

  --static-link <string>:

        静态链接给定的程序集和所有涉及到的 DLLs.

        注意: 使用程序集名称 例如 mylib, 而不是 DLL 名称 例如 mylib.dll.

  --keyfile <string>:

        用给定的 key 文件注册程序集, 就像用 .NET Framework SDK 中的 'sn.exe'

        工具一样. 它为程序集生成强名称. 这仅在生成在不同目录程序之间共享的

        同一程序集时有用, 例如安装到 GAC (Global Assembly Cache).

  --public-keyfile <string>:

        使用给定的公开 key 文件延迟注册. 程序集随后可以使用 .NET Framework SDK

        中的 'sn.exe' 完成注册.

  --retargetable <string>: 指定程序集可以引用 retargetable 形式. 用于创建独立于

        引用 DLLs 发行者的二进制文件.

  --win32res <string>: 指定 Win32 资源文件 (.res)

  --platform <string>: 限定代码可以在哪种平台上运行:

                x86

                anycpu

        默认是 anycpu. 其他平台限制规则尚不可用 如 x64 和 Itanium.

  --resource <string>: 嵌入指定的托管资源 (.resource).

        可以使用 resgen.exe 或 resxc.exe 从 .resx 文件生成 .resource 文件.

  --link-resource <string>:

        链接指定的托管资源文件 (.resource).

        格式类似于 <file>[,<stringname>[,public|private]].

        可以使用 resgen.exe 从 .resx 文件生成 .resource 文件.

  --base-address <string>: 用于创建库的基础地址.

  --version-file <string>:

  --version <string>:

        为产生的 .NET 程序集产生版本号 (例如 1.2.0.1).

  --cli-version <string>:

        为指定的 CLI 版本产生代码, 不理会在编译时所安装的运行时 CLI.

        当前版本的 F# 可用值如下:

                1.0

                1.1

                2.0

                创建标签例如 v2.0.x86chk

        你还需要把正确的 Framework 目录添加到包含路径中

                --clr-root \WINDOWS\Microsoft.NET\Framework\v1.1.4322

        当然还需要对你的二进制文件运行适当版本的检验, 例如

                C:\Program Files\Microsoft Visual Studio .NET 2003

                \SDK\v1.1\Bin\PEVerify.exe

        以确保你和你导入的库没有使用指定 .NET Framework 版本之外的特性.

  --clr-mscorlib <string>:

        指定目标 CLR 上的 mscorlib

  --debug-file <string>:

        命名 debug 输出文件.

  --generate-debug-file:

  --no-debug-file:

        控制是否产生 debug 信息. 与 -g 不同, 它默认不关闭优化.

  --generate-html:

        生成 HTML 文档.

  --html-output-directory <string>:

        输出 HTML 的目录.

  --html-css <string>:

        设置 HTML 文档的 CSS (Cascading Style Sheet).

  --html-namespace-file <string>:

        设置主要的 namespaces.html 文件名称, 假定在输出目录.

  --html-namespace-file-append:

        当生成 HTML 文档时附加到主要的命名空间文件.

  --no-optimization-data:

        仅包括必要的实现内部结构的优化信息. 抑制内部跨模块可以改善二进制兼容性.

  --generate-optimization-data-file:

        将优化信息放入一个 .optdata 文件

  --no-interface-data:

        不将资源添加到产生的程序集当中, 包括用于其他 F# 程序集的接口数据. 程序集

        只能被 .NET 程序集访问.

  --quotation-data:

        这一标志已过时. 代之使用 'ReflectedDefinition' 属性.

  --generate-config-file:

        生成配置文件确保 .exe 运行在 --cli-version 指定的版本上. 文件包含

        'supportedRuntime' XML 元素.

  --jit-optimize:

  --no-jit-optimize:

  --local-optimize:

  --no-local-optimize:

  --cross-optimize:

  --no-cross-optimize:

        细微深入的控制 JIT 本地和跨模块.

  --fast-sublanguage-only:

        限制 F# 语言中很难有效编译的细微规则结构, 为编译器争得更多的优化机会.

        配合下面所有的 --no-ABC 标志. 能显著改善性能.

  --no-inner-polymorphism:

        不允许内部绑定到真正的泛型.

  --permit-inner-polymorphism:

  --no-string-interning: 运行时不保留编译的字符串常量.

  --statistics: 显示编译器统计.

  --progress: 显示编译器进度.

  --no-framework:

        默认不引用 .NET Framework assemblies 程序集.

  --sscli:

        强迫编译器寻找并使用路径中的 SSCLI , 取代 Microsoft CLI.

        生成的调试信息也是 SSCLI 格式的.

  --max-errors <int>: <internal use>

  --generate-filter-blocks:

        生成过滤块以允许第一时间捕获未处理的异常.

  --stamps: <internal use>

  --ranges: <internal use>

  --terms: <internal use>

  --termsfile: <internal use>

  --ilfiles: <internal use>

  --times: <internal use>

  --detuple <int>: <internal use>

  --tlr <int>: <internal use>

  --tlrlift <int>: <internal use>

  --no-env: <internal use>

  --parse-only: <internal use only>

  --typecheck-only: <internal use only>

  --ast: <internal use only>

  --tokenize: <internal use only>

  --testInteractionParser: <internal use only>

  --light: <experimental use only>

  --lightoff: <experimental use only>

  --inline-threshold <int>: <internal use only>

  --extra-optimization-loops <int>: <internal use only>

  --generics:

  --no-generics:

        细微调节是否生成 .NET CLR 通用支持的代码.

  --all-tailcalls:

  --no-tailcalls:

        细微调节是否发出尾部调用注解.

  --closures-as-virtuals:

        细微调节关闭实现.

  --multi-entrypoint-closures:

Tags Tags:
Categories: 编程
Posted By: colder
Last Edit: 31 May 2008 @ 09 18 上午

E-mailPermalink
 

Responses to this post » (None)

 


Comments are open. Feel free to leave a comment below.


 

Leave A Comment ...

 

 XHTML:
You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
\/ More Options ...
Change Theme...
  • Role »
  • Posts »
  • Comments »
Change Theme...
  • VoidVoid (Default)
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LiteLightweight
  • No Child Pages...