I was unable to install via opam pin on an ARM macbook. I got cudajit as missing dependency. Then I pinned lukstafi/ocaml-cudajit as mentioned on the ocannl README. But installing that fails as I don’t have nvidia hardware.
there appear to be two issues: a warning about gcc although it was already installed by homebrew, and some remaining dependency on cudajit. i append a terminal session transcript which might help.
b086-mac003:github USER$ opam pin list
arrayjit.0.3.2 (uninstalled) git git+file:///Users/USER/Tresors/Code/github/ocannl#master
ocannl.0.3.2 (uninstalled) git git+file:///Users/USER/Tresors/Code/github/ocannl#master
ocannl_npy.0.3.2 git git+file:///Users/USER/Tresors/Code/github/ocannl#master
b086-mac003:github USER$ opam install ocannl
<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><> 🐫
[ocannl.0.3.2] synchronised (no changes)
[WARNING] Opam package conf-libgccjit.1 depends on the following system package that can no longer be
found: gcc@13
Constructing initial basis...
Number of 0-1 knapsack inequalities = 3554
Constructing conflict graph...
Conflict graph has 1172 + 684 = 1856 vertices
The following actions will be performed:
↻ recompile conf-libgccjit 1 [upstream or system changes]
↻ recompile gccjit 0.3.2 [uses conf-libgccjit]
∗ install arrayjit 0.3.2* [required by ocannl]
∗ install ocannl 0.3.2*
===== ∗ 2 ↻ 2 =====
Do you want to continue? [Y/n] y
The following system packages will first need to be installed:
gcc@13
<><> Handling external dependencies <><><><><><><><><><><><><><><><><><><><> 🐫
Let opam run your package manager to install the required system packages?
(answer 'n' for other options) [Y/n] y
+ /opt/homebrew/bin/brew "install" "gcc@13"
- Warning: gcc 13.2.0 is already installed and up-to-date.
- To reinstall 13.2.0, run:
- brew reinstall gcc
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
⬇ retrieved gccjit.0.3.2 (cached)
⊘ removed gccjit.0.3.2
⊘ removed conf-libgccjit.1
∗ installed conf-libgccjit.1
∗ installed gccjit.0.3.2
[ERROR] The compilation of arrayjit.0.3.2 failed at "dune build -p arrayjit -j 8 @install".
#=== ERROR while compiling arrayjit.0.3.2 =====================================#
# context 2.1.5 | macos/arm64 | ocaml-variants.5.1.1+options | pinned(git+file:///Users/USER/Tresors/Code/github/ocannl#master#5ace0ea965e26b3d58fdcd401674bf99bca23520)
# path ~/.opam/51/.opam-switch/build/arrayjit.0.3.2
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p arrayjit -j 8 @install
# exit-code 1
# env-file ~/.opam/log/arrayjit-97185-bea3b6.env
# output-file ~/.opam/log/arrayjit-97185-bea3b6.out
### output ###
# Error: The implementation arrayjit/lib/cuda_backend.pp.ml
# [...]
# ?name:string ->
# context ->
# Arrayjit.Indexing.unit_bindings ->
# Arrayjit.Low_level.traced_store * Arrayjit.Low_level.t ->
# context * Arrayjit.Indexing.jitted_bindings *
# (unit -> Arrayjit.Tnode.work)
# Type unit -> unit is not compatible with type Arrayjit.Tnode.work
# File "arrayjit/lib/cuda_backend.mli", lines 11-16, characters 0-59:
# Expected declaration
# File "arrayjit/lib/cuda_backend.missing.ml", line 10, characters 4-7:
# Actual declaration
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build arrayjit 0.3.2
└─
┌─ The following changes have been performed (the rest was aborted)
│ ↻ recompile conf-libgccjit 1
│ ↻ recompile gccjit 0.3.2
└─
Third time the charm. OCANNL 0.3.3 is out now. I might need to change the name of the project, because of the lint warnings: Possible name collision with packages ‘OCADml’, ‘ocal’, ‘ocaml’?
thanks! i was able to install now (warnings about gcc@13 being already present are still there)
personally, i find the linter warnings overly cautious, especially if names are case sensitive. but maybe there are other nice names? tenno? tensO? ODL? OCDL?
Apologies for the overly excited linter warnings, this is still a work in progress! Your feedback is very helpful, and after some changes the linter passes for OCANNL:)
But I changed the package name already! The warnings were kinda helpful. Edit: ah, using all-capitals OCANNL as package names would make sense. But I went with project ocannl consisting of packages arrayjit and neural_nets_lib.
quick initial feedback: i was able to opam pin version 0.3.3.0 and install it on macos M1. homebrew claimed gcc was already installed. then trying out dune test this failed with linker errors, apparently ld not finding a library emutls_w. after some googling i followed a suggestion to manually brew reinstall gcc. after this last step i could successfully dune test !