Skip to content

Commit

Permalink
Merge pull request #105 from MisterDA/dune-opam-fixes
Browse files Browse the repository at this point in the history
Dune, opam, and GitHub Actions fixes
  • Loading branch information
Sudha247 authored Jan 23, 2023
2 parents 5cfd180 + 43adf69 commit 446d457
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- ubuntu-latest
- macos-latest
ocaml-compiler:
- ocaml-base-compiler.5.0.0~beta1
- 5.0.x
- ocaml-variants.5.1.0+trunk

runs-on: ${{ matrix.os }}
Expand All @@ -25,7 +25,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get latest OCaml commit hash
id: multicore_hash
Expand Down
31 changes: 21 additions & 10 deletions domainslib.opam
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
maintainer: "KC Sivaramakrishnan <kc@kcsrk.info>"
synopsis: "Parallel Structures over Domains for Multicore OCaml"
maintainer: ["KC Sivaramakrishnan <kc@kcsrk.info>"]
authors: ["KC Sivaramakrishnan <kc@kcsrk.info>"]
license: "ISC"
homepage: "https://github.com/ocaml-multicore/domainslib"
doc: "https://kayceesrk.github.io/domainslib/doc"
synopsis: "Parallel Structures over Domains for Multicore OCaml"
license: "ISC"
dev-repo: "git+https://github.com/ocaml-multicore/domainslib.git"
bug-reports: "https://github.com/ocaml-multicore/domainslib/issues"
tags: []
depends: [
"ocaml" {>= "5.00"}
"dune" {>= "3.0"}
"lockfree" { >= "0.2.0"}
"mirage-clock-unix" {with-test}
"ocaml" {>= "5.0"}
"lockfree" {>= "0.2.0"}
"mirage-clock-unix" {with-test & >= "4.2.0"}
"qcheck-core" {with-test & >= "0.20"}
"qcheck-multicoretests-util" {with-test & >= "0.1"}
"qcheck-stm" {with-test & >= "0.1"}
"odoc" {with-doc}
]
depopts: []
build: [
"dune" "build" "-p" name
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/ocaml-multicore/domainslib.git"
21 changes: 20 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
(lang dune 1.8)
(lang dune 3.0)
(name domainslib)
(formatting disabled)
(generate_opam_files true)

(source (github ocaml-multicore/domainslib))
(authors "KC Sivaramakrishnan <kc@kcsrk.info>")
(maintainers "KC Sivaramakrishnan <kc@kcsrk.info>")
(documentation "https://kayceesrk.github.io/domainslib/doc")
(license "ISC")

(package
(name domainslib)
(synopsis "Parallel Structures over Domains for Multicore OCaml")
(depends
(ocaml (>= "5.0"))
(lockfree (>= "0.2.0"))
(mirage-clock-unix (and :with-test (>= "4.2.0")))
(qcheck-core (and :with-test (>= "0.20")))
(qcheck-multicoretests-util (and :with-test (>= "0.1")))
(qcheck-stm (and :with-test (>= "0.1")))))
7 changes: 0 additions & 7 deletions test/LU_decomposition_multicore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ let mat_size = try int_of_string Sys.argv.(2) with _ -> 1200
let k = Domain.DLS.new_key Random.State.make_self_init

module SquareMatrix = struct

let create f : float array =
let fa = Array.create_float (mat_size * mat_size) in
for i = 0 to mat_size * mat_size - 1 do
fa.(i) <- f (i / mat_size) (i mod mat_size)
done;
fa
let parallel_create pool f : float array =
let fa = Array.create_float (mat_size * mat_size) in
T.parallel_for pool ~start:0 ~finish:( mat_size * mat_size - 1)
Expand Down
3 changes: 2 additions & 1 deletion test/backtrace.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let _ =
let open Printexc in
let bt = get_raw_backtrace () in
let bt_slot_arr = Option.get (backtrace_slots bt) in
assert (Option.get (Slot.name bt_slot_arr.(1)) = "Backtrace.foo");
let name = Option.get (Slot.name bt_slot_arr.(1)) in
assert (name = "Backtrace.foo" || name = "Dune__exe__Backtrace.foo");
let s = raw_backtrace_to_string bt in
print_string s
2 changes: 2 additions & 0 deletions test/fib_par.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ let main =
let res = T.run pool (fun _ -> fib_par pool n) in
T.teardown_pool pool;
Printf.printf "fib(%d) = %d\n" n res

let () = main

0 comments on commit 446d457

Please sign in to comment.