-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
opam
141 lines (99 loc) · 5.82 KB
/
opam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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/"
build: [
[ "jbuilder" "subst" "-p" name ] {dev}
[ "jbuilder" "build" "-p" name "-j" jobs ]
]
depends: [
"ocaml" {>= "4.06.0"}
"jbuilder" {>= "1.0+beta7"}
"ocaml-compiler-libs"
"owl"
"owl-zoo"
]
synopsis: "An OCaml Numerical Library"
description: """
Owl is an emerging numerical library for scientific computing and engineering. The library is developed in the OCaml language and inherits all its powerful features such as static type checking, powerful module system, and superior runtime efficiency. Owl allows you to write succinct type-safe numerical applications in functional language without sacrificing performance, significantly reduces the cost from prototype to production use.
Behind the scene, Owl builds the advanced numerical functions atop of its solid implementation of n-dimensional arrays. Quite different from other libraries, algorithmic differentiation and distributed computing have been included as integral components in the core library to maximise developers' productivity. Owl is young but grows fast, the current features include:
* N-dimensional array (both dense and sparse)
* Various number types: `float32`, `float64`, `complex32`, `complex64`, `int8`, `int16`, `int32` ...
* Linear algebra and full interface to CBLAS and LAPACKE
* Algorithmic differentiation (or automatic differentiation)
* Neural network module for deep learning applications
* Dynamic computational graph allowing greatest flexibility for applications
* Parallel and Distributed engine (map-reduce, parameter server, etc.)
* Advanced math and stats functions (e.g., hypothesis tests, MCMC, etc.)
* Zoo system for efficient scripting and code sharing
* GPU support (work in progress ...)
You can reach us in the following ways, looking forward to hearing from you!
- [Email Me](mailto:liang.wang@cl.cam.ac.uk)
- [Slack Channel](https://join.slack.com/t/owl-dev-team/shared_invite/enQtMjQ3OTM1MDY4MDIwLTA3MmMyMmQ5Y2U0NjJiNjI0NzFhZDAwNGFhODBmMTk4N2ZmNDExYjZiMzI2N2M1MGNiMTUyYTQ5MTAzZjliZDI)
## Learning
Owl's documentation contains a lot of learning materials to help you start. The full documentation consists of two parts: [Tutorial Book](http://www.cl.cam.ac.uk/~lw525/owl/chapter/index.html) and [API Reference](http://www.cl.cam.ac.uk/~lw525/owl/apidoc/index.html). Both are perfectly synchronised with the code in the repository by the automatic building system. You can access both parts with the following link.
* [Owl's Full Documentation](http://www.cl.cam.ac.uk/~lw525/owl/)
## Installation
Owl requires OCaml `>=4.06.0`. The installation is rather trivial. There are four possible ways to try out Owl, as shown below, from the most straightforward one to the least one.
### Option 1: Install from OPAM
You can simply type the following in the command line to start.
```bash
opam install owl
```
Owl's current version on OPAM is `0.2.9`, and it lags way behind the master branch (current `0.3.4`) and misses many new features. If you want to try the newest version, I recommend the other three ways to install.
### Option 2: Pull from Docker Hub
You only need to pull in [Owl's docker image](https://hub.docker.com/r/owlbarn/owl/) and start a container, then play with it in `utop`. The source code is stored in `/root/owl` directory.
```bash
docker pull owlbarn/owl
docker run -t -i owlbarn/owl
```
There are several Linux distributions provided including an [ARM-based Ubuntu](https://github.com/owlbarn/owl/blob/master/docker/Dockerfile.ubuntu.arm). You can pull in a specific Owl image with corresponding tags.
```bash
docker pull owlbarn/owl:ubuntu
docker pull owlbarn/owl:debian
docker pull owlbarn/owl:alpine
docker pull owlbarn/owl:centos
docker pull owlbarn/owl:opensuse
docker pull owlbarn/owl:fedora
```
All these images are perfectly synced with the master branch by automatic building. You can check the building history on [Docker Hub](https://hub.docker.com/r/owlbarn/owl/builds/).
### Option 3: Pin the Dev-Repo
`opam pin` allows us to pin the local code to Owl's development repository on Github. The first command `opam depext` installs all the dependencies Owl needs.
```bash
opam depext owl
opam pin add owl --dev-repo
```
### Option 4: Compile from Source
First, you need to clone the repository.
```bash
git clone git@github.com:owlbarn/owl.git
```
Second, you need to figure out the missing dependencies and install them.
```bash
jbuilder external-lib-deps --missing @install
```
Last, this is perhaps the most classic step.
```bash
make && make install
```
### CBLAS/LAPACKE Dependency
The most important dependency is [OpenBLAS](https://github.com/xianyi/OpenBLAS). Linking to the correct OpenBLAS is the key to achieve the best performance. Depending on the specific platform, you can use `yum`, `apt-get`, `brew` to install the binary format. For example on Mac OSX,
```bash
brew install homebrew/science/openblas
```
However, installing from OpenBLAS source code leads to way better performance in my own experiment. In future, the dependency on OpenBLAS should also be resolved by `opam` automatically.
### Integration to Toplevel
Owl is well integrated with `utop`. You can use `utop` to try out the experiments in our tutorials. If you want `utop` to automatically load Owl for you, you can also edit `.ocamlinit` file in your home folder by adding the following lines. (Note that the library name is `owl` with lowercase `o`.)
```bash"""
url {
src:
"https://github.com/owlbarn/owl/releases/download/0.3.7/owl-base-0.3.7.tbz"
checksum: [
"sha256=28d6c909f8f91cd8fd61fd1079b2f0e4bf8917bf33e2da96607caf63c73d0a39"
"md5=16454681ed82d527edf25eaee668c88a"
]
}