Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ stages:
variables:
# Format: $IMAGE-V$DATE [Cache is not used as of today but kept here
# for reference]
CACHEKEY: "bionic_coq-V2020-09-16-V38"
CACHEKEY: "bionic_coq-V2020-09-17-V88"
IMAGE: "$CI_REGISTRY_IMAGE:$CACHEKEY"
# By default, jobs run in the base switch; override to select another switch
OPAM_SWITCH: "base"
Expand Down Expand Up @@ -605,7 +605,7 @@ test-suite:edge:dune:dev:
- opam repo add ocaml-beta https://github.com/ocaml/ocaml-beta-repository.git
- opam update
- opam install ocaml-variants=$OCAMLVER
- opam install dune num zarith
- opam install dune zarith
- eval $(opam env)
- export COQ_UNIT_TEST=noop
- make -f Makefile.dune test-suite
Expand Down
21 changes: 9 additions & 12 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ To compile Coq yourself, you need:
- [OCaml](https://ocaml.org/) (version >= 4.05.0)
(This version of Coq has been tested up to OCaml 4.11.1)

- The [num](https://github.com/ocaml/num) library; note that it is
included in the OCaml distribution for OCaml versions < 4.06.0

- The [ZArith library](https://github.com/ocaml/Zarith) >= 1.10

- The [findlib](http://projects.camlcity.org/projects/findlib.html) library (version >= 1.8.0)
Expand All @@ -35,15 +32,15 @@ To compile Coq yourself, you need:
(version >= 3.0.beta8), and the corresponding GTK 3.x libraries, as
of today (gtk+3 >= 3.18 and gtksourceview3 >= 3.18)

The IEEE-754 compliance is required by primitive floating-point
numbers (`Require Import Floats`). Common sources of incompatibility
are checked at configure time, preventing compilation. In the,
unlikely, event an incompatibility remains undetected, using Floats
would enable to prove False on this architecture.
Primitive floating-point numbers require IEEE-754 compliance
(`Require Import Floats`). Common sources of incompatibility
are checked at configure time, preventing compilation. In the
unlikely event an incompatibility remains undetected, using `Floats`
would enable proving `False` on this architecture.

Note that `num` and `lablgtk3-sourceview3` should be properly
registered with `findlib/ocamlfind` as Coq's makefile will use it to
locate the libraries during the build.
Note that OCaml dependencies (`zarith` and `lablgtk3-sourceview3` at
this moment) must be properly registered with `findlib/ocamlfind`
since Coq's build system uses `findlib` to locate them.

Debian / Ubuntu users can get the necessary system packages for
CoqIDE with:
Expand All @@ -55,7 +52,7 @@ the corresponding packages.

$ opam switch create coq 4.11.1+flambda
$ eval $(opam env)
$ opam install num ocamlfind lablgtk3-sourceview3
$ opam install ocamlfind zarith lablgtk3-sourceview3

should get you a reasonable OCaml environment to compile Coq. See the
OPAM documentation for more help.
Expand Down
4 changes: 2 additions & 2 deletions META.coq.in
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ package "toplevel" (
description = "Coq Toplevel"
version = "8.13"

requires = "num, coq.stm"
requires = "coq.stm"
directory = "toplevel"

archive(byte) = "toplevel.cma"
Expand Down Expand Up @@ -327,7 +327,7 @@ package "plugins" (
description = "Coq micromega plugin"
version = "8.13"

requires = "num, coq.plugins.ltac"
requires = "coq.plugins.ltac"
directory = "micromega"

archive(byte) = "micromega_plugin.cmo"
Expand Down
12 changes: 6 additions & 6 deletions Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ $(OCAMLC) $(MLINCLUDES) $(BYTEFLAGS) $(CUSTOM) -o $@ -linkpkg $(1) $^
endef

# Main packages linked by Coq.
SYSMOD:=-package str,unix,dynlink,threads,num,zarith
SYSMOD:=-package str,unix,dynlink,threads,zarith

###########################################################################
# Infrastructure for the rest of the Makefile
Expand Down Expand Up @@ -587,11 +587,11 @@ CSDPCERTCMO:=clib/clib.cma $(addprefix plugins/micromega/, \

$(CSDPCERT): $(call bestobj, $(CSDPCERTCMO))
$(SHOW)'OCAMLBEST -o $@'
$(HIDE)$(call bestocaml, -package num,unix)
$(HIDE)$(call bestocaml, -package unix)

$(CSDPCERTBYTE): $(CSDPCERTCMO)
$(SHOW)'OCAMLC -o $@'
$(HIDE)$(call ocamlbyte, -package num,unix)
$(HIDE)$(call ocamlbyte, -package unix)

###########################################################################
# tests
Expand Down Expand Up @@ -707,15 +707,15 @@ COND_OPTFLAGS= \

plugins/micromega/%.cmi: plugins/micromega/%.mli
$(SHOW)'OCAMLC $<'
$(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $<
$(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix -c $<

%.cmi: %.mli
$(SHOW)'OCAMLC $<'
$(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -c $<

plugins/micromega/%.cmo: plugins/micromega/%.ml
$(SHOW)'OCAMLC $<'
$(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $<
$(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix -c $<

%.cmo: %.ml
$(SHOW)'OCAMLC $<'
Expand Down Expand Up @@ -752,7 +752,7 @@ plugins/micromega/csdpcert_FORPACK:=

plugins/micromega/%.cmx: plugins/micromega/%.ml
$(SHOW)'OCAMLOPT $<'
$(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -package unix,num -c $<
$(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -package unix -c $<

plugins/%.cmx: plugins/%.ml
$(SHOW)'OCAMLOPT $<'
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
opam switch set ocaml-base-compiler.$COMPILER
eval $(opam env)
opam update
opam install -j "$NJOBS" num ocamlfind${FINDLIB_VER} ounit lablgtk3-sourceview3 zarith.1.10
opam install -j "$NJOBS" ocamlfind${FINDLIB_VER} ounit lablgtk3-sourceview3 zarith.1.10
opam list
displayName: 'Install OCaml dependencies'
env:
Expand Down
15 changes: 4 additions & 11 deletions configure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -688,23 +688,16 @@ let operating_system =
else
(try Sys.getenv "OS" with Not_found -> "")

(** Zarith and num libraries *)

let check_for_numlib () =
(if caml_version_nums >= [4;6;0] then
let numlib,_ = tryrun camlexec.find ["query";"num"] in
match numlib with
| "" ->
die "Num library not installed, required for OCaml 4.06 or later"
| _ -> cprintf "You have the Num library installed. Good!");
(** Zarith library *)

let check_for_zarith () =
let zarith,_ = tryrun camlexec.find ["query";"zarith"] in
match zarith with
| "" ->
die "Zarith library not installed, required"
| _ -> cprintf "You have the Zarith library installed. Good!"

let numlib =
check_for_numlib ()
let numlib = check_for_zarith ()

(** * lablgtk3 and CoqIDE *)

Expand Down
1 change: 0 additions & 1 deletion coq.opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ depends: [
"ocaml" { >= "4.05.0" }
"dune" { >= "2.5.0" }
"ocamlfind" { build }
"num"
"zarith" { >= "1.10" }
]

Expand Down
1 change: 0 additions & 1 deletion coq.opam.docker
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ version: "dev"
depends: [
"ocaml" { >= "4.05.0" }
"ocamlfind" { build }
"num"
"zarith" { >= "1.10" }
"conf-findutils" {build}
]
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
# Since #12604, ocamlfind looks for num when building plugins
# This follows a similar change in the nixpkgs repo (cf. NixOS/nixpkgs#94230)
# Same for zarith which is needed since its introduction as a dependency of Coq
propagatedBuildInputs = with ocamlPackages; [ num zarith ];
propagatedBuildInputs = with ocamlPackages; [ zarith ];

src =
if shell then null
Expand Down
8 changes: 3 additions & 5 deletions dev/ci/docker/bionic_coq/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CACHEKEY: "bionic_coq-V2020-09-16-V38"
# CACHEKEY: "bionic_coq-V2020-09-17-V88"
# ^^ Update when modifying this file.

FROM ubuntu:bionic
Expand Down Expand Up @@ -40,10 +40,8 @@ ENV NJOBS="2" \
# Base opam is the set of base packages required by Coq
ENV COMPILER="4.05.0"

# Common OPAM packages, num to be removed once the migration to
# micromega is complete, `num` also does not have a version number as
# the right version to install varies with the compiler version.
ENV BASE_OPAM="num zarith.1.10 ocamlfind.1.8.1 ounit2.2.2.3 odoc.1.5.1" \
# Common OPAM packages
ENV BASE_OPAM="zarith.1.10 ocamlfind.1.8.1 ounit2.2.2.3 odoc.1.5.1" \
CI_OPAM="menhir.20190626 ocamlgraph.1.8.8" \
BASE_ONLY_OPAM="elpi.1.11.0"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- **Removed:**
The `num` library is not linked to Coq anymore
(`#13007 <https://github.com/coq/coq/pull/13007>`_,
by Emilio Jesus Gallego Arias).
2 changes: 1 addition & 1 deletion plugins/micromega/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; be careful not to link the executable to the plugin!
(modules (:standard \ csdpcert g_zify zify))
(synopsis "Coq's micromega plugin")
(libraries num coq.plugins.ltac))
(libraries coq.plugins.ltac))

(executable
(name csdpcert)
Expand Down
2 changes: 1 addition & 1 deletion tools/CoqMakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ BEFORE ?=
AFTER ?=

# FIXME this should be generated by Coq (modules already linked by Coq)
CAMLDONTLINK=str,unix,dynlink,threads,num,zarith
CAMLDONTLINK=str,unix,dynlink,threads,zarith

# OCaml binaries
CAMLC ?= "$(OCAMLFIND)" ocamlc -c
Expand Down
3 changes: 1 addition & 2 deletions toplevel/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
(public_name coq.toplevel)
(synopsis "Coq's Interactive Shell [terminal-based]")
(wrapped false)
; num still here due to some plugins using it
(libraries num coq.stm))
(libraries coq.stm))
; Interp provides the `zarith` library to plugins, we could also use
; -linkall in the plugins file, to be discussed.

Expand Down