ocaml-mccs icon indicating copy to clipboard operation
ocaml-mccs copied to clipboard

Fails to compile in Apple M1

Open davesnx opened this issue 4 years ago • 1 comments

Hey,

Trying to install opam-lock like following: opam install opam-lock which depends on opam-solver which depends on ocaml-mccs. Fails at compiling mccs.1.1+13.

  • opam 2.0.8
  • ocaml 4.10.0
[ERROR] The compilation of mccs failed at "/Users/davesnx/.opam/opam-init/hooks/sandbox.sh build dune build -p mccs -j 7".

#=== ERROR while compiling mccs.1.1+13 ========================================#
# context     2.0.8 | macos/x86_64 | ocaml-base-compiler.4.10.0 | https://opam.ocaml.org#44953419
# path        ~/Code/github/counter-as-a-service/_opam/.opam-switch/build/mccs.1.1+13
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p mccs -j 7
# exit-code   1
# env-file    ~/.opam/log/mccs-8358-335865.env
# output-file ~/.opam/log/mccs-8358-335865.out
### output ###
# [...]
# In file included from ./abstract_criteria.h:13:
# In file included from ./cudf.h:24:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:276:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__bit_reference:15:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:643:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:671:
# In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
# /Users/davesnx/Code/github/counter-as-a-service/_opam/lib/ocaml/version:1:1: error: expected unqualified-id
# 4.10.0
# ^
# fatal error: too many errors emitted, stopping now [-ferror-limit=]
# 20 errors generated.

Is there anything I'm missing in my setup? or something I can add in this issue?

Thanks

davesnx avatar May 28 '21 11:05 davesnx

This is caused by using a C++20 compiler and was fixed in https://github.com/ocaml/ocaml/pull/9895. Are you able to use OCaml 4.12 instead? A safe workaround should be simply to delete /Users/davesnx/Code/github/counter-as-a-service/_opam/lib/ocaml/version.

dra27 avatar Jun 07 '21 09:06 dra27