0
votes

I built and install OCAML on my Mac and wanted run an ocaml binary file namely test So I did ./test and I got:

-bash: ./test: /home/linkenhe/usr/local/godi/bin/ocamlrun: bad interpreter: No such file or directory

How should I fix it?

Thanks

1

1 Answers

0
votes

The file test is a bytecode file, not a binary file.

Where did you get the file test? The problem is that it's looking for the OCaml bytecode interpreter in the wrong place.

If you have installed OCaml, you should have a program named ocamlrun. You should check that you do. If so, you can run test like this:

# Test that ocamlrun exists
$ which ocamlrun
/usr/local/bin/ocamlrun

# Use it to run bytecode.
$ ocamlrun test