Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcc error whitch opam switch create 4.00.0 #27260

Open
bentxt opened this issue Jan 13, 2025 · 0 comments
Open

Gcc error whitch opam switch create 4.00.0 #27260

bentxt opened this issue Jan 13, 2025 · 0 comments

Comments

@bentxt
Copy link

bentxt commented Jan 13, 2025

Goal

Installing ocaml 4.00.0 with

opam switch create 4.00.0

Error

 fix_code.c: In function 'caml_load_code':
fix_code.c:59:7: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]    
59 |   if (read(fd, (char *) caml_start_code, caml_code_size) != caml_code_size)
      |       ^~~~

Configuration

$ ocaml --version
The OCaml toplevel, version 5.3.0

$ opam --version
2.1.6

$ gcc --version
gcc (Homebrew GCC 14.2.0_1) 14.2.0


$ opam config report
# opam config report
# opam-version         2.1.6
# self-upgrade         no
# system               arch=x86_64 os=macos os-distribution=homebrew os-version=14.6.1
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 15
# repositories         1 (http) (default repo at 67e940587b8aca227f511e1943bcd31eabe6b1db)
# pinned               2 (rsync)
# current-switch       5.2.0
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       /Users/ben/.opam/5.2.0/lib/ocaml/stublibs:/Users/ben/.opam/5.2.0/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       5.2.0

Error log

[...]
⬇ retrieved ocaml-base-compiler.4.00.0  (cached)
[ERROR] The compilation of ocaml-base-compiler.4.00.0 failed at "make world opt opt.opt".

#=== ERROR while compiling ocaml-base-compiler.4.00.0 =========================#
# context     2.1.6 | macos/x86_64 |  | https://opam.ocaml.org#67e940587b8aca227f511e1943bcd31eabe6b1db
# path        ~/.opam/4.00.0/.opam-switch/build/ocaml-base-compiler.4.00.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build make world opt opt.opt
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-75676-10e4bd.env
# output-file ~/.opam/log/ocaml-base-compiler-75676-10e4bd.out
### output ###
# sed -n -e '/^  /s/ \([A-Z]\)/ \&\&lbl_\1/gp' \
# [...]
# gcc -DCAML_NAME_SPACE -O -fcommon -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64    -c -o interp.o interp.c
# gcc -DCAML_NAME_SPACE -O -fcommon -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64    -c -o misc.o misc.c
# gcc -DCAML_NAME_SPACE -O -fcommon -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64    -c -o stacks.o stacks.c
# gcc -DCAML_NAME_SPACE -O -fcommon -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64    -c -o fix_code.o fix_code.c
# fix_code.c: In function 'caml_load_code':
# fix_code.c:59:7: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
#    59 |   if (read(fd, (char *) caml_start_code, caml_code_size) != caml_code_size)
#       |       ^~~~
# make[2]: *** [fix_code.o] Error 1
# make[1]: *** [coldstart] Error 2
# make: *** [world] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
┌─ The following actions failed
│ λ build ocaml-base-compiler 4.00.0
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray base
│ ∗ install base-threads  base
│ ∗ install base-unix     base
└─
# Run eval (opam env --switch=4.00.0) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n]
@kit-ty-kate kit-ty-kate transferred this issue from ocaml/opam Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant