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

Problem for building with integers: /usr/bin/ld: Can't find -lintegers #26

Open
XVilka opened this issue Feb 19, 2019 · 10 comments
Open

Comments

@XVilka
Copy link

XVilka commented Feb 19, 2019

ocaml/opam-repository#13488

OCaml 4.07.0 system switch, opam 2.0.3,
after upgrading integers package from 0.2.2 version to 0.3.0 ztd.0.2 fails to build:

W: Cannot find source file matching module 'Zstd_generated' in library zstd.
W: Use InterfacePatterns or ImplementationPatterns to define this file with feature "source_patterns".
W: Cannot find source file matching module 'Zstd_generated' in library zstd.
W: Use InterfacePatterns or ImplementationPatterns to define this file with feature "source_patterns".
W: Cannot find source file matching module 'Zstd_generated' in library zstd.
W: Use InterfacePatterns or ImplementationPatterns to define this file with feature "source_patterns".
ocamlopt.opt unix.cmxa -I /home/akochkov/.opam/default/lib/ocamlbuild /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild_config.ml myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
File "_tags", line 31, characters 27-37:
Warning: the tag "pkg_extlib" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
File "_tags", line 34, characters 19-29:
Warning: the tag "pkg_extlib" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
/home/akochkov/.opam/default/bin/ocamlfind ocamldep -package ctypes.stubs -modules src/zstd_gen.ml > src/zstd_gen.ml.depends
/home/akochkov/.opam/default/bin/ocamlfind ocamldep -package ctypes.stubs -modules src/zstd_stubs.ml > src/zstd_stubs.ml.depends
/home/akochkov/.opam/default/bin/ocamlfind ocamlc -c -g -annot -bin-annot -package ctypes.stubs -I src -o src/zstd_stubs.cmo src/zstd_stubs.ml
/home/akochkov/.opam/default/bin/ocamlfind ocamlc -c -g -annot -bin-annot -package ctypes.stubs -I src -o src/zstd_gen.cmo src/zstd_gen.ml
/home/akochkov/.opam/default/bin/ocamlfind ocamlopt -c -g -annot -bin-annot -package ctypes.stubs -I src -o src/zstd_stubs.cmx src/zstd_stubs.ml
/home/akochkov/.opam/default/bin/ocamlfind ocamlopt -c -g -annot -bin-annot -package ctypes.stubs -I src -o src/zstd_gen.cmx src/zstd_gen.ml
/home/akochkov/.opam/default/bin/ocamlfind ocamlopt -g -linkpkg -package ctypes.stubs -I src src/zstd_stubs.cmx src/zstd_gen.cmx -o src/zstd_gen.native
+ /home/akochkov/.opam/default/bin/ocamlfind ocamlopt -g -linkpkg -package ctypes.stubs -I src src/zstd_stubs.cmx src/zstd_gen.cmx -o src/zstd_gen.native
/usr/bin/ld: 找不到 -lintegers
collect2: 错误:ld 返回 1
File "caml_startup", line 1:
Error: Error during linking
Command exited with code 2.
E: Failure("Command ''/home/akochkov/.opam/default/bin/ocamlbuild' src/libzstd_stubs.a src/dllzstd_stubs.so src/zstd.cma src/zstd.cmxa src/zstd.a src/zstd.cmxs src/zstd_gen.native -tag debug' terminated with error code 10")
@XVilka
Copy link
Author

XVilka commented Apr 3, 2019

It disappears once I downgrade integers:

opam pin integers 0.2.2

@mseri
Copy link

mseri commented Apr 3, 2019

This is likely related to #21

@yallop
Copy link
Owner

yallop commented Apr 15, 2019

@XVilka: the various versions of ctypes in opam-repository should all be constrained to require integers < 0.3.0. Is it possible you're using a ctypes pin, or need to run opam update?

@XVilka
Copy link
Author

XVilka commented Apr 16, 2019

@yallop yes, I pinned ctypes to the git repository.

@yallop
Copy link
Owner

yallop commented Apr 16, 2019

@XVilka: yallop/ocaml-ctypes#594 should fix the problem.

@fare
Copy link

fare commented Jul 13, 2019

Note that integers 0.3.0 still has this bug. My application can't link with it, but works if I tell opam (now 2.0.5, from 2.0.2) to pin integers to 0.2.2. (NB: using ocaml 4.07.1 on Linux x64)

@yallop
Copy link
Owner

yallop commented Jul 13, 2019

@fare: are you using integers with ctypes? If so, which version of ctypes are you using?

@fare
Copy link

fare commented Jul 13, 2019

I don't see ctypes installed with opam. I'm just trying to build an application with dune that links to integers. It works with 0.2.2 but not 0.3.0, due to a linker error similar to the one above. I can give a transcript if you believe that's a different error.

@yallop
Copy link
Owner

yallop commented Jul 13, 2019

A reproducible test case would be helpful, if possible.

@fare
Copy link

fare commented Jul 13, 2019

Aha, indeed I found that the culprit was that my dune file had (link_flags -linkall -cclibs -linteger -I +threads) in its (executable section, which is required to link in 0.2.2, but that is breaking the linkage with integers 0.3.0, which works well without it.

fare added a commit to AlacrisIO/legicash-facts that referenced this issue Jul 13, 2019
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

4 participants