rgrinberg / opium

Sinatra like web toolkit for OCaml
MIT License
755 stars 67 forks source link

ocamlfind: Package `opium' not found Cannot run Ocamlfind. #84

Closed decapo01 closed 4 years ago

decapo01 commented 6 years ago

after installation when i try to run

ocamlbuild -pkg opium hello_world.native

I've been trying for about an hour and I cannot find a solution.

decapo01 commented 6 years ago

so i think i found part of the problem in that opam is not installing opium. I thought it did because i didnt recieve an error message affter the first attempt after switching to the 4.03 compiler. When i retry installing opium i get an error Unbound module Lwt_log

XVilka commented 6 years ago

@decapo01 should be fixed in https://github.com/rgrinberg/opium/commit/473e3e1b14b87a4a4f56437a732fea1bb8194a75

jcoleman-techempower commented 6 years ago

Still unable to do this myself

akluth commented 5 years ago

As of version 0.16.0 this is not fixed; however I was able to install opium via opam (ocaml 4.07.1) while pinning master:

opam pin add opium --dev-repo
jcoleman-techempower commented 5 years ago

Using the bleeding edge release still doesn't fix this for me

rgrinberg commented 5 years ago

What error do you get?

jcoleman-techempower commented 5 years ago

@rgrinberg Simply just

opium: /bin/sh: 1: ocamlbuild: not found

Here's my Dockerfile

FROM ubuntu:18.04

RUN apt update && apt install -y software-properties-common
RUN add-apt-repository -y ppa:avsm/ppa
RUN apt update
RUN apt install -y opam m4 build-essential sudo

WORKDIR /home
COPY . .

RUN sudo opam init --disable-sandboxing &&\
    opam env &&\
    opam switch create . 4.07.1 &&\
    opam env

RUN opam update &&\
    opam install -y opium.0.17.0 lwt_log ocamlbuild &&\
    ocamlbuild -pkg opium benchmark.native

CMD ./benchmark.native
Edit:

I'll go ahead and try the new v0.17.0 release. I should probably remove the lwt_log dependency then.

Edit, Edit:

Newest version obviously wasn't going to fix this issue, but I appreciate the update. I fundamentally believe this is an issue with running Opam in a Docker container.

tyabu12 commented 5 years ago

@jcoleman-techempower I think that you need to run not opam env but eval "$(opam env)" to update PATH. opam env only shows new PATH.

anuragsoni commented 5 years ago

@jcoleman-techempower You could try using the opam2 docker images hosted at: https://hub.docker.com/r/ocaml/opam2/tags

anuragsoni commented 4 years ago

Closing as there hasn't been a response for quite some time now. Please re-open if still interested.