Installing OCaml on a mac m1 mini

Is it safe to install OCaml via Homebrew on macOS?

I am using a Mac Mini M1

I came across Fix Homebrew Errors on Apple M1 · OCaml Documentation, which mentions an issue with OCaml on Apple Silicon Macs related to command line tools. Does anyone know exactly what from the command line tools OCaml depends on? I ask because I’ve overridden clang with a newer version via brew (installed latest clang compiler with brew then set it via zshrc the the new path)

I would prefer not to disable Rosetta and reinstall Homebrew if I can avoid it. Instead, would the manual installation method described Install OCaml here be a better approach for my setup?

Also, looking at the Homebrew formula for OCaml on the brew repo (can only put two links in this post), it seems like it supports arm64 directly. Is the info on that OCaml page outdated? Would I encounter any issues using the Homebrew installation method on Apple Silicon?

I’ve been using OCaml with no issues on my M1 Mac since 2021. I don’t have Rosetta enabled though. If you have either Xcode or the Xcode command-line tools installed, you should be all set and just run brew install opam.

Xcode command line tools will prompt you to install if you don’t have them already, and run eg git on the command line.

1 Like

Yes, that page is outdated. OCaml, opam, and everything else should work just fine out of the box bottle.

1 Like