2017-09-19 8 views
2

내 _oasis 파일에 몇 가지 플래그 (S, 인라인 (20), nodynlink)를 추가하고 싶습니다하지만 난 컴파일 오류가 발생합니다 : 당신이를 추가하는 방법 궁금Oasis에 OCAMLOPTFLAGS를 추가하는 방법은 무엇입니까?

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 
+0

어떤 종류의 컴파일 오류가 발생합니까? –

+0

안녕하세요 @ ÉtienneMillon 오류가 추가되었습니다. – Istvan

+0

좋습니다! 그건 당신이 anwser을 찾는 데 도움이됩니다 :) –

답변

2

-cflags 옵션은 옵션의 쉼표로 구분 된 목록을 가져 와서 ocamlc 컴파일러에 전달합니다. 따라서 ocamlbuild' src/main.native -cflags -S -inline 20의 경우 -S 옵션 만 ocamlc으로 전달되고 -inline20ocamlbuild으로 간주됩니다. 그래서, ocamlc에 여러 옵션을 전달하는 올바른 방법은 다음과 같습니다 이것은 또한 그들이 ocamlopt의 옵션은 다음과 같이 -cflags 또는 -inline 옵션을 인식하지 못하는 ocamlc 때문에,하지만 실패합니다

ocamlbuild -cflags -S,-inline,20 x.byte 

. OCaml에는 두 개의 컴파일러가 있습니다. 하나는 ocamlc이고 바이트 코드는 생성하고 다른 하나는 ocamlopt 인 네이티브 코드를 생성합니다. 그들은 몇 가지 일반적인 옵션을 가지고 있지만, 일부는 분명히 공유되지 않습니다. 예를 들어, 바이트 코드 컴파일러는 어셈블리를 방출 할 수 없습니다.

당신이 _oasisNativeOpt 필드를 사용하거나 _tags 파일에 파라 메트릭 태그를 사용할 수 있습니다 ocamlopt 할 수있는 옵션 (후자는 flambda를 제어하는 ​​데 유용합니다) 전달합니다. 인식 된 태그의 실제 세트는 ocamlbuild -documentation을보십시오.