[ann] tutorial about compiling ocaml-5 on a ChromeBook with Crostini

Hello dear list,
I wrote another mini-tutorial to explain how to compile ocaml-5 on a chromebook with crostini:
http://decapode314.free.fr/ocaml2/tut/tut-ocaml-5/tut-ocaml-5.html
The trick to compile ocaml-5 in this environement was the same than to compile ocaml-4 in the same environement because ln -s doesn’t seem to produce the expected result.
At the beginning I edited the Makefile to replace the ln -s commands by cp commands, but an easier way is to use the make feature that permits you to change the value of one of the variable from the command line which invokes make, like this make LN=cp.

With this trick everything was producing the expected ocaml tools with ocaml-4, but with ocaml-5, I have only been able to get ocamlnat and ocamlopt tools (which is enough.)

ocamlopt was installed as expected by the make install command, but ocamlnat had to be copied by hand.

If the command ocaml produces an error (cannot execute), in scripts I can still replace:

#!/usr/bin/env ocaml

by:

#!/usr/bin/env ocamlnat

By defining the same environement variables than opam I can get two different ocaml version usable at the same time, one 4 version, and a 5 version, next to each other at the same time, without using opam because opam grew up a lot, and in a crostini environement we quickly lack of space.

PS: If someone want to help finding how to get the ocaml and ocamlc commands functioning, the help will be wellcome, and I will update this mini-tutorial.

Hello, I’ve been building OCaml on chromebooks for a number of years now, and don’t remember any problems with “ln” ? I’m using the “Linux Development Environment”, which I think is the same as Crostini? My machine is up-to-date (as of last night), and it’s an HP x360 14 (hence, intel).

Is there some difference between our machines? I’ve never had to do anything special to get OCaml to work on this machine (or the previous HP x360 chromebooks I’ve had – and I’ve had several).

This is an Asus, I made several Powerwash to get it as its initial state, and I also re-installed Crostini several times.

  • ln -s never works.
  • Creating .tar.gz archives also doesn’t work, this is why now my releases/snapshots are in .zip only on my website.

I have been able to build ocaml-4 replacing ln -s by cp, but with ocaml-5 I only get ocamlnat (which is not even installed by make install), and the default toplevel ocaml and ocamlc dont work. I only have ocamlnat and ocamlopt, as explained in the tutorial.

If someone knows how to fix, I will update the tutorial.

Oh wow. Can you specify the model and architecture of your machine?

Yes, this is a chromebook Asus C423.

We also have to be carefull with a chromebook, because sometimes it restarts without asking you to save your unsaved files.