caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Kakadu <kakadu.hafanana@gmail.com>
To: "Jocelyn Sérot" <jocelyn.serot@uca.fr>
Cc: Caml Mailinglist <caml-list@inria.fr>
Subject: Re: [Caml-list] A (silly ?) question about opam and ocamlfind
Date: Wed, 14 Aug 2019 16:42:26 +0300	[thread overview]
Message-ID: <CAGmVoG3_oWYxogapTZb8tnNQXv2fj2oV77U1X6JvFvKmM1dc=w@mail.gmail.com> (raw)
In-Reply-To: <8D32A371-FD47-434F-928A-C07D002BB712@uca.fr>

[-- Attachment #1: Type: text/plain, Size: 3697 bytes --]

Hello,

There is old school package manager for OCaml called `ocamlfind` which
gives in your case an error about missing package 'dummy'. To make your
package discoverable by ocamlfind you need to install your cmxa's with
right META file. It is usually done using command 'ocamlfind install dummy
META dummy.cmxa' and discoverable later using `ocamlfind query dummy`.
Something like this in opam file should help:

build: [
  [make]
]
install: ["ocamlfind" "install" "dummy" "META" file1file2 ]


You can also try new fancy way of installing by providing opam an explicit
list of files that should be copied but I'm not very familiar with it.
Documentation will probably help.

Happy hacking,
Dmitrii

On Wed, Aug 14, 2019 at 4:20 PM Jocelyn Sérot <jocelyn.serot@uca.fr> wrote:

> Dear Camlers,
>
> I’ve been fighting for one entire day with a problem without success and
> the more i dig, the more confused i am :(
>
> Suppose i define a small opam package - let’s call it « dummy » :
>
> opam-version: "2.0"
> name: "dummy"
> version: "0.0"
> synopsis: "A dummy OPAM package"
> maintainer: "JS"
> authors: "JS"
> license: "MIT"
> depends: [ "ocaml" "ocamlfind" ]
> build: [
>   [make]
> ]
>
> where [make] simply builds the library files [mylib.cma] and [mylib.cmxa]
> (by directly calling ocamlc/opt or using dune - this does not matter here).
>
> What is the correct way to make this package available to other programs :
>
> [opam pin add .]
>
> or
>
> [opam install .]
>
> ?
>
> I’ve tried both solutions but systematically get :
>
> ocamlfind ocamlc -package dummy -linkpkg -o main main.ml
> ocamlfind: Package `dummy' not found
>
> when trying to compile [main.ml], where this file contains, for example
> : « let _ = Mylib.dump () » (and where [dump] is a function defined in
> mylib.ml »
>
> When simply pinning the package, [opam info dummy] gives :
>
> <><> dummy: information on all versions
> <><><><><><><><><><><><><><><><><><>  🐫
> name         dummy
> all-versions 0.0
>
> <><> Version-specific details
> <><><><><><><><><><><><><><><><><><><><><><><>  🐫
> version     0.0
> pin         file:///Users/jserot/Dev/ml/opam/simple/build/raw
> url.src:    "file:///Users/jserot/Dev/ml/opam/simple/build/raw"
> authors:    "JS"
> maintainer: "JS"
> license:    "MIT"
> depends:    "ocaml" "ocamlfind"
> synopsis    A dummy OPAM package
>
> which tends does not show any installed version of the package (and hence
> could explain why ocamlfind does not find it ?)
>
> After installing the package ([opam install .]), [opam info dummy] gives :
>
> $ opam info dummy
>
> <><> dummy: information on all versions
> <><><><><><><><><><><><><><><><><><>  🐫
> name                   dummy
> all-installed-versions 0.0 [4.06.0]
> all-versions           0.0
>
> <><> Version-specific details
> <><><><><><><><><><><><><><><><><><><><><><><>  🐫
> version     0.0
> pin         file:///Users/jserot/Dev/ml/opam/simple/build/raw
> url.src:    "file:///Users/jserot/Dev/ml/opam/simple/build/raw"
> authors:    "JS"
> maintainer: "JS"
> license:    "MIT"
> depends:    "ocaml" "ocamlfind"
> synopsis    A dummy OPAM package
> $
>
> which now seems to indicates that the package is « installed » (though i
> do not fully understand the distinction between the former case..).
> But i still get the message
>
> ocamlfind ocamlc -package dummy -linkpkg -o main main.ml
> ocamlfind: Package `dummy' not found
>
> There must be sth i’m doing wrong (or have not understood in the way opam
> works)..
> Any help appreciated.
>
> Jocelyn
>
>
>
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 10206 bytes --]

  reply	other threads:[~2019-08-14 13:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 13:20 Jocelyn Sérot
2019-08-14 13:42 ` Kakadu [this message]
2019-08-14 19:08 ` rixed
2019-08-15  6:26   ` Jocelyn Sérot
2019-08-15  8:25   ` Malcolm Matalka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGmVoG3_oWYxogapTZb8tnNQXv2fj2oV77U1X6JvFvKmM1dc=w@mail.gmail.com' \
    --to=kakadu.hafanana@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jocelyn.serot@uca.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).