Hi! Absolute newbie question here (my meager skills from 5 ago have rusted). I've just installed the Coq Platform on my Win10. Supposedly it has the mathcomp libs. Where do I find those?
You can import mathcomp stuff with From mathcomp Require Import <name>
, for example From mathcomp Require Import all_ssreflect.
. Does this work?
ah! but can I find the .v files itself somewhere in the hierarchy?
yeah the imports work
oh in user-contrib
is this where I put my own .vs too?
Uh, I don't think that's advised. Usually I put my .v
files wherever I feel like on my computer (eg, in a work/project
directory). When you compile from there, you can still import the libraries installed with the Platform. If you then want to use one of your personal projects in another personal project, then you have several options that we can discuss if you want (but I get the impression that is not really what you are asking).
Oh, it is what I wanted to ask a few questions later :) thank you!
to be specific, I want to import files from a project in the same project
i think all its dependencies are in the platform already, but it is not
The fact that the place where mathcomp lives happens to be called user-contrib
doesn't mean users should put their projects there, just that mathcomp was developed by "users" who then contributed their development to Coq, and the Coq (or Platform) developers decided to store them in a place called user-contrib
. At least that's my understanding.
to complicate things, it has been "transferred to mathcomp", but I don't know what it means
user-contrib is where projects from "users" get installed by coq_makefile make install
What does "transferred to mathcomp" mean? Is this a public project you can link to, or a personal project of yours?
I don't know what it means :) the project is https://github.com/math-comp/Coq-Combi
i'm pretty sure its content is not in the parts of mathcomp that are on the platform
maybe just transferring the github owner
Darij Grinberg said:
maybe just transferring the github owner
Probably that's what it means, yes
Darij Grinberg said:
to be specific, I want to import files from a project in the same project
Are you developing / changing / adding to Coq-Combi, or do you want to use it as-is and write your own files where you import stuff from Coq-Combi?
ideally, both
For the former, I would clone Coq-Combi (or a fork of Coq-Combi) and confirm that all the dependencies are there by trying to compile the project (probably make
works). Then you could manipulate the files as needed. (I'm using a lot of jargon - let me know if something is unclear).
Cloned it, but where should I run make from? From WSFL?
From the main directory, the one where the makefile is
from what kind of console?
right, you're using Windows. I actually have no idea, sorry. But you can try any console you can get your hands on?
ah, is the output system-independent?
Uhh, I think it depends on what is in the .v files, but truthfully I don't know anything about this. I just don't know how makefiles and Windows interact. Perhaps everything works fine, perhaps not. I was just trying to convey my ignorance here.
Maybe, if that doesn't work, you can try to compile through CoqIDE, I think there is an option for that.
(assuming you are using CoqIDE)
i've tried CoqIDE; it just gave me "Compilation output:" and i found no new files in the folder
anyway thanks a lot for answering my first few questions!
Ok. You're welcome and I hope someone else can come answer your remaining questions, about which I am really out of my depth.
There are hints in https://github.com/coq/platform, but they're a bit hidden (cc @Michael Soegtrop ) under "Features of the Coq Platform"
for Windows there is an additional wrapper batch script to setup Cygwin as build and working environment
@Darij Grinberg I don’t have Windows but WSL could run the Linux Coq Platform; since you used the Windows installer, you should likely use a Windows prompt
or check if the platform comes with tools to set the right build environment
oh: https://github.com/coq/platform#installation-of-other-packages says “On Windows open a shell with C:\<your_coq_platform_cygwin_path>\cygwin.bat.
”
from the instructions, I think in that shell you’d be able to cd
to the checkout of Coq-Combi
, type make
, and everything work.
my remaining question: do the instructions suggest to double-click on that batch file, or to run it from inside another shell?
oh! can I use cygwin independently of how i installed the coq platform?
or do I need to install the Linux platform under cygwin for that?
I don't think I have a cygwin bat anywhere in my coq platform
and i rather not install it under cygwin, as that would make it hard to get coqide to run
i'm fine with manually compiling the files one after the other on coqide, but coqide doesn't seem to compile anything :/
Those instructions seem to imply the platform comes with cygwin.
oof
That is, the Windows platform should already include it
ooooh
not sure where i can find it then
Can you find the folder where the platform is installed, and open it with explorer?
yeah but there is nothing with "cygwin" in its name anywhere inside that folder
Hm. Maybe search cygwin.bat
through your computer? If that does not work, we’ll need some info from experts (I already tagged Michael Soegtrop)
i have my own separate cygwin, that one sure has a cygwin.bat :)
but i'd rather not run coq on that, as that would require an xserver for coqide and all the mess that comes with that
That platform would give you make, and if you get coqc
on the PATH you could compile both tools?
sorry: combine.
oh wow that seems to work!
since you mentioned WSL above: you can of course install the Linux platform under WSL
ah let’s discard WSL :-)
re coqide, I think all it does to build code is call make
_if coqide knows how to find it_, and I’m not sure how to do it if it doesn’t work out of the box
yep it works!
except now i see the code has rotten (library Omega is required and has not been found in the loadpath)
looks like it's the least useful part of the code though
nah, not quite...
make[1]: *** [Makefile:763: theories/Combi/tableau.vo] Error 127
if that copy uses Omega
it’s very old, but did you check out the latest version? I’m rechecking their github
ah second time's the charm, apparently
for the error 127 thing
https://github.com/math-comp/Coq-Combi is half a year old
but this is in a 3rd party include called alea
don't think it's actually used
Time to split this thread: most of the above is for the Coq-platform stream, now time for the math-comp stream
Cyril Cohen is also very active here and he’d probably have an actual clue on the status.
but it sounds like you’re mostly good to go @Darij Grinberg ?
yep thank you!
even if alea is not used, it’s not great if make
fails out of the box, so that’s probably worth reporting.
Anyway, good luck!
FTR if you build the platform from sources it also installs a cygwin. If you install the windows installer the you get a native binary you can run without cygwin. Sure, if you want to run coq_makefile then you need a cygwin, but you should be able to use the coq from the installer.
It's interesting to read that a separate cygwin with make
works fine with the Platform-installer-provided coqc
and coq_makefile
though.
We should probably improve the documentation to explain the various scenarios that people might be interested in and how things can work for them.
yeah, I wasn't expecting that to work :)
I expected that, just because cygwin and "native" programs can mostly interoperate via the PATH
(not to say docs are complete, I agree with you).
@Théo Zimmermann : the hope was more that everybody switches to dune, so that makes gets obsolete. The main reason why one needs cygwin for make is that make needs a shell and a shell.
Yes, I agree that this is what we hope for the long-term. But we can expect the transition period to be several more years.
Last updated: Dec 01 2023 at 06:01 UTC