Stream: Mirror: Isabelle Users Mailing List

Topic: [isabelle] Failed call to isabelle jedit -R with code gen...

view this post on Zulip Email Gateway (Apr 27 2021 at 09:26):

From: Jonathan Julián Huerta y Munive <>

When I try to do isabelle jedit -R Some_Session_with_code_generation
Isabelle fails to do the heap build and throws the following error:

Some_Session_with_code_generation FAILED
(see also
*** Failed to load theory "Some_Session_with_code_generation.Examples"
(unresolved "Some_Session_with_code_generation.Theory_with_Code")
*** Code check failed for OCaml: "$ISABELLE_OCAMLFIND" ocamlopt -w pu
-package zarith -linkpkg </dev/null
*** At command "export_code" (line 42 of
Unfinished session(s):
Return code: 1 (ERROR)

Things that I have tried to not have the error:

As an average user, I'd appreciate any specific set of instructions to
remove the error (my computer specifications appear in the github link).

Best wishes,

view this post on Zulip Email Gateway (Apr 27 2021 at 10:57):

From: Fabian Huch <>
You might be missing some system packages, see

I had the same issue after a major system update (with the packages
installed), and it turned out that opam was broken -- removing the
~/.opam folder and re-running ocaml_setup solved that for me.


view this post on Zulip Email Gateway (Apr 27 2021 at 22:42):

From: Makarius <>
Your system is macOS Big Sur on Apple Silicon (ARM64), and the problem is
ultimately to build OCaml (with zlib) on it, with or without opam.

Some years ago, I provided the "isabelle ocaml_setup" tool to simplify that
process, but now I am unsure if that was actually a good idea: opam has too
many implicit dependencies on the operating system and easily breaks.

I've briefly tried it on my Apple M1 test machine and failed on missing
libgmp: so maybe it actually works after more tinkering. When doing the
Isabelle2021 release some months ago, native OCaml was still not visible on
the horizon.

If you do manage to build OCaml on arm64-darwin, I will take the result into
account of the next Isabelle release --- presumably Nov/Dec-2021.


view this post on Zulip Email Gateway (Apr 27 2021 at 22:45):

From: Makarius <>
With "zarith", not "zlib".


view this post on Zulip Email Gateway (Apr 28 2021 at 08:02):

From: Florian Märkl <>
What works quite well on arm64 macOS is ocaml from MacPorts:

I can recommend setting "buildfromsource always“ in /opt/local/etc/macports/macports.conf to force it to always build from source natively instead of trying to possibly fetch x86 binaries.

Their build scripts can also be used as a reference for building outside of MacPorts, for example:

Though in this case it looks quite straightforward.


Last updated: Dec 08 2021 at 08:24 UTC