1

私はここで問題を抱えています。それは本当に気が狂います。私は OCaml を使ったことはありません。OCaml についても、どのように機能するかも知りません。

問題: camlidl ライブラリをインストールする必要があります。私はopam(opam install camlidl)を介してそれを行いました。

前に言ったように、私は OCaml について何も知りません。ocamlfind list、パッケージリストを表示しませんでした。eval $'opam config eval'ネットを検索しました-ランニングが役立つことがわかりました。

奇妙なことに (理由はわかりません) ocamlfind はこのコマンドの実行後にパッケージを表示できましたが、(!) 実行sudo ocamlfind listすると、このパッケージのないリストが表示されます。

なぜこれが起こっているのか、これを修正する方法を理解するのを手伝ってくれる人はいますか? camlidl を必要とするものをコンパイルする必要があり、sudo の下で実行する必要があります。

前もって感謝します!

実行ocamlfind list

bigarray            (version: [distributed with Ocaml])
bytes               (version: [OCaml strictly before 4.02])
camlidl             (version: 1.05)
camlp4              (version: [distributed with Ocaml])
camlp4.exceptiontracer (version: [distributed with Ocaml])
camlp4.extend       (version: [distributed with Ocaml])
camlp4.foldgenerator (version: [distributed with Ocaml])
camlp4.fulllib      (version: [distributed with Ocaml])
camlp4.gramlib      (version: [distributed with Ocaml])
camlp4.lib          (version: [distributed with Ocaml])
camlp4.listcomprehension (version: [distributed with Ocaml])
camlp4.locationstripper (version: [distributed with Ocaml])
camlp4.macro        (version: [distributed with Ocaml])
camlp4.mapgenerator (version: [distributed with Ocaml])
camlp4.metagenerator (version: [distributed with Ocaml])
camlp4.profiler     (version: [distributed with Ocaml])
camlp4.quotations   (version: [distributed with Ocaml])
camlp4.quotations.o (version: [distributed with Ocaml])
camlp4.quotations.r (version: [distributed with Ocaml])
camlp4.tracer       (version: [distributed with Ocaml])
compiler-libs       (version: [distributed with Ocaml])
compiler-libs.bytecomp (version: [distributed with Ocaml])
compiler-libs.common (version: [distributed with Ocaml])
compiler-libs.optcomp (version: [distributed with Ocaml])
compiler-libs.toplevel (version: [distributed with Ocaml])
dynlink             (version: [distributed with Ocaml])
findlib             (version: 1.5.5)
graphics            (version: [distributed with Ocaml])
labltk              (version: [distributed with Ocaml])
num                 (version: [distributed with Ocaml])
num-top             (version: 1.5.5)
num.core            (version: [internal])
oUnit               (version: 2.0.0)
oUnit.advanced      (version: 2.0.0)
oUnit.threads       (version: 2.0.0)
ocamlbuild          (version: [distributed with Ocaml])
ocamlgraph          (version: 1.8.6)
stdlib              (version: [distributed with Ocaml])
str                 (version: [distributed with Ocaml])
threads             (version: [distributed with Ocaml])
threads.posix       (version: [internal])
threads.vm          (version: [internal])
unix                (version: [distributed with Ocaml])

実行sudo ocamlfind list

bigarray            (version: [distributed with Ocaml])
camlp4              (version: [distributed with Ocaml])
camlp4.exceptiontracer (version: [distributed with Ocaml])
camlp4.extend       (version: [distributed with Ocaml])
camlp4.foldgenerator (version: [distributed with Ocaml])
camlp4.fulllib      (version: [distributed with Ocaml])
camlp4.gramlib      (version: [distributed with Ocaml])
camlp4.lib          (version: [distributed with Ocaml])
camlp4.listcomprehension (version: [distributed with Ocaml])
camlp4.locationstripper (version: [distributed with Ocaml])
camlp4.macro        (version: [distributed with Ocaml])
camlp4.mapgenerator (version: [distributed with Ocaml])
camlp4.metagenerator (version: [distributed with Ocaml])
camlp4.profiler     (version: [distributed with Ocaml])
camlp4.quotations   (version: [distributed with Ocaml])
camlp4.quotations.o (version: [distributed with Ocaml])
camlp4.quotations.r (version: [distributed with Ocaml])
camlp4.tracer       (version: [distributed with Ocaml])
compiler-libs       (version: [distributed with Ocaml])
compiler-libs.bytecomp (version: [distributed with Ocaml])
compiler-libs.common (version: [distributed with Ocaml])
compiler-libs.optcomp (version: [distributed with Ocaml])
compiler-libs.toplevel (version: [distributed with Ocaml])
dynlink             (version: [distributed with Ocaml])
findlib             (version: 1.4.1)
graphics            (version: [distributed with Ocaml])
labltk              (version: [distributed with Ocaml])
num                 (version: [distributed with Ocaml])
num-top             (version: 1.4.1)
num.core            (version: [internal])
oUnit               (version: 2.0.0)
oUnit.advanced      (version: 2.0.0)
oUnit.threads       (version: 2.0.0)
ocamlbuild          (version: [distributed with Ocaml])
ocamlgraph          (version: 1.8.5)
stdlib              (version: [distributed with Ocaml])
str                 (version: [distributed with Ocaml])
threads             (version: [distributed with Ocaml])
threads.posix       (version: [internal])
threads.vm          (version: [internal])
unix                (version: [distributed with Ocaml])

実行opam

Installed packages for system:
base-bigarray   base  Bigarray library distributed with the OCaml compiler
base-threads    base  Threads library distributed with the OCaml compiler
base-unix       base  Unix library distributed with the OCaml compiler
camlidl         1.05  Stub code generator for OCaml
ocamlfind      1.5.5  A library manager for OCaml
ocamlgraph     1.8.6  A generic graph library for OCaml
ounit          2.0.0  Unit testing framework loosely based on HUnit. It is similar to JUnit, and other XUnit testing frameworks

の実行sudo -i opam list

Installed packages for system:
base-bigarray   base  Bigarray library distributed with the OCaml compiler
base-threads    base  Threads library distributed with the OCaml compiler
base-unix       base  Unix library distributed with the OCaml compiler
camlidl         1.05  Stub code generator for OCaml
4

1 に答える 1

1

eval $(opam config env)ライブラリを見つけるのに役立つ変数を環境に入力しますocamlfind。Python での PIP の仮想環境を参照してください。

ユーザー アカウントでこのコマンドを評価する場合、root を含む他のユーザーには表示されないように、ユーザーに対してのみ環境を設定します。さらに、通常、ocaml パッケージはシステム全体ではなく、ユーザー ローカル モードでインストールします。

あなたの問題を解決するには、OCaml インフラストラクチャを深く掘り下げることなく、次のことをお勧めします。

  1. 可能であれば、使用しないでくださいsudosudo実際、コンパイルに使用する理由はわかりません。インストールにのみ必要な場合があります。したがって、 と を使用makesudo make installます。makeすでに実行している場合、誤って実行するとsudoルート所有者の下にファイルが作成される可能性があるため、すべてを削除して最初からやり直す必要があります。

  2. それが不可能な場合 (パッケージ ビルド システムが非常に壊れている)、root ユーザーの下で opam をインストールしてみてくださいsudo su -

于 2015-04-21T17:55:05.023 に答える