Reputation: 103
I have set up a dual-boot intel skylake linux system (Debian 8 and Manjaro 16.08) with shared /home, and use opam to configure ocaml. I find ocamlc works but ocamlopt gives 'operand type mismatch' assembler errors when it was built on the other system. 'opam switch reinstall' creates different format binaries for each system. "ELF 64-bit LSB executable, x86-64" vs "ELF 32-bit LSB executable, Intel 80386".
I could just change $OPAMROOT to be outside /home and maintain separate versions, but was wondering what system components would I have to change to have ocamlopt compatibility between these systems? Debian currently has gcc 4.9.2-10 and Manjaro gcc 6.1.1.
Upvotes: 1
Views: 64
Reputation: 35210
You cannot share the same opam switch between two different operating systems, especially since they have different architectures. But you can create two different switches, one per each operating system. Use
opam switch <os-name> -A<compiler-version>
where <os-version>
is an arbitrary name for you OS, e.g., debian
or manjaro
. And the <compiler-version>
is the version of the OCaml compiler, that you want to use, e.g., 4.03
or 4.02.3
, etc.
Later, you can update your profile, so that the correct switch is activated during the bash startup, depending on the current operating system.
Upvotes: 2