Fwiw OCaml 5 shown on the benchmarks game website

The old programs on the benchmarks game website are now built with 5.0.0.

Quite a few fail to compile:


(I’m unable to list the others because new users here are limited to 2 links.)

Help or advice with getting these programs to work will be gratefully accepted.

From the given link, replacing Array.create (deprecated) with Array.make should fix them.

Were these not showing the deprecation warnings in previous builds with older OCaml versions?

If someone wants to contribute fixes to the benchmarks, I believe that the recommended precodure (@Isaac_Gouy may give more accurate information) is:

See https://salsa.debian.org/benchmarksgame-team/benchmarksgame/-/blob/master/CONTRIBUTING.md for more detailed contribution guildelines, and OCaml regex-redux update (#460) · Issues · The Computer Language Benchmarks Game / benchmarksgame · GitLab for an example of a previous issue.

Note that we are not building the build script for the programs ourselves, and one should not assume an ocaml-standard opam+dune workflow. (Last I looked, Debian packages were installed to provide some of the required dependencies.)

Thanks! That fixed 2 of the programs: fannkuch-redux & fannkuch-redux #2

The other programs have different problems.



1 Like

That’s correct for the simple practical reason that I cannot be relied upon to correctly edit OCaml programs.

However we just fixed 2 programs because sometimes I can be relied upon to do a one word replacement :slight_smile:

Maybe some programs are not going to work with 5.0.0 just yet?

pidigits OCaml #7 uses GMP but maybe that isn’t going to work yet because:

$ opam install mlgmpidl
[ERROR] Package conflict!
  * No agreement on the version of ocaml:
    - (invariant) → ocaml-base-compiler >= 5.0.0 → ocaml = 5.0.0
    - mlgmpidl → ocaml < 4.06
    You can temporarily relax the switch invariant with `--update-invariant'
  * No agreement on the version of ocaml-base-compiler:
    - (invariant) → ocaml-base-compiler >= 5.0.0
    - mlgmpidl → ocaml < 4.06 → ocaml-base-compiler < 3.07+1
  * Missing dependency:
    - mlgmpidl → ocaml < 4.06 → ocaml-variants >= 3.09.2 → ocaml-beta
    unmet availability conditions: 'enable-ocaml-beta-repository'

This kind of error usually means that your opam repository metadata is out of date, it’s worth updating it and trying again:

opam update
opam upgrade
opam install mlgmpidl

Thanks for trying to help the clueless :wink:

$ opam upgrade
The following packages are not being upgraded because the new versions conflict
with other installed packages:
  - ocaml.5.1.0
    ∗ dune.3.6.1 is installed and requires ocaml < 4.08~~

I took a guess at what that might mean but:

$ opam upgrade ocaml
[ERROR] Package conflict!
  * Incompatible packages:
    - (invariant) → ocaml-base-compiler >= 5.0.0
    - ocaml >= 5.0.1 → ocaml-variants >= 5.0.1~

I don’t have an OCaml setup that I need to preserve, so if there’s a way to junk things and install ocaml.5.1.0 I’m completely open to that – I just need to know what to type.

Looks like mlgmpidl has been deliberately set to OCaml <5: mlgmpidl uses bigarray which is not available in ocaml5 by raphael-proust · Pull Request #22440 · ocaml/opam-repository · GitHub

Because apparently it relies on a package bigarray which is not available on OCaml 5. Although to my understanding it’s part of the core OCaml distribution. Perhaps someone else can shed some light on this.

I’m somewhat confused about why ocaml.5.1.0 is the latest but doesn’t seem available to me:

The following packages are not being upgraded because the new versions conflict
with other installed packages:
  - ocaml.5.1.0
    ∗ dune.3.6.1 is installed and requires ocaml < 4.08~~


∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
⬇ retrieved dune.3.6.1  (cached)
∗ installed ocaml-options-vanilla.1
⬇ retrieved gmp.6.2.1-4  (cached)
⬇ retrieved ocaml-base-compiler.5.0.0  (cached)
∗ installed conf-m4.1
⬇ retrieved ocamlfind.1.9.5  (cached)
⬇ retrieved re.1.10.4  (cached)
⬇ retrieved zarith.1.12  (cached)
∗ installed conf-gmp.4
Processing 30/51: [ocaml-base-compiler: make]
∗ installed ocaml-base-compiler.5.0.0
∗ installed ocaml-config.3
∗ installed ocaml.5.0.0
∗ installed base-domains.base
∗ installed base-nnp.base
∗ installed seq.base
∗ installed ocamlfind.1.9.5
∗ installed zarith.1.12
∗ installed dune.3.6.1
∗ installed re.1.10.4
Processing 50/51: [gmp: dune build]
∗ installed gmp.6.2.1-4

Most of the other programs have now been fixed.