Thanks for updating the repository @ejgallego. Greatly appreciated.
Is it possible to build and install a Coq package without creating an .opam
file?
Thanks for updating the repository @ejgallego. Greatly appreciated.
Is it possible to build and install a Coq package without creating an .opam
file?
Newer dune versions do indeed support defining the packages in the dune-project
file, see https://dune.readthedocs.io/en/stable/opam.html
However the notion of Dune and OPAM package are still too tightly coupled, as you can infer from the documentation.
@ejgallego I’m trying to understand how I can use the guide that you have provided here to build my own Coq library. However, the related documentations at your github and dune readthedocs are too cryptic for me to understand. Is there anyone who can provide a more gentle guide for someone who is still relatively new to this process of setting up a Coq library?
Many thanks in advance ◡̈
I would start from https://github.com/ejgallego/coq-plugin-template ; I’d suggest we work on that repository as to improve the documentation of the template, so indeed, please submit issues on that repos for any questions / problems with the template doc.
The question is about a Coq library (not a Coq plugin). You still recommend your plugin template in this case? It seems that the library use case is pretty different and there are a lot of projects to choose from as examples (e.g. projects maintained by @palmskog in coq-community).
For (almost) pure Coq library use of Dune, I recommend people to look at https://github.com/palmskog/coq-program-verification-template which was inspired by Emilio’s plugin template but elides all the plugin-specific stuff.
Indeed good point, I was planning to update the template to be coq-dune-template
and cover some different use cases, but I’d like to make a bit more progress on some existing issues first; I’ll edit the post to add Karl’s template too.
Thanks @ejgallego @palmskog and @Zimmi48 for the response and will certainly look at your repository as reference for a Coq library template. For understanding the usages of the files like Makefile
and _CoqProject
, is there any place that I can read about, or perhaps someone here can provide a practical introduction/guide to them here?
Here’s the documentation on _CoqProject
: https://coq.inria.fr/refman/practical-tools/utilities.html#building-a-coq-project-with-coq-makefile
Is there a way to let VSCoq understand where to look for libraries while using a dune-based build?
Unable to locate library LIBNAME. (While searching for a .vos file.)
I just get the above in the ProofView while importing libraries.
As of today you need to do a mock _CoqProject
adding the build path, this is indeed quite unoptimal.
Thanks, I am still confused about what exactly is required in the _CoqProject
file.
$ tree -d
.
├── _build
│ └── default
│ └── src
└── src
I have my .v
sources, dune
and _CoqProject
in the src
directory and the dune-project
file at the root.
Using ../_build/default/src/
for -I
and/or -R
doesn’t seem to be working.
If you do not have OCaml files, you shouldn’t use -I
, only -R
.
What about putting your _CoqProject
file at the root containing only:
-R _build/default/src MyProjectNamespace
And then running code .
from the root of the project?
Aha! That did it. Thanks Théo!
I don’t think you explain how you actually do the build. You run make? dune build?
dune build
is the usual command to build/check Coq projects locally when there are dune
files in a project.
If one has declared several packages package1
, package2
, etc., each package can be built/checked in isolation by running:
dune build -p package1
dune build -p package2
etc.
@ejgallego if we use dune, is the coq project still expected to have a:
make
)?Thanks!
dune build
or something.Hi, I followed your guide but I get the following error message:
$ dune build
#File "dune-project", line 30, characters 1-11:
30 | (coq.theory
^^^^^^^^^^
Error: Unknown field coq.theory
Let me know if you have any ideas. I am including (using coq 0.7)
. Thanks.
coq.theory isn’t legal in dune-project files, only in dune files.