Hello OCaml community,
I try to setup ocaml on my Mac Book air M1 2020 macos Version 15.4
opam init -y
eval $(opam env)
opam install ocaml-lsp-server odoc ocamlformat utop
The installation of the development environment fails because the library base can not be compiled. The problem ist the unsupported cc compiler option ‘-mpopcnt’:
#=== ERROR while compiling base.v0.17.1 =======================================#
# context 2.3.0 | macos/arm64 | ocaml.5.3.0 | https://opam.ocaml.org#1b767795a4e028a4d45f916f1598c24ee7a7b6cb
# path ~/.opam/default/.opam-switch/build/base.v0.17.1
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p base -j 7
# exit-code 1
# env-file ~/.opam/log/base-47427-483383.env
# output-file ~/.opam/log/base-47427-483383.out
### output ###
# [...]
# (cd _build/default/src && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -pthread -D_FILE_OFFSET_BITS=64 -fdiagnostics-color=always -D_LARGEFILE64_SOURCE -mpopcnt -g -I .opam/default/lib/ocaml -I .opam/default/lib/ocaml_intrinsics_kernel -I .opam/default/lib/sexplib0 -I ../hash_types/src -I ../shadow-stdlib/src -o hash_stubs.o -c hash_stubs.c)
# clang: error: unsupported option '-mpopcnt' for target 'arm64-apple-darwin24.4.0'
# File "src/dune", line 19, characters 21-30:
# 19 | (names bytes_stubs exn_stubs int_math_stubs hash_stubs obj_stubs am_testing)
# ^^^^^^^^^
# (cd _build/default/src && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -pthread -D_FILE_OFFSET_BITS=64 -fdiagnostics-color=always -D_LARGEFILE64_SOURCE -mpopcnt -g -I .opam/default/lib/ocaml -I .opam/default/lib/ocaml_intrinsics_kernel -I .opam/default/lib/sexplib0 -I ../hash_types/src -I ../shadow-stdlib/src -o exn_stubs.o -c exn_stubs.c)
# clang: error: unsupported option '-mpopcnt' for target 'arm64-apple-darwin24.4.0'
# (cd _build/default && .opam/default/bin/ocamlopt.opt -w -40 -g -I src/.base.objs/byte -I src/.base.objs/native -I .opam/default/lib/ocaml_intrinsics_kernel -I .opam/default/lib/sexplib0 -I hash_types/src/.base_internalhash_types.objs/byte -I hash_types/src/.base_internalhash_types.objs/native -I shadow-stdlib/src/.shadow_stdlib.objs/byte -I shadow-std[...]
# File "src/array.ml", line 399, characters 28-75:
# 399 | result := Bool.select ((keep_left_if [@inlined]) (compare x !result)) x !result
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Warning 55 [inlining-impossible]: Cannot inline: Unknown function
Can some one help me to fix this?
2 posts - 2 participants