ocaml命令行找不到"topfind" [英] ocaml command line cannot not find "topfind"

查看:123
本文介绍了ocaml命令行找不到"topfind"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了顶层服务器,并设置了$ OCAML_TOPLEVEL_PATH.

I have top-level installed, and have $OCAML_TOPLEVEL_PATH setup.

export OCAML_TOPLEVEL_PATH=/Users/smcho/.opam/system/lib/toplevel

我检查目录是否存在,并且有一个文件topfind.

I checked that the directory exists, and has one file topfind.

这是我的~/.ocamlinit文件内容.

#use "topfind"
#camlp4o
#thread
#require "core.top"
#require "core.syntax"

问题是我收到一条错误消息,提示它找不到topfind.

The issue is that I have the error message saying it can't find topfind.

> ocaml
        OCaml version 4.02.1

Cannot find file topfind.
Unknown directive `camlp4o'.
# 

使用"ustop",我没有错误消息.

With "ustop", I have no error message.

可能是什么问题?

这是我的ocaml环境设置.

This is my ocaml environment setup.

> opam config env
CAML_LD_LIBRARY_PATH="/Users/smcho/.opam/system/lib/stublibs:/usr/local/lib/ocaml/stublibs"; export CAML_LD_LIBRARY_PATH;
OPAMUTF8MSGS="1"; export OPAMUTF8MSGS;
MANPATH=":/Users/smcho/.opam/system/man"; export MANPATH;
MAKELEVEL=""; export MAKELEVEL;
MAKEFLAGS=""; export MAKEFLAGS;
PERL5LIB="/Users/smcho/.opam/system/lib/perl5:"; export PERL5LIB;
OCAML_TOPLEVEL_PATH="/Users/smcho/.opam/system/lib/toplevel"; export OCAML_TOPLEVEL_PATH;
PATH="..."; export PATH;

推荐答案

如所述

如果您不使用 系统编译器.如果使用系统编译器,则可以修改 您〜/.ocamlinit来完成$ OCAML_TOPLEVEL_PATH的加载 https://github.com/OCamlPro/opam/blob/master/shell/dot_ocamlinit

Normally this issue does not exist anymore if you are not using the system compiler. If you are using the system compiler, you can modify you ~/.ocamlinit to load $OCAML_TOPLEVEL_PATH as done in https://github.com/OCamlPro/opam/blob/master/shell/dot_ocamlinit

因此您可以使用其他开关或修改您的.ocamlinit.

So you can either use a different switch or modify your .ocamlinit.

这篇关于ocaml命令行找不到"topfind"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆