ocamlfind: command not found
Asked Answered
A

2

7

I'm running into an issue installing a package that's reliant on ocamlfind. I'm getting an ocamlfind: command not found error when running make.

I have installed ocamlfind with the OCaml package manager and have tried reinstalling using opam reinstall ocamlfind.

I have also tried the eval opam config env command to see if it updates my bin.

The output when running make:

$ make
ocamlfind ocamlc -pp "camlp4o -I lib/dcg -I lib/ipp pa_dcg.cmo pa_ipp.cmo" -w usy -thread -I lib -I lib/dcg -I lib/ipp       -c semantics.ml
/bin/sh: ocamlfind: command not found

The output when trying ocamlfind

$ ocamlfind
-bash: ocamlfind: command not found

OCaml is installed

$ opam install ocamlfind
[NOTE] Package ocamlfind is already installed (current version is 1.5.5).

and when running the eval command

$ eval 'opam config env'
CAML_LD_LIBRARY_PATH="/home/centos/.opam/system/lib/stublibs:/usr/lib64/ocaml/stub libs"; export CAML_LD_LIBRARY_PATH;
MANPATH="/home/centos/.opam/system/man:"; export MANPATH;
PERL5LIB="/home/centos/.opam/system/lib/perl5"; export PERL5LIB;
OCAML_TOPLEVEL_PATH="/home/centos/.opam/system/lib/toplevel"; export OCAML_TOPLEVEL_PATH;
PATH="/home/centos/.opam/system/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/centos/.local/bin:/home/centos/bin"; export PATH;
Anosmia answered 1/6, 2015 at 21:59 Comment(0)
L
13

You need to run

eval `opam config env`

or using $(...) instead is the modern equivalent and avoids confusion between ' and `

eval $(opam config env)

This eval command sets the environment variables in the current shell session and exports them for use by processes run by this shell session, so it needs to be run in every shell session that needs those set, including each line of the Makefile that expects them to be set if the environment that runs make doesn't already have them set and exported.

The command you ran

eval 'opam config env'

is a typo.

Lipinski answered 2/6, 2015 at 15:20 Comment(0)
O
4

try

sudo apt-get install ocaml-findlib
Orcinol answered 27/3, 2019 at 6:37 Comment(1)
A little more explanation would have been very helpful. Giving a suggestion without a clarification or explanation is pretty much similar to giving a (side) comment.Lookout

© 2022 - 2024 — McMap. All rights reserved.