Skip to content

Commit 446d457

Browse files
authored
Merge pull request #105 from MisterDA/dune-opam-fixes
Dune, opam, and GitHub Actions fixes
2 parents 5cfd180 + 43adf69 commit 446d457

File tree

6 files changed

+47
-21
lines changed

6 files changed

+47
-21
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- ubuntu-latest
1616
- macos-latest
1717
ocaml-compiler:
18-
- ocaml-base-compiler.5.0.0~beta1
18+
- 5.0.x
1919
- ocaml-variants.5.1.0+trunk
2020

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

2626
steps:
2727
- name: Checkout code
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2929

3030
- name: Get latest OCaml commit hash
3131
id: multicore_hash

domainslib.opam

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
1+
# This file is generated by dune, edit dune-project instead
12
opam-version: "2.0"
2-
maintainer: "KC Sivaramakrishnan <[email protected]>"
3+
synopsis: "Parallel Structures over Domains for Multicore OCaml"
4+
maintainer: ["KC Sivaramakrishnan <[email protected]>"]
35
authors: ["KC Sivaramakrishnan <[email protected]>"]
6+
license: "ISC"
47
homepage: "https://github.com/ocaml-multicore/domainslib"
58
doc: "https://kayceesrk.github.io/domainslib/doc"
6-
synopsis: "Parallel Structures over Domains for Multicore OCaml"
7-
license: "ISC"
8-
dev-repo: "git+https://github.com/ocaml-multicore/domainslib.git"
99
bug-reports: "https://github.com/ocaml-multicore/domainslib/issues"
10-
tags: []
1110
depends: [
12-
"ocaml" {>= "5.00"}
1311
"dune" {>= "3.0"}
14-
"lockfree" { >= "0.2.0"}
15-
"mirage-clock-unix" {with-test}
12+
"ocaml" {>= "5.0"}
13+
"lockfree" {>= "0.2.0"}
14+
"mirage-clock-unix" {with-test & >= "4.2.0"}
1615
"qcheck-core" {with-test & >= "0.20"}
1716
"qcheck-multicoretests-util" {with-test & >= "0.1"}
1817
"qcheck-stm" {with-test & >= "0.1"}
18+
"odoc" {with-doc}
1919
]
20-
depopts: []
2120
build: [
22-
"dune" "build" "-p" name
21+
["dune" "subst"] {dev}
22+
[
23+
"dune"
24+
"build"
25+
"-p"
26+
name
27+
"-j"
28+
jobs
29+
"@install"
30+
"@runtest" {with-test}
31+
"@doc" {with-doc}
32+
]
2333
]
34+
dev-repo: "git+https://github.com/ocaml-multicore/domainslib.git"

dune-project

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
1-
(lang dune 1.8)
1+
(lang dune 3.0)
22
(name domainslib)
3+
(formatting disabled)
4+
(generate_opam_files true)
5+
6+
(source (github ocaml-multicore/domainslib))
7+
(authors "KC Sivaramakrishnan <[email protected]>")
8+
(maintainers "KC Sivaramakrishnan <[email protected]>")
9+
(documentation "https://kayceesrk.github.io/domainslib/doc")
10+
(license "ISC")
11+
12+
(package
13+
(name domainslib)
14+
(synopsis "Parallel Structures over Domains for Multicore OCaml")
15+
(depends
16+
(ocaml (>= "5.0"))
17+
(lockfree (>= "0.2.0"))
18+
(mirage-clock-unix (and :with-test (>= "4.2.0")))
19+
(qcheck-core (and :with-test (>= "0.20")))
20+
(qcheck-multicoretests-util (and :with-test (>= "0.1")))
21+
(qcheck-stm (and :with-test (>= "0.1")))))

test/LU_decomposition_multicore.ml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ let mat_size = try int_of_string Sys.argv.(2) with _ -> 1200
55
let k = Domain.DLS.new_key Random.State.make_self_init
66

77
module SquareMatrix = struct
8-
9-
let create f : float array =
10-
let fa = Array.create_float (mat_size * mat_size) in
11-
for i = 0 to mat_size * mat_size - 1 do
12-
fa.(i) <- f (i / mat_size) (i mod mat_size)
13-
done;
14-
fa
158
let parallel_create pool f : float array =
169
let fa = Array.create_float (mat_size * mat_size) in
1710
T.parallel_for pool ~start:0 ~finish:( mat_size * mat_size - 1)

test/backtrace.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ let _ =
3131
let open Printexc in
3232
let bt = get_raw_backtrace () in
3333
let bt_slot_arr = Option.get (backtrace_slots bt) in
34-
assert (Option.get (Slot.name bt_slot_arr.(1)) = "Backtrace.foo");
34+
let name = Option.get (Slot.name bt_slot_arr.(1)) in
35+
assert (name = "Backtrace.foo" || name = "Dune__exe__Backtrace.foo");
3536
let s = raw_backtrace_to_string bt in
3637
print_string s

test/fib_par.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ let main =
1919
let res = T.run pool (fun _ -> fib_par pool n) in
2020
T.teardown_pool pool;
2121
Printf.printf "fib(%d) = %d\n" n res
22+
23+
let () = main

0 commit comments

Comments
 (0)