diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a1cad23b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build + +on: + - push + - pull_request + - workflow_dispatch + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + solver: + - nosundials + plot: + - nogtk + ocaml-version: + - 5.2.0 + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Use OCaml ${{ matrix.ocaml-version }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-version }} + + - name: Install OCaml dependencies + run: opam install -y graphics menhir alcotest + + - name: Install Sundials + if: matrix.solver == 'sundials' + run: opam depext conf-sundials + + - name: Install Sundials/ML + if: matrix.solver == 'sundials' + run: opam install sundialsml + + - name: Install Zelus + run: | + opam pin -y -n -k path . + opam install -y zelus + + - name: Install Gtk + if: matrix.plot == 'gtk' + run: opam install -y zelus-gtk diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml new file mode 100644 index 00000000..575f235a --- /dev/null +++ b/.github/workflows/opam.yml @@ -0,0 +1,25 @@ +name: Opam + +on: + push: + branches: + - 2024 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Use OCaml + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: 5.2.0 + + - name: Install OCaml dependencies + run: | + opam install graphics zelus + + diff --git a/src/compiler/main/compiler.ml b/src/compiler/main/compiler.ml index c6794a41..be64eb67 100644 --- a/src/compiler/main/compiler.ml +++ b/src/compiler/main/compiler.ml @@ -102,7 +102,7 @@ let print_message comment = let do_step comment output step input = print_message comment; let o = step input in - if !Misc.debug then output Format.err_formatter o; + if !Misc.verbose then output Format.err_formatter o; o let do_optional_step no_step comment output step input = @@ -162,6 +162,8 @@ let compile modname filename = let p = do_step "Mark functions calls to be inlined. See below:" Printer.program Markfunctions.program p in + let _ = Zelus.pp_program p in + (* source-to-source transformations *) (* defines the initial global environment for values *) diff --git a/src/dune b/src/dune index b8057a8c..7497e80b 100644 --- a/src/dune +++ b/src/dune @@ -214,6 +214,7 @@ (libraries zelus.parser_lib zelus.global_lib zelus.zrun_lib zelus.typing_lib zelus.causality_lib zelus.initialization_lib zelus.rewrite_lib zelus.seqcode_lib) + (preprocess (pps ppx_deriving.show)) (promote (until-clean) (into ..))) (install diff --git a/src/global/zelus.ml b/src/global/zelus.ml index a3fc84bf..930f7bf3 100644 --- a/src/global/zelus.ml +++ b/src/global/zelus.ml @@ -488,4 +488,7 @@ and ('info, 'ienv) implementation_desc = type ('info, 'ienv) program = { p_impl_list : ('info, 'ienv) implementation list; p_index : Ident.num } + [@@deriving show] + +let f = show_program;;