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

Cannot find -lhp on Ubuntu or other distributions #176

Closed
sogaiu opened this issue Apr 10, 2020 · 6 comments
Closed

Cannot find -lhp on Ubuntu or other distributions #176

sogaiu opened this issue Apr 10, 2020 · 6 comments

Comments

@sogaiu
Copy link

sogaiu commented Apr 10, 2020

Describe the bug
Possibly pilot error, but failing to complete "Build from source" instructions.

Reproducing
Assuming an appropriate Ubuntu 19.10 installation:

  1. Install opam (either via apt or from opam's repository using the make cold-install approach)
  2. opam init
  3. eval $(opam env)
  4. opam switch create 4.09.0 4.09.0
  5. eval $(opam env)
  6. sudo apt-get install pkg-config libpcre3-dev
  7. git clone https://github.com/comby-tools/comby
  8. cd comby && opam install . --deps-only -y
  9. eval $(opam env)
  10. make

Observe error output ending in:

/usr/bin/ld: cannot find -lhp
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
make: *** [Makefile:4: build] Error 1

See attached output below for more details.

Expected behavior
The make step completing without error.

Additional context
Output from make step should be attached.

make-output.txt

For the version of opam installed via apt:

$ opam --version
2.0.5

After some searching I'm guessing that -lhp refers to hack_parallel. Does that seem right?

I also tried installation on an Arch-derivative distribution with similar results.

@rvantonder
Copy link
Member

rvantonder commented Apr 10, 2020

Hey--thanks for the report. I ran into this but haven't had a chance to find out what changed to cause it. But yes, basically the static library for hack_parallel (lhp) isn't being picked up (it's not on the path) despite doing eval $(opam env) on Ubuntu or others (AFAIK this doesn't happen on Mac). So this is something I still need to look into. For now, you can get around this by doing, e.g.:

eval $(opam env)
LIBRARY_PATH=$OPAM_SWITCH_PREFIX/lib/hack_parallel opam exec -- dune build

instead of make. I'll keep this issue open until I've pinned down a better workaround.

@rvantonder rvantonder changed the title Build not succeeding on Ubuntu 19.10 Cannot find -lhp on Ubuntu or other distributions Apr 10, 2020
@sogaiu
Copy link
Author

sogaiu commented Apr 10, 2020

Thanks!

The suggested work-around did it.

It's working well 👍

@rvantonder
Copy link
Member

rvantonder commented Apr 19, 2020

OK so it turns out that the static library is not being packaged in a way that dune (I think as of v2?) can pick it up. rvantonder/hack_parallel#14 will fix this.

@sogaiu
Copy link
Author

sogaiu commented Apr 20, 2020

Thanks for the heads up. Good to hear that a fix may be coming 👍

@rvantonder
Copy link
Member

Should be fixed now when building from source, via 46bdbcf.

@sogaiu
Copy link
Author

sogaiu commented Apr 30, 2020

Unfortunately, I now get this:

$ make
dune build --profile dev
File "lib/language/omega_rule.ml", line 242, characters 4-11:
242 |   | Ok rule -> Or_error.return rule
          ^^^^^^^
Error: This pattern matches values of type ('a, 'b) Stdlib.result
       but a pattern was expected which matches values of type
         consume:Consume.t -> (expression list, string) Stdlib.result
File "lib/rewriter/rewrite_template.ml", line 22, characters 4-12:
22 |   | Ok label -> List.find_map label ~f:ident
         ^^^^^^^^
Error: This pattern matches values of type ('a, 'b) result
       but a pattern was expected which matches values of type
         consume:Consume.t -> (string option list, string) result
File "lib/matchers/omega.ml", line 333, characters 12-19:
333 |           | Error _ ->
                  ^^^^^^^
Error: This pattern matches values of type ('b, 'c) result
       but a pattern was expected which matches values of type
         consume:Consume.t -> (Omega.production * 'a, string) result
make: *** [Makefile:4: build] Error 1

I will file another issue.

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

2 participants