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

Can't build a module using Owl_stats_dist in dune, works in utop (arm64 mac) #626

Open
anentropic opened this issue Nov 13, 2022 · 1 comment

Comments

@anentropic
Copy link

This is weird

I have a module that has this code

let point () =
  Gg.V3.v
    (Owl_stats_dist.std_uniform_rvs ())
    (Owl_stats_dist.std_uniform_rvs ())
    (Owl_stats_dist.std_uniform_rvs ())

This works fine in dune utop for same project:

utop # # require "owl";;

utop # Owl_stats_dist.std_uniform_rvs ();;
- : float = 0.815008172023810484

But when I try to build my module with dune I get:

Undefined symbols for architecture arm64:
  "_sfmt_state", referenced from:
      _owl_stub_std_uniform_rvs in libowl_stubs.a(owl_stats_dist_stub.o)
      _owl_stub_uniform_int_rvs in libowl_stubs.a(owl_stats_dist_stub.o)
      _beta_rvs in libowl_stubs.a(owl_stats_dist_beta.o)
      _binomial_rvs in libowl_stubs.a(owl_stats_dist_binomial.o)
      _dirichlet_rvs in libowl_stubs.a(owl_stats_dist_dirichlet.o)
      _std_exponential_rvs in libowl_stubs.a(owl_stats_ziggurat.o)
      _std_gaussian_rvs in libowl_stubs.a(owl_stats_ziggurat.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
File "caml_startup", line 1:
Error: Error during linking (exit code 1)

Seems strange that it should work in utop but not in dune?

I have owl 1.1.0 pinned to github due to #625

@anentropic
Copy link
Author

Also... is Owl_stats_dist.std_uniform_rvs the best method for getting a single random float from uniform distribution? It's the one I found

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