Trying to install opam on a new iMac M4

I hit multiple issues :

1/ after a fresh install of multiple packages (dune ocaml alcotest benchmark calendars camlp5 camlp-streams …) I get :

henri@henris-imac geneweb % eval $(opam env)
henri@henris-imac geneweb % opam install qcheck-alcotest lwt_ppx tls js_of_ocaml-ppx ojs httpun-ws
[WARNING] Opam package conf-gmp.5 depends on the following system package that can no longer be found: gmp
[NOTE] Package httpun-ws is already installed (current version is 0.2.0).
[NOTE] Package ojs is already installed (current version is 1.1.6).
[NOTE] Package js_of_ocaml-ppx is already installed (current version is 6.2.0).
[NOTE] Package tls is already installed (current version is 2.0.3).
[NOTE] Package lwt_ppx is already installed (current version is 5.9.2).
[NOTE] Package qcheck-alcotest is already installed (current version is 0.27).
henri@henris-imac geneweb % dune build
zsh: bad CPU type in executable: dune

2/ reinstalled ocaml a couple of times.
I now get

henri@henris-imac geneweb % ocaml configure.ml
Cannot find file /Users/henri/github/hgouraud/geneweb/_opam/lib/ocaml/unix.cma.

[WARNING] Opam package conf-gmp.5 depends on the following system package that can no longer be found: gmp

This seems strange to me. It is a warning from opam when interfacing with the system package manager. :thinking:

Have you installed homebrew or macports on your mac? On homebrew, for example, the package should still be named gmp AFAICS: gmp — Homebrew Formulae

thanks for your answer.

After several tries, things finally fell in place.

I cant say that I understood everything, but opam now performs correctly

cheers

I saw similar bugs in a student’s machine zsh: bad CPU and it turns out that he downloaded the x86-version vscode, rather than macOS darwin’s.

zsh will inherit some architecture settings from the parent process. If the terminal application or the editor is incorrect, it may complain on this.

1 Like