Installation 在Ocaml中,Camlp5未安装(需要使用报价)

Installation 在Ocaml中,Camlp5未安装(需要使用报价),installation,ocaml,opam,quotations,camlp4,Installation,Ocaml,Opam,Quotations,Camlp4,在OCAML4中,我必须在其quote.add和quote.ExStr函数上使用quote模块。似乎我必须安装Camlp5库(似乎是一个预处理器)才能这样做。找到了许多关于Camlp的信息,如: Camlp5: Camlp5: Camlp4: 但是没有安装指南,所以我尝试:opam安装camlp5,结果是: ┌─ The following actions failed │ λ build conf-perl-ipc-system-simple 1 │ λ build conf-perl-s

在OCAML4中,我必须在其
quote.add
quote.ExStr
函数上使用
quote
模块。似乎我必须安装
Camlp5
库(似乎是一个预处理器)才能这样做。找到了许多关于Camlp的信息,如:

  • Camlp5:
  • Camlp5:
  • Camlp4:
但是没有安装指南,所以我尝试:
opam安装camlp5
,结果是:

┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
│ λ build conf-perl-string-shellquote 1
└─ 
╶─ No changes have been performed
┌─ 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
所以有些依赖项似乎不存在,我尝试过:
opam depenxt——安装camlp5
,结果是:

┌─ The following actions failed
│ λ build conf-perl-ipc-system-simple 1
│ λ build conf-perl-string-shellquote 1
└─ 
╶─ No changes have been performed
┌─ 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 ><><><><><><><><><><><><><><><><><><><><><><><><><><>  The error messages are indicating that your perl installation is missing two modules, 
String::ShellQuote
and
IPC::System::Simple
. Since
opam
don't know how to do this on macOS (there are too many options) it just indicates that those modules are missing and required for camlp5 installation so it can't proceed. It is now your move and you need to figure out how to make those two modules available for your perl installation.

You can try and use CPAN for that, e.g., (
sudo
might not be necessary, depending on your configuration)

 sudo cpan IPC::System::Simple
 sudo cpan String::ShellQuote

将执行以下操作:
∗ 安装conf perl字符串shellquote 1[camlp5需要]
∗ 安装conf perl ipc system simple 1[camlp5需要]
∗ 安装camlp5 8.00.01
=====∗ 3 =====
你想继续吗?[Y/n]Y

收集源代码>错误消息表明您的安装缺少两个模块,
String::ShellQuote
IPC::System::Simple
。由于
opam
不知道如何在macOS上执行此操作(选项太多),它只是表示缺少这些模块,并且需要安装camlp5,因此无法继续。现在是您的行动,您需要弄清楚如何使这两个模块可用于perl安装

您可以尝试使用,例如(
sudo
可能不需要,具体取决于您的配置)


您缺少实际的错误消息。在您的输出中。您显示的消息只是默认的opam消息,表明任务失败。要获取有趣的内容,需要向上滚动。考虑到它在安装系统包时失败,我建议您安装Homebrew并确保它工作正常,然后再试一次。我已经用整条信息更新了信息。另外,我已经有了自制软件,所以我已经完成了
brew安装camlp5
,该软件已经成功安装。然后我打开了顶层编写
ocaml
。然后,我都做了
开放式报价
开放式Camlp5
,但没有人工作。嗨!我已经完成了这两个命令,并且至少有一个依赖项似乎已经修复(您可以在编辑中看到),非常感谢!我会继续努力的。好吧,突然它起作用了。我再次编写了
sudo cpan IPC::System::Simple
(现在没有问题了),然后,
opam安装conf perl IPC System Simple
。现在我来看看模块是否工作,但看起来不错。我无法让模块运行(即,
openquote
不工作,但它似乎是一个更复杂的加载),但无论如何,我在这里发布的问题已经解决(编辑问题的第2部分)。