0

Ocaml 4 では、モジュールと関数Quotationでモジュールを使用する必要があります。そのためにはライブラリ(プリプロセッサのようです)をインストールする必要があるようです。次のような Camlp に関する多くの情報が見つかりました。Quotation.addQuotation.ExStrCamlp5

しかし、インストールガイドがないので、試してみopam install camlp5ました:結果:

┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
│ λ build conf-perl-string-shellquote 1
└─ 
╶─ No changes have been performed

したがって、いくつかの依存関係が存在しないようです。私は試しopam depext --install camlp5ました:結果:

┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
│ λ build conf-perl-string-shellquote 1
└─ 
╶─ No changes have been performed
# Run eval $(opam env) to update the current shell environment

だからうまくいかないようです。

エラー診断は、両方のコマンドで同じです。


The following actions will be performed:
  ∗ install conf-perl-string-shellquote 1       [required by camlp5]
  ∗ install conf-perl-ipc-system-simple 1       [required by camlp5]
  ∗ install camlp5                      8.00.01
===== ∗ 3 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><>   
[camlp5.8.00.01] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>   
[ERROR] The compilation of conf-perl-ipc-system-simple failed at
        "/Users/.../.opam/opam-init/hooks/sandbox.sh build perl
        -MIPC::System::Simple -e 1".
[ERROR] The compilation of conf-perl-string-shellquote failed at
        "/Users/.../.opam/opam-init/hooks/sandbox.sh build perl
        -MString::ShellQuote -e 1".

#=== ERROR while compiling conf-perl-string-shellquote.1 ======================#
# context     2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#ff95b837
# path        ~/.opam/4.10.2/.opam-switch/build/conf-perl-string-shellquote.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build perl -MString::ShellQuote -e 1
# exit-code   2
# env-file    ~/.opam/log/conf-perl-string-shellquote-1585-1872ec.env
# output-file ~/.opam/log/conf-perl-string-shellquote-1585-1872ec.out
### output ###
# Can't locate String/ShellQuote.pm in @INC (you may need to install the String::ShellQuote module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras[...]
# BEGIN failed--compilation aborted.


#=== ERROR while compiling conf-perl-ipc-system-simple.1 ======================#
# context     2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#ff95b837
# path        ~/.opam/4.10.2/.opam-switch/build/conf-perl-ipc-system-simple.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build perl -MIPC::System::Simple -e 1
# exit-code   2
# env-file    ~/.opam/log/conf-perl-ipc-system-simple-1585-d2c37b.env
# output-file ~/.opam/log/conf-perl-ipc-system-simple-1585-d2c37b.out
### output ###
# Can't locate IPC/System/Simple.pm in @INC (you may need to install the IPC::System::Simple module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extra[...]
# BEGIN failed--compilation aborted.



私は数時間類似品や代替品を試してきましたが、それを達成することはできません. 何か助けはありますか?

PS1: 私は MAC で働いています。PS2:誰かが望むなら、この問題の私のコンテキストは、私にとってブラックボックスである1つのディレクトリの機能を使用したいということです.すべての例はパーサーで書かれている<<y+2=5>>ので、文法はわかりません.パーサーを実行するには達成する必要があります。

編集 1 (Ivg によって提案されたソリューション)

Ivg によって提案されたソリューションの両方のコマンドを試した後 (質問local::libの 1 つと他の質問に答えるyes)、2 番目のエラーは次のように修正されたようですopam install camlp5

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>   
┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
└─ 
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install conf-perl-string-shellquote 1
└─ 

ターミナル全体があった場所:

... ~ % opam install camlp5
The following actions will be performed:
  ∗ install conf-perl-string-shellquote 1       [required by camlp5]
  ∗ install conf-perl-ipc-system-simple 1       [required by camlp5]
  ∗ install camlp5                      8.00.01
===== ∗ 3 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><>   
[camlp5.8.00.01] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>   
[ERROR] The compilation of conf-perl-ipc-system-simple failed at
        "/Users/.../.opam/opam-init/hooks/sandbox.sh build perl
        -MIPC::System::Simple -e 1".
∗ installed conf-perl-string-shellquote.1

#=== ERROR while compiling conf-perl-ipc-system-simple.1 ======================#
# context     2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#ff95b837
# path        ~/.opam/4.10.2/.opam-switch/build/conf-perl-ipc-system-simple.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build perl -MIPC::System::Simple -e 1
# exit-code   2
# env-file    ~/.opam/log/conf-perl-ipc-system-simple-20351-1872ec.env
# output-file ~/.opam/log/conf-perl-ipc-system-simple-20351-1872ec.out
### output ###
# Can't locate IPC/System/Simple.pm in @INC (you may need to install the IPC::System::Simple module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4/darwin-thread-multi-2level /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2le[...]
# BEGIN failed--compilation aborted.

編集 2 (解決済み、繰り返し)

突然それは働いた。私はもう一度書いたsudo cpan IPC::System::Simple(今は質問はありませんでした)そしてその後、opam install conf-perl-ipc-system-simple.

とにかく、Quoationモジュールが開いていません。

4

1 に答える 1