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

Does not compile with -static #80

Open
Chris00 opened this issue Nov 4, 2018 · 3 comments
Open

Does not compile with -static #80

Chris00 opened this issue Nov 4, 2018 · 3 comments

Comments

@Chris00
Copy link

Chris00 commented Nov 4, 2018

When compiling ocamlgraph with switch 4.07.1+musl+static+flambda, I get

#=== ERROR while compiling ocamlgraph.1.8.8 ===================================#
# context     2.0.0 | linux/x86_64 | ocaml-variants.4.07.1+musl+static+flambda | https://opam.ocaml.org/#892303df
# path        ~/.opam/4.07.1+musl+static+flambda/.opam-switch/build/ocamlgraph.1.8.8
# command     /usr/bin/make
# exit-code   2
# env-file    ~/.opam/log/ocamlgraph-27696-8b47d2.env
# output-file ~/.opam/log/ocamlgraph-27696-8b47d2.out
### output ###
# [...]
# ocamlopt.opt -c -I src -I lib -for-pack Graph src/merge.ml
# ocamlopt.opt -c -I src -I lib -for-pack Graph src/mincut.ml
# ocamlopt.opt -c -I src -I lib -for-pack Graph src/clique.ml
# ocamlopt.opt -c -I src -I lib -for-pack Graph src/weakTopological.ml
# ocamlopt.opt -c -I src -I lib -for-pack Graph src/chaoticIteration.ml
# ocamlopt.opt -I src -I lib -pack -o graph.cmx src/sig.cmi src/sig_pack.cmi src/dot_ast.cmi lib/unionfind.cmx lib/heap.cmx lib/bitv.cmx lib/persistentQueue.cmx src/version.cmx src/util.cmx src/blocks.cmx src/persistent.cmx src/imperative.cmx src/delaunay.cmx src/builder.cmx src/classic.cmx src/rand.cmx src/oper.cmx src/components.cmx src/path.cmx src/nonnegative.cmx src/traverse.cmx src/colori[...]
# ocamlopt.opt -I src -I lib -a -o graph.cmxa graph.cmx
# ocamlopt.opt -I src -I lib -shared -o graph.cmxs graph.cmx
# sh: 1: shared-libs-not-available: not found
# File "caml_startup", line 1:
# Error: Error during linking
# make: *** [Makefile:104: graph.cmxs] Error 2

Switching to Dune will fix the problem automatically. :-)

@yakobowski
Copy link
Collaborator

We strive to keep OCamlGraph compatible with as many versions of OCaml as possible (currently 3.10.2), so a switch to Dune will happen only if we do not "lose" too many versions by doing so. Do you know if Dune imposes some requirements?

@Chris00
Copy link
Author

Chris00 commented Nov 6, 2018

Yes, Dune requires OCaml ≥ 4.02. If you want to maintain compatibility with very old versions of OCaml, you need to detect whether shared libraries are supported by the compiler.

@balsoft
Copy link

balsoft commented Nov 15, 2019

Is there any known fix for this in the meantime? I'm trying to build ocamlPackages in nixpkgs statically, and this is one of the blockers.

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

3 participants