Solved ocaml opam install error.

Alain De Vos

Son of Beastie

Reaction score: 870
Messages: 2,827

$opam install async yojson core_extended core_bench cohttp-async async_graphics cryptokit menhir base core
produces error,
Code:
# [...]                                                                                                                                                                                         
# rm -f libcamlrun_pic.a && ar rc libcamlrun_pic.a  interp_bpic.o misc_bpic.o stacks_bpic.o fix_code_bpic.o startup_aux_bpic.o startup_byt_bpic.o freelist_bpic.o major_gc_bpic.o minor_gc_bpic.o memory_bpic.o alloc_bpic.o roots_byt_bpic.o globroots_bpic.o fail_byt_bpic.o signals_bpic.o signals_byt_bpic.o printexc_bpic.o backtrace_byt_bpic.o backtrace_bpic.o compare_bpic.o ints_bpic.o floats_bpic[...]
# cc -shared -o libcamlrun_shared.so interp_bpic.o misc_bpic.o stacks_bpic.o fix_code_bpic.o startup_aux_bpic.o startup_byt_bpic.o freelist_bpic.o major_gc_bpic.o minor_gc_bpic.o memory_bpic.o alloc_bpic.o roots_byt_bpic.o globroots_bpic.o fail_byt_bpic.o signals_bpic.o signals_byt_bpic.o printexc_bpic.o backtrace_byt_bpic.o backtrace_bpic.o compare_bpic.o ints_bpic.o floats_bpic.o str_bpic.o a[...]
# ld: error: duplicate symbol: caml_debug_info
# >>> defined at backtrace_byt.c:47
# >>>            backtrace_byt_bpic.o:(caml_debug_info)
# >>> defined at backtrace.c:31
# >>>            backtrace_bpic.o:(.bss+0x10)

The following actions failed
│ λ build ocaml-secondary-compiler 4.08.1-1
│ λ build ocamlbuild               0.14.0

>cc -v                                                                                                                                                                
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
 
OP
Alain De Vos

Alain De Vos

Son of Beastie

Reaction score: 870
Messages: 2,827

Can i give additional flags to the compiler in order for the linker not to complain about duplicate symbols ?
Like " -fno-common" or "-fcommon" ?
Or should i remove certain ocaml packages like ocaml-base64 or ocaml-extlib ?

Currently trying something else:
Code:
$opam switch install 4.13.1+options
 
OP
Alain De Vos

Alain De Vos

Son of Beastie

Reaction score: 870
Messages: 2,827

Following worked:
Code:
opam switch install 4.13.1+options
opam install async yojson core_extended core_bench cohttp-async async_graphics cryptokit menhir base core dune utop
 
Top