Reputation: 244
So I'm running Mac OS X Yosemite 10.10.5. I need to use OCaml 3.08.3 to run someone else's code (the code won't run with the latest version of OCaml...), and I downloaded the .dmg file here. The installation seemed to be fine, but whenever I run the command 'ocaml' in Terminal, I get
-bash: /usr/local/bin/ocaml: /usr/local/bin/ocamlrun: bad interpreter: Bad CPU type in executable
Anyone know what's up? Would greatly appreciate any help.
Upvotes: 0
Views: 975
Reputation: 35210
The version that you downloaded works only for Mac OS X 10.3 (Panther). It might work for some other versions, but it is not guaranteed. In MacOS, binaries compiled for one version, are often not compatible with other versions.
If you need a version of OCaml for which there is no binary distribution, you can always build it yourself, either manually (the hard way), or via the OPAM system.
Alternative solutions would be using Docker or a virtual machine.
Also, the code that you're trying to compile doesn't really need exactly 3.08. It compiles perfectly fine on any version of a compiler, up to 4.04. The problem is that in a build system a fatal warning flag is turned on so that all warnings are translated to errors (a very bad practice of distributing software, I would like to say). The good news is that it can be easily fixed, just open Makefile
in a text editor, and remove all occurrences of the following string -warn-error A
.
Upvotes: 3