garrigue / lablgtk

LablGTK 2 and 3: an interface to the GIMP Tool Kit
https://garrigue.github.io/lablgtk
Other
89 stars 40 forks source link

[opam | macOS] lablgtk3 seems to need both libffi.6.dylib and libffi.7.dylib #109

Closed YumaVlaicu closed 2 years ago

YumaVlaicu commented 4 years ago

Hi,

I was installing lablgtk3 for CoqIDE using opam on my Mac Book. I got errors said some codes need libffi.7.dylib but others need libffi.6.dylib also. I have both of libffi in homebrew. I switched libffi.7.dylib (libffi 3.3) into libffi.6.dylib (libffi 3.2.1) but just ends up with error as I said above. I also got the same error when I built from the source code.

Is this my environment's problem?

The following is a long error log:

using libffi.7.dylib (libffi 3.3)

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[coqide.8.11.1] found in cache
[lablgtk3.3.1.0] found in cache
[lablgtk3-sourceview3.3.1.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of lablgtk3 failed at "/Users/user/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3".

#=== ERROR while compiling lablgtk3.3.1.0 =====================================#
# context     2.0.6 | macos/x86_64 | ocaml-base-compiler.4.09.1 | https://opam.ocaml.org#e7c98c54
# path        ~/.opam/4.09.1/.opam-switch/build/lablgtk3.3.1.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3
# exit-code   1
# env-file    ~/.opam/log/lablgtk3-71044-0a5907.env
# output-file ~/.opam/log/lablgtk3-71044-0a5907.out
### output ###
# [...]
# dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
#   Referenced from: /usr/local/Cellar/llvm/10.0.0_1/lib/libLLVM.dylib
#   Reason: image not found
# File "src/gutf8.ml", line 1:
# Error: Assembler error, input left in file /var/folders/nz/vdfnf67j235_q6gc3gc2k7v40000gn/T/camlasm87355a.s
#     ocamlopt tools/.varcc.eobjs/native/varcc.{cmx,o} (exit 2)
# (cd _build/default && /Users/user/.opam/4.09.1/bin/ocamlopt.opt -w -40 -g -I tools/.varcc.eobjs/byte -I tools/.varcc.eobjs/native -intf-suffix .ml -no-alias-deps -o tools/.varcc.eobjs/native/varcc.cmx -c -impl tools/varcc.ml)
# dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
#   Referenced from: /usr/local/Cellar/llvm/10.0.0_1/lib/libLLVM.dylib
#   Reason: image not found
# File "tools/varcc.ml", line 1:
# Error: Assembler error, input left in file /var/folders/nz/vdfnf67j235_q6gc3gc2k7v40000gn/T/camlasm087cfb.s

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build lablgtk3 3.1.0
+-
- No changes have been performed

using libffi.6.dylib (libffi 3.2.1)

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[coqide.8.11.1] found in cache
[lablgtk3.3.1.0] found in cache
[lablgtk3-sourceview3.3.1.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of lablgtk3 failed at "/Users/user/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3".

#=== ERROR while compiling lablgtk3.3.1.0 =====================================#
# context     2.0.6 | macos/x86_64 | ocaml-base-compiler.4.09.1 | https://opam.ocaml.org#e7c98c54
# path        ~/.opam/4.09.1/.opam-switch/build/lablgtk3.3.1.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3
# exit-code   1
# env-file    ~/.opam/log/lablgtk3-70028-0a5907.env
# output-file ~/.opam/log/lablgtk3-70028-0a5907.out
### output ###
# ml_gtktree.c:551:23: warning: assigning to 'gchar *' (aka 'char *') from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
# [...]
#                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2 warnings generated.
#   ocamlmklib src/dlllablgtk3_stubs.so,src/liblablgtk3_stubs.a (exit 2)
# (cd _build/default && /Users/user/.opam/4.09.1/bin/ocamlmklib.opt -g -o src/lablgtk3_stubs src/cairo_pango_stubs.o src/ml_gdk.o src/ml_gdkpixbuf.o src/ml_glib.o src/ml_gobject.o src/ml_gpointer.o src/ml_gtk.o src/ml_gtkaction.o src/ml_gtkassistant.o src/ml_gtkbin.o src/ml_gtkbuilder.o src/ml_gtkbutton.o src/ml_gtkedit.o src/ml_gtkfile.o src/ml_gtkmenu.o src/ml_gtkmisc.o src/ml_gtkpack.o src/m[...]
# ld: file not found: /usr/local/opt/libffi/lib/libffi.7.dylib for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
#     ocamlopt src/.lablgtk3.objs/native/gtkMain.{cmx,o}
# File "src/gtkMain.ml", line 49, characters 4-16:
# 49 |     Obj.truncate (Obj.repr Sys.argv) (Array.length argv) [@warnerror "-3"];
#          ^^^^^^^^^^^^
# Alert deprecated: Stdlib.Obj.truncate

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build lablgtk3 3.1.0
+-
- No changes have been performed

This is my environment:

Thank you.

garrigue commented 4 years ago

Since I'm not using homebrew myself, it is hard to answer this question. We get many reports of problems building lablgtk on top of homebrew. I haven't experienced such problems using macports. Maybe others can comment further.

YumaVlaicu commented 4 years ago

Hello, @garrigue. I solved the issue by copying libffi.6.dylib into libffi.7.dylib's library folder directly, it's not straightforward though. I think this is not your lablgtk3's issue but homebrew's linking issue. Perhaps homebrew installed both versions when I installed gtk3+ but they are not placed in the same folder. Thanks for your helping.

ejgallego commented 2 years ago

I'm closing this issue as it seems homebrew specific, maybe it should be moved to their bug tracker.