diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 929974ccae..0b38100873 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,16 @@ jobs: run: | sudo apt-get update && sudo apt-get -y install wget pkg-config libgmp-dev m4 libdw-dev jq python3-pip autoconf jo pip3 install intervaltree + # Work-around for Ubuntu-OpenBLAS issue for Owl by building OpenBLAS from source + sudo apt-get -y install unzip aspcud libshp-dev libplplot-dev gfortran pkg-config git + git clone https://github.com/xianyi/OpenBLAS OpenBLAS + cd OpenBLAS/ + make + cd .. + sudo ldconfig /opt/OpenBLAS/lib/ + OWL_DISABLE_LAPACKE_LINKING_FLAG=1 + OWL_COMPILE_CFLAGS="-I/opt/OpenBLAS/include -I/home/opam/OpenBLAS/lapack-netlib/LAPACKE/include/ -L/opt/OpenBLAS/lib" + CFLAGS=${OWL_COMPILE_CFLAGS} eval $(opam env) opam update opam pin add -n --yes dune https://github.com/dra27/dune/archive/2.9.3-5.0.0.tar.gz diff --git a/Makefile b/Makefile index b8c5ed0dc0..41c1644c52 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ START_TIME ?= WRAPPER = $(patsubst run_%,%,$(RUN_BENCH_TARGET)) -PACKAGES = sexplib0 re yojson react uuidm cpdf nbcodec minilight cubicle orun rungen +PACKAGES = owl sexplib0 re yojson react uuidm cpdf nbcodec minilight cubicle orun rungen ifeq ($(findstring multibench,$(BUILD_BENCH_TARGET)),multibench) PACKAGES += lockfree kcas domainslib ctypes @@ -135,10 +135,17 @@ _opam/%: _opam/opam-init/init.sh ocaml-versions/%.json @{ case "$*" in \ *5.0*) opam pin add -n --yes --switch $* sexplib0.v0.15.0 https://github.com/shakthimaan/sexplib0.git#multicore; \ esac }; - opam pin add -n --yes --switch $* base.v0.14.3 https://github.com/janestreet/base.git#v0.14.3 + opam pin add -n --yes --switch $* dune https://github.com/dra27/dune/archive/2.9.3-5.0.0.tar.gz + opam pin add -n --yes --switch $* base https://github.com/kit-ty-kate/base/archive/500-015.tar.gz opam pin add -n --yes --switch $* coq-core https://github.com/ejgallego/coq/archive/refs/tags/multicore-2021-09-29.tar.gz opam pin add -n --yes --switch $* coq-stdlib https://github.com/ejgallego/coq/archive/refs/tags/multicore-2021-09-29.tar.gz - opam pin add -n --yes --switch $* ocamlfind https://github.com/dra27/ocamlfind/archive/lib-layout.tar.gz + opam pin add -n --yes --switch $* npy https://github.com/Sudha247/npy-ocaml.git#500 + opam pin add -n --yes --switch $* eventlog-tools https://github.com/ocaml-multicore/eventlog-tools.git#multicore + opam pin add -n --yes --switch $* ocamlfind https://github.com/dra27/ocamlfind/archive/lib-layout.tar.gz + opam pin add -n --yes --switch $* ocplib-endian https://github.com/kit-ty-kate/ocplib-endian/archive/500.tar.gz + opam pin add -n --yes --switch $* owl https://github.com/moazzammoriani/owl.git#500+arm64 + opam pin add -n --yes --switch $* owl-base https://github.com/moazzammoriani/owl.git#500+arm64 + override_packages/%: setup_sys_dune/% $(eval CONFIG_SWITCH_NAME = $*) diff --git a/benchmarks/owl/dune b/benchmarks/owl/dune new file mode 100644 index 0000000000..25b4668298 --- /dev/null +++ b/benchmarks/owl/dune @@ -0,0 +1,8 @@ +(executable + (name test_owl) + (libraries owl owl-base)) + +(alias + (name buildbench) + (deps test_owl.exe)) + diff --git a/benchmarks/owl/test_owl.ml b/benchmarks/owl/test_owl.ml new file mode 100644 index 0000000000..c753a0f80d --- /dev/null +++ b/benchmarks/owl/test_owl.ml @@ -0,0 +1,7 @@ +open Owl + +let size = 2048 + +let _ = + let a = Mat.sequential size size in + Mat.(a * a);; diff --git a/dependencies/packages/camlzip/camlzip.1.11/opam b/dependencies/packages/camlzip/camlzip.1.11/opam new file mode 100644 index 0000000000..6dbdc844fa --- /dev/null +++ b/dependencies/packages/camlzip/camlzip.1.11/opam @@ -0,0 +1,29 @@ + + +opam-version: "2.0" +synopsis: + "Accessing compressed files in ZIP, GZIP and JAR format" +description: + "The Camlzip library provides easy access to compressed files in ZIP and GZIP format, as well as to Java JAR files. It provides functions for reading from and writing to compressed files in these formats." +maintainer: ["Xavier Leroy "] +authors: ["Xavier Leroy"] +homepage: "https://github.com/xavierleroy/camlzip" +bug-reports: "https://github.com/xavierleroy/camlzip/issues" +dev-repo: "git+https://github.com/xavierleroy/camlzip.git" +license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" +build: [ + [make "all"] +] +install: [make "install"] +depends: [ + "ocaml" {>= "4.07.0"} + "ocamlfind" {build} + "conf-zlib" +] +url { + src: "https://github.com/xavierleroy/camlzip/archive/rel111.tar.gz" + checksum: [ + "sha256=ffbbc5de3e1c13dc0e59272376d232d2ede91b327551063d47fddb74f1d5ed37" + "sha512=4d69ef900437e66e00cd345497ec70f407f28cd8344ee5f2fad685d3bfe356924597d1854b752f2841b4007f96d6e0307cfae7e13cfb6f74951ae3eba5198a06" + ] +} \ No newline at end of file diff --git a/dependencies/packages/npy/npy.0.0.9/opam b/dependencies/packages/npy/npy.0.0.9/opam new file mode 100644 index 0000000000..9ed401508e --- /dev/null +++ b/dependencies/packages/npy/npy.0.0.9/opam @@ -0,0 +1,24 @@ + +opam-version: "2.0" +bug-reports: "https://github.com/LaurentMazare/npy-ocaml/issues" +homepage: "https://github.com/LaurentMazare/npy-ocaml" +dev-repo: "git+https://github.com/LaurentMazare/npy-ocaml.git" +maintainer: "Laurent Mazare " +authors: [ "Laurent Mazare" ] + +build: [["dune" "build" "-p" name "-j" jobs]] +depends: [ + "camlzip" + "dune" {>= "1.4"} + "ocaml" {>= "4.06"} +] +synopsis: "Numpy npy file format reading/writing." +description: + "Provide simple read/write function using the numpy npy/npz file formats. These can be used to save a bigarray to disk and then load it from python using numpy." +url { + src: "https://github.com/LaurentMazare/npy-ocaml/archive/0.0.9.tar.gz" + checksum: [ + "md5=8a06935cb77ad546cd40872fcf7fd1e1" + "sha512=d682a748fd94d077e763bab259946690aff3b4da5ff374820e79802a49dc6f75ab0d0af3a739a52538453508687c3675a29860ff36c12f2b33a0de59c8ab5b2a" + ] +} \ No newline at end of file diff --git a/dependencies/packages/owl-base/owl-base.1.0.2/opam b/dependencies/packages/owl-base/owl-base.1.0.2/opam new file mode 100644 index 0000000000..ac1c8bd605 --- /dev/null +++ b/dependencies/packages/owl-base/owl-base.1.0.2/opam @@ -0,0 +1,29 @@ + +opam-version: "2.0" +maintainer: "Liang Wang " +authors: [ "Liang Wang" ] +license: "MIT" +homepage: "https://github.com/owlbarn/owl" +dev-repo: "git+https://github.com/owlbarn/owl.git" +bug-reports: "https://github.com/owlbarn/owl/issues" +doc: "https://owlbarn.github.io/" +synopsis: "OCaml Scientific and Engineering Computing - Base" +description: "Owl is an OCaml scientific library." +build: [ + [ "dune" "subst" ] {dev} + [ "dune" "build" "-p" name "-j" jobs ] +] + +depends: [ + "ocaml" {>= "4.10.0"} + "base-bigarray" + "dune" {>= "2.0.0"} +] +x-commit-hash: "dc77f1d3b7a4b81beba5bcfc4366317e044bce6d" +url { + src: "https://github.com/owlbarn/owl/releases/download/1.0.2/owl-1.0.2.tbz" + checksum: [ + "sha256=38d210ce6c1c2f09631fd59951430e4f364b5ae036c71ed1b32ce559b2a29263" + "sha512=c468100556445384b9c6adad9c37b5a9b8c27db8be35f61979e65fafa88c60221b8bda0a9c06cfbbc8d4e216a1ed08a315dfefb45bb4f5f15aa82d4358f57567" + ] +} \ No newline at end of file diff --git a/dependencies/packages/owl/owl.1.0.2/opam b/dependencies/packages/owl/owl.1.0.2/opam new file mode 100644 index 0000000000..8743df34dc --- /dev/null +++ b/dependencies/packages/owl/owl.1.0.2/opam @@ -0,0 +1,45 @@ +opam-version: "2.0" +maintainer: "Liang Wang " +authors: [ "Liang Wang" ] +license: "MIT" +homepage: "https://github.com/owlbarn/owl" +dev-repo: "git+https://github.com/owlbarn/owl.git" +bug-reports: "https://github.com/owlbarn/owl/issues" +doc: "https://owlbarn.github.io/owl/" +synopsis: "OCaml Scientific and Engineering Computing" +description: """ +Owl: OCaml Scientific and Engineering Computing + +Owl is an OCaml numerical library. +It supports N-dimensional arrays, both dense and sparse matrix operations, linear algebra, regressions, fast Fourier transforms, and many advanced mathematical and statistical functions (such as Markov chain Monte Carlo methods). +Recently, Owl has implemented algorithmic differentiation which essentially makes developing machine learning and neural network algorithms trivial. +""" + +build: [ + [ "dune" "subst" ] {dev} + [ "dune" "build" "-p" name "-j" jobs ] + [ "dune" "runtest" "-p" name "-j" jobs ] {with-test} +] + +depends: [ + "ocaml" {>= "4.10.0"} + "alcotest" {with-test} + "base" {build} + "base-bigarray" + "conf-openblas" {>= "0.2.1"} + "ctypes" {>= "0.16.0"} + "dune" {>= "2.0.0"} + "dune-configurator" + "eigen" {>= "0.3.0"} + "owl-base" {= version} + "stdio" {build} + "npy" +] +x-commit-hash: "dc77f1d3b7a4b81beba5bcfc4366317e044bce6d" +url { + src: "https://github.com/owlbarn/owl/releases/download/1.0.2/owl-1.0.2.tbz" + checksum: [ + "sha256=38d210ce6c1c2f09631fd59951430e4f364b5ae036c71ed1b32ce559b2a29263" + "sha512=c468100556445384b9c6adad9c37b5a9b8c27db8be35f61979e65fafa88c60221b8bda0a9c06cfbbc8d4e216a1ed08a315dfefb45bb4f5f15aa82d4358f57567" + ] +} diff --git a/dependencies/packages/plplot/plplot.5.11.0/opam b/dependencies/packages/plplot/plplot.5.11.0/opam new file mode 100644 index 0000000000..cad442614b --- /dev/null +++ b/dependencies/packages/plplot/plplot.5.11.0/opam @@ -0,0 +1,29 @@ +opam-version: "2.0" +maintainer: "Hezekiah M. Carty " +authors: [ "Hezekiah M. Carty " ] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" +homepage: "https://github.com/hcarty/ocaml-plplot/" +dev-repo: "git+https://github.com/hcarty/ocaml-plplot.git" +bug-reports: "https://github.com/hcarty/ocaml-plplot/issues" +build: [ + ["ocaml" "setup.ml" "-configure" "--prefix" prefix] + ["ocaml" "setup.ml" "-build"] + ["ocaml" "setup.ml" "-configure" "--enable-tests"] {with-test} + ["ocaml" "setup.ml" "-build"] {with-test} + ["ocaml" "setup.ml" "-test"] {with-test} +] +install: ["ocaml" "setup.ml" "-install"] +depends: [ + "ocaml" {>= "4.02.0"} + "ocamlbuild" {build} + "ocamlfind" {build} + "conf-plplot" +] +synopsis: "Bindings for the PLplot library" +description: """ +PLplot is a library for creating scientific plots. +http://plplot.sf.net/""" +url { + src: "https://github.com/moazzammoriani/ocaml-plplot/blob/main/archive/ocaml-plplot.tar.gz" + checksum: "md5=b73c6801b42187695d9d3aae96696143" +} diff --git a/dependencies/template/dev.opam b/dependencies/template/dev.opam index bcde0ffe95..8273d0ffba 100644 --- a/dependencies/template/dev.opam +++ b/dependencies/template/dev.opam @@ -19,6 +19,7 @@ depends: [ "conf-m4" {= "1"} "conf-perl" {= "1"} "conf-pkg-config" {= "1.2"} + "conf-openblas" {= "0.2.1"} "coq" "coq-core" "coq-stdlib" @@ -51,7 +52,7 @@ depends: [ "psmt2-frontend" {= "0.2"} "repr" {= "0.2.1"} "rresult" {= "0.6.0"} - "stdio" {= "v0.14.0"} + "stdio" {= "v0.15.0"} "stdlib-shims" {= "0.1.0"} "topkg" {= "1.0.3"} "uri" {= "4.1.0"} diff --git a/run_config.json b/run_config.json index 4f4f1dd66c..55df167157 100644 --- a/run_config.json +++ b/run_config.json @@ -1,5 +1,4 @@ -{ - "wrappers": [ +{ "wrappers": [ { "name": "orun", "command": "orun -o %{output} -- taskset --cpu-list 5 %{command}" @@ -18,6 +17,16 @@ } ], "benchmarks": [ + { + "executable": "benchmarks/owl/test_owl.exe", + "name": "test_owl", + "tags": [ + "buildbench" + ], + "runs": [ + { "params": "8192" } + ] + }, { "executable": "benchmarks/irmin/layers.exe", "name": "irmin_pack_layered_1",