如何将OCAMLOPTFLAGS添加到Oasis?
我想在我的_oasis文件中添加几个标志(S、inline 20、nodynlink),但出现编译错误:如何将OCAMLOPTFLAGS添加到Oasis?,ocaml,oasis,Ocaml,Oasis,我想在我的_oasis文件中添加几个标志(S、inline 20、nodynlink),但出现编译错误: AlphaFeatures: ocamlbuild_more_args XOCamlbuildExtraArgs: "-cflags '-S -inline 20'" 我想知道你如何添加这些 相当长的错误是: node:dir user$ make ocaml setup.ml -build /Users/user/.opam/system/bin/ocamlbuild: unknown
AlphaFeatures: ocamlbuild_more_args
XOCamlbuildExtraArgs: "-cflags '-S -inline 20'"
我想知道你如何添加这些
相当长的错误是:
node:dir user$ make
ocaml setup.ml -build
/Users/user/.opam/system/bin/ocamlbuild: unknown option '-inline'.
Usage /Users/user/.opam/system/bin/ocamlbuild [options] <target>
-version Display the version
--version same as -version
-vnum Display the version number
--vnum same as -vnum
-quiet Make as quiet as possible
-verbose <level> Set the verbosity level on a scale from 0 to 8 (included)
-documentation Show rules and flags
-log <file> Set log file
-no-log No log file
-clean Remove build directory and other files, then exit
-r Traverse directories by default (true: traverse)
-I <path> Add to include directories
-Is <path,...> (same as above, but accepts a (comma or blank)-separated list)
-X <path> Directory to ignore
-Xs <path,...> (idem)
-lib <flag> Link to this ocaml library
-libs <flag,...> (idem)
-mod <module> Link to this ocaml module
-mods <module,...> (idem)
-pkg <package> Link to this ocaml findlib package
-pkgs <package,...> (idem)
-package <package> (idem)
-syntax <syntax> Specify syntax using ocamlfind
-lflag <flag> Add to ocamlc link flags
-lflags <flag,...> (idem)
-cflag <flag> Add to ocamlc compile flags
-cflags <flag,...> (idem)
-docflag <flag> Add to ocamldoc flags
-docflags <flag,...> (idem)
-yaccflag <flag> Add to ocamlyacc flags
-yaccflags <flag,...> (idem)
-lexflag <flag> Add to ocamllex flags
-lexflags <flag,...> (idem)
-ppflag <flag> Add to ocaml preprocessing flags
-pp <flag,...> (idem)
-tag <tag> Add to default tags
-tags <tag,...> (idem)
-plugin-tag <tag> Use this tag when compiling the myocamlbuild.ml plugin
-plugin-tags <tag,...> (idem)
-tag-line <tag> Use this line of tags (as in _tags)
-show-tags <path> Show tags that applies on that pathname
-ignore <module,...> Don't try to build these modules
-no-links Don't make links of produced final targets
-no-skip Don't skip modules that are requested by ocamldep but cannot be built
-no-hygiene Don't apply sanity-check rules
-no-plugin Don't build myocamlbuild.ml
-no-stdlib Don't ignore stdlib modules
-dont-catch-errors Don't catch and display exceptions (useful to display the call stack)
-just-plugin Just build myocamlbuild.ml
-byte-plugin Don't use a native plugin but bytecode
-plugin-option Use the option only when plugin is run
-sanitization-script Change the file name for the generated sanitization script
-no-sanitize Do not generate sanitization script
-nothing-should-be-rebuilt Fail if something needs to be rebuilt
-classic-display Display executed commands the old-fashioned way
-use-menhir Use menhir instead of ocamlyacc
-use-jocaml Use jocaml compilers instead of ocaml ones
-use-ocamlfind Use the 'ocamlfind' wrapper instead of using Findlib directly to determine command-line arguments. Use -no-ocamlfind to disable. Implies -plugin-use-ocamlfind.
-no-ocamlfind Don't use ocamlfind. Implies -plugin-no-ocamlfind.
-plugin-use-ocamlfind Use the 'ocamlfind' wrapper for building myocamlbuild.ml
-plugin-no-ocamlfind Don't use ocamlfind for building myocamlbuild.ml
-toolchain <toolchain> Set the Findlib toolchain to use. The default toolchain is always used for building myocamlbuild.ml.
-j <N> Allow N jobs at once (0 for unlimited)
-build-dir <path> Set build directory (implies no-links)
-install-lib-dir <path> Set the install library directory
-install-bin-dir <path> Set the install binary directory
-where Display the install library directory
-which <command> Display path to the tool command
-ocamlc <command> Set the OCaml bytecode compiler
-plugin-ocamlc <command> Set the OCaml bytecode compiler used when building myocamlbuild.ml (only)
-ocamlopt <command> Set the OCaml native compiler
-plugin-ocamlopt <command> Set the OCaml native compiler used when building myocamlbuild.ml (only)
-ocamldep <command> Set the OCaml dependency tool
-ocamldoc <command> Set the OCaml documentation generator
-ocamlyacc <command> Set the ocamlyacc tool
-menhir <command> Set the menhir tool (use it after -use-menhir)
-ocamllex <command> Set the ocamllex tool
-ocamlmklib <command> Set the ocamlmklib tool
-ocamlmktop <command> Set the ocamlmktop tool
-ocamlrun <command> Set the ocamlrun tool
-- Stop argument processing, remaining arguments are given to the user program
-help Display this list of options
--help Display this list of options
E: Failure("Command ''/Users/user/.opam/system/bin/ocamlbuild' src/main.native -cflags -S -inline 20 -tag debug' terminated with error code 1")
make: *** [build] Error 1
节点:dir用户$make
ocaml setup.ml-生成
/Users/user/.opam/system/bin/ocamlbuild:未知选项'-inline'。
用法/Users/user/.opam/system/bin/ocamlbuild[选项]
-版本显示版本
--版本与-版本相同
-vnum显示版本号
--vnum与-vnum相同
-使尽可能安静
-详细设置从0到8(包括)的详细级别
-文档显示规则和标志
-日志集日志文件
-没有日志没有日志文件
-清除删除生成目录和其他文件,然后退出
-默认情况下为r遍历目录(true:遍历)
-我添加了一个目录
-是(同上,但接受(逗号或空白)分隔列表)
-要忽略的X目录
-Xs(idem)
-指向此ocaml库的lib链接
-libs(idem)
-指向此ocaml模块的mod链接
-mods(idem)
-指向此ocaml findlib包的pkg链接
-包装件(idem)
-包(idem)
-语法使用ocamlfind指定语法
-lflag添加到ocamlc链接标志
-lflags(idem)
-cflag添加到ocamlc编译标志
-cflags(idem)
-docflag添加到ocamldoc标志
-docflags(idem)
-yaccflag添加到ocamlyacc标志
-yaccflags(idem)
-lexflag添加到ocamlex标志
-lexflags(idem)
-ppflag添加到ocaml预处理标志
-pp(idem)
-标记添加到默认标记
-标签(idem)
-插件标记在编译myocamlbuild.ml插件时使用此标记
-插件标签(idem)
-标记行使用此标记行(如在_标记中)
-显示标记显示应用于该路径名的标记
-忽略—不要尝试构建这些模块
-没有链接不会生成最终目标的链接
-不跳过不跳过ocamldep请求但无法生成的模块
-不卫生不适用卫生检查规则
-没有插件不生成build.ml
-没有stdlib不要忽略stdlib模块
-不捕获错误不捕获并显示异常(用于显示调用堆栈)
-只需插件只需build.ml
-字节插件不使用本机插件,而是使用字节码
-插件选项仅在插件运行时使用该选项
-清理脚本更改生成的清理脚本的文件名
-无清理不生成清理脚本
-如果需要重建某些东西,则不应重建失败
-经典的显示以老式的方式执行命令
-使用menhir使用menhir而不是ocamlyacc
-使用jocaml使用jocaml编译器而不是ocaml编译器
-使用ocamlfind使用“ocamlfind”包装,而不是直接使用Findlib来确定命令行参数。使用-no-ocamlfind可禁用。暗示-插件使用ocamlfind。
-不使用ocamlfind不使用ocamlfind。暗示-插件没有ocamlfind。
-插件使用ocamlfind使用“ocamlfind”包装器构建myocamlbuild.ml
-插件no ocamlfind不使用ocamlfind构建myocamlbuild.ml
-工具链设置要使用的Findlib工具链。默认的工具链始终用于生成build.ml。
-j一次允许N个作业(0表示无限制)
-生成目录设置生成目录(表示没有链接)
-install lib dir设置安装库目录
-install bin dir设置安装二进制目录
-其中显示安装库目录
-哪个显示刀具命令的路径
-ocamlc设置OCaml字节码编译器
-插件ocamlc设置构建myocamlbuild.ml时使用的OCaml字节码编译器(仅限)
-ocamlopt设置OCaml本机编译器
-插件ocamlopt设置构建myocamlbuild.ml时使用的OCaml本机编译器(仅限)
-ocamldep设置OCaml依赖项工具
-ocamldoc设置OCaml文档生成器
-ocamlyacc设置ocamlyacc工具
-menhir设置menhir工具(在使用menhir后使用它)
-ocamlex设置ocamlex工具
-ocamlmklib设置ocamlmklib工具
-ocamlmktop设置ocamlmktop工具
-ocamlrun设置ocamlrun工具
--停止参数处理,剩余参数将提供给用户程序
-帮助显示此选项列表
--帮助显示此选项列表
E:失败(“命令'/Users/user/.opam/system/bin/ocamlbuild'src/main.native-cflags-S-inline 20-tag debug'终止,错误代码为1”)
生成:**[build]错误1
-cflags
选项采用逗号分隔的选项列表,并将其传递给ocamlc
编译器。因此,在ocamlbuild'src/main.native-cflags-S-inline 20
中,只有-S
选项被传递给ocamlc
,而-inline
和20
由ocamlbuild
本身执行。因此,将多个选项传递给ocamlc
的正确方法是:
ocamlbuild -cflags -S,-inline,20 x.byte
但是,这也会失败,因为ocamlc
无法识别-cflags
或-inline
选项