Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] [wip] Support for the dune build system v2 #143

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
24 changes: 14 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install packages
run: sudo apt-get install ocaml-nox libgmp-dev
run: sudo apt-get install ocaml-nox libgmp-dev opam
- name: Checkout
uses: actions/checkout@v2
- name: configure tree
run: ./configure
- name: init opam
run: opam init
- name: install deps
run: opam install . --deps-only --with-test --yes
- name: Build
run: make
run: opam exec -- dune build
- name: Run the testsuite
run: make -C tests test
run: opam exec -- dune runtest

MacOS:
runs-on: macos-latest
steps:
- name: Install packages
run: brew install ocaml ocaml-findlib gmp
run: brew install ocaml ocaml-findlib gmp opam
- name: Checkout
uses: actions/checkout@v2
- name: configure tree
run: ./configure
- name: init opam
run: opam init
- name: install deps
run: opam install . --deps-only --with-test --yes
- name: Build
run: make
run: opam exec -- dune build
- name: Run the testsuite
run: make -C tests test
run: opam exec -- dune runtest
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:

- run: opam install . --with-test --deps-only

- name: configure tree
run: opam exec -- sh ./configure
- name: install deps
run: opam install . --deps-only --with-test --yes

- name: Build
run: opam exec -- make
run: opam exec -- dune build

- name: Run the testsuite
run: opam exec -- make -C tests test
run: opam exec -- dune runtest

- run: opam install . --with-test

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
Makefile.config
depend
zarith_version.ml
_build
.merlin
c-flags.sexp
library-flags.sexp
4 changes: 4 additions & 0 deletions DUNE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- why use -linkall for zarith.cmxs ?
- do we need -failsafe when calling OCAMLMKLIB
- do we need -O3 -Wall -Wextra
- we not longer test bytecode
18 changes: 0 additions & 18 deletions META

This file was deleted.

143 changes: 0 additions & 143 deletions Makefile

This file was deleted.

51 changes: 17 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,20 @@ provided by [Zarith_stubs_js](https://github.com/janestreet/zarith_stubs_js).
* OCaml, version 4.04.0 or later.
* Either the GMP library or the MPIR library, including development files.
* GCC or Clang or a gcc-compatible C compiler and assembler (other compilers may work).
* The Findlib package manager (optional, recommended).
* dune, version 2.7 or later


## INSTALLATION

1) First, run the "configure" script by typing:
1) First, build with
```
./configure
dune build
```
The `configure` script has a few options. Use the `-help` option to get a
list and short description of each option.

2) It creates a Makefile, which can be invoked by:
```
make
```
This builds native and bytecode versions of the library.

3) The libraries are installed by typing:
```
make install
```
or, if you install to a system location but are not an administrator
```
sudo make install
dune install
```
If Findlib is detected, it is used to install files.
Otherwise, the files are copied to a `zarith/` subdirectory of the directory
given by `ocamlc -where`.

The libraries are named `zarith.cmxa` and `zarith.cma`, and the Findlib module
is named `zarith`.
Expand All @@ -73,13 +58,13 @@ option to `ocamlc` / `ocamlopt`, or the `-package zarith` option to `ocamlfind`.

4) (optional, recommended) Test programs are built and run by the additional command
```
make tests
dune runtest
```
(but these are not installed).

5) (optional) HTML API documentation is built (using `ocamldoc`) by the additional command
5) (optional) HTML API documentation is built (using `odoc`) by the additional command
```
make doc
dune build @doc
```

## ONLINE DOCUMENTATION
Expand Down Expand Up @@ -115,15 +100,13 @@ INRIA Rocquencourt (Institut national de recherche en informatique, France).

## CONTENTS

Source files | Description
--------------------|-----------------------------------------
configure | configuration script
z.ml[i] | Z module and implementation for small integers
caml_z.c | C implementation
big_int_z.ml[i] | wrapper to provide a Big_int compatible API to Z
q.ml[i] | rational library, pure OCaml on top of Z
zarith_top.ml | toplevel module to provide pretty-printing
projet.mak | builds Z, Q and the tests
zarith.opam | package description for opam
z_mlgmpidl.ml[i] | conversion between Zarith and MLGMPIDL
tests/ | simple regression tests and benchmarks
Source files | Description
----- ------------------|-----------------------------------------
src/z.ml[i] | Z module and implementation for small integers
src/caml_z.c | C implementation
src/big_int_z.ml[i] | wrapper to provide a Big_int compatible API to Z
src/q.ml[i] | rational library, pure OCaml on top of Z
src/top/zarith_top.ml | toplevel module to provide pretty-printing
zarith.opam | package description for opam
z_mlgmpidl/* | conversion between Zarith and MLGMPIDL
tests/ | simple regression tests and benchmarks
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.13
Loading
Loading