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

Add owl #341

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is make install step?

cd ..
sudo ldconfig /opt/OpenBLAS/lib/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why /opt, and why not /usr/local/lib? The other option is to install in /home/opam and update LD_LIBRARY_PATH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure why /opt is used I just followed the Dockerfile

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
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = $*)
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/owl/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(executable
(name test_owl)
(libraries owl owl-base))

(alias
(name buildbench)
(deps test_owl.exe))

7 changes: 7 additions & 0 deletions benchmarks/owl/test_owl.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
open Owl

let size = 2048

let _ =
let a = Mat.sequential size size in
Mat.(a * a);;
29 changes: 29 additions & 0 deletions dependencies/packages/camlzip/camlzip.1.11/opam
Original file line number Diff line number Diff line change
@@ -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 <xavier.leroy@college-de-france.fr>"]
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"
]
}
24 changes: 24 additions & 0 deletions dependencies/packages/npy/npy.0.0.9/opam
Original file line number Diff line number Diff line change
@@ -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 <lmazare@gmail.com>"
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"
]
}
29 changes: 29 additions & 0 deletions dependencies/packages/owl-base/owl-base.1.0.2/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

opam-version: "2.0"
maintainer: "Liang Wang <ryanrhymes@gmail.com>"
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"
]
}
45 changes: 45 additions & 0 deletions dependencies/packages/owl/owl.1.0.2/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
opam-version: "2.0"
maintainer: "Liang Wang <ryanrhymes@gmail.com>"
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"
]
}
29 changes: 29 additions & 0 deletions dependencies/packages/plplot/plplot.5.11.0/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
opam-version: "2.0"
maintainer: "Hezekiah M. Carty <hez@0ok.org>"
authors: [ "Hezekiah M. Carty <hez@0ok.org>" ]
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"
}
3 changes: 2 additions & 1 deletion dependencies/template/dev.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"}
Expand Down
13 changes: 11 additions & 2 deletions run_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"wrappers": [
{ "wrappers": [
{
"name": "orun",
"command": "orun -o %{output} -- taskset --cpu-list 5 %{command}"
Expand All @@ -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",
Expand Down