ocaml command line cannot not find “topfind”

穿精又带淫゛_ 提交于 2019-12-10 14:22:18

问题


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

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

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

This is my ~/.ocamlinit file content.

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

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'.
# 

With "ustop", I have no error message.

What might be wrong?

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;

回答1:


As stated here by samoth:

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

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



来源:https://stackoverflow.com/questions/28749035/ocaml-command-line-cannot-not-find-topfind

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!