Skip to content

Commit

Permalink
Reorganize the package logic into full and lite
Browse files Browse the repository at this point in the history
  • Loading branch information
rleonid committed Aug 17, 2016
1 parent a4184e7 commit d234331
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 19 deletions.
40 changes: 24 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,36 @@ PACKAGES=lacaml lbfgs ocephes
PACKAGES_TEST=$(PACKAGES) kaputt dsfo
PACKAGES_COVERED:=$(PACKAGES_TEST) bisect_ppx
PACKAGES_INSTALL=cppo $(PACKAGES_COVERED)
CPPO_TAG:=-plugin-tag 'package(cppo_ocamlbuild)'
CPPO_TAG:=-plugin-tag 'package(cppo_ocamlbuild)'

SOURCE_DIRS=/util /unc /stats /cls /rgr /uns
INSTALL_EXTS=a o cma cmi cmo cmt cmx cmxa cmxs

.PHONY: all clean test build install uninstall setup default doc omltest.native oml.cmxa oml_lite.cmxa lite

default: build

all: build

# This should be called something else.
setup:
opam pin add dsfo git://github.com/rleonid/dsfo
opam install $(PACKAGES_INSTALL)

#### Building

oml.cmxa:
ocamlbuild $(CPPO_TAG) -use-ocamlfind $(foreach package, $(PACKAGES),-package $(package)) -I src/lib oml.cma oml.cmxa oml.cmxs

lite:
lite:
ocamlbuild -build-dir $(LITE_BUILD_DIR) $(CPPO_TAG) -tag 'cppo_D(OML_LITE)' -use-ocamlfind -I src/lib oml.cma oml.cmxa oml.cmxs

build: oml.cmxa

clean:
ocamlbuild -clean
ocamlbuild -build-dir $(TEST_BUILD_DIR) -clean

#### Testing

omltest.native:
ocamlbuild -build-dir $(TEST_BUILD_DIR) \
$(CPPO_TAG) \
Expand All @@ -51,24 +58,22 @@ test_environment:
-use-ocamlfind $(foreach package, $(PACKAGES_COVERED),-package $(package)) \
-I src/lib -I src/test oml.cma omltest.native

clean:
ocamlbuild -clean
ocamlbuild -build-dir $(TEST_BUILD_DIR) -clean
#### Installing

install:
ocamlfind install oml META \
_build/src/lib/oml.a \
_build/src/lib/oml.o \
_build/src/lib/oml.cma \
_build/src/lib/oml.cmxa \
_build/src/lib/oml.cmxs \
_build/src/lib/*.cmi \
_build/src/lib/*.cmo \
_build/src/lib/*.cmx
cd pkg/full && ocamlfind install oml META $(foreach ext, $(INSTALL_EXTS), ../../_build/src/lib/oml.$(ext))

uninstall:
ocamlfind remove oml

install-lite:
cd pkg/lite && ocamlfind install oml-lite META $(foreach ext, $(INSTALL_EXTS), ../../${LITE_BUILD_DIR}/src/lib/oml.$(ext))

uninstall-lite:
ocamlfind remove oml-lite

#### Test Coverage

report_dir:
mkdir report_dir

Expand All @@ -83,6 +88,9 @@ report: report_dir
clean_reports:
rm -rf report_dir bisect*.out


#### Documentation

oml.odocl:
cp src/lib/oml.mlpack oml.odocl

Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions pkg/full/descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
An OCaml Math, Statistics, and ML Library

Common algorithms and procedures to perform exploratory data analysis,
machine learning and mathematical simulations.

This package wraps libraries that have C and Fortran bindings to numerical
code. For an OCaml only version. See oml-lite.
6 changes: 3 additions & 3 deletions opam → pkg/full/opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "1.2"
name: "oml"
version: "0.0.5"
version: "0.0.6"
available: [ ocaml-version >= "4.01" ]
maintainer: "Leonid Rozenberg <leonidr@gmail.com>"
authors: "Leonid Rozenberg <leonidr@gmail.com>"
Expand All @@ -14,6 +14,6 @@ remove: ["ocamlfind" "remove" "oml"]
depends: [
"ocamlfind" {build}
"lacaml" { >= "8.0.6" }
"lbfgs" { = "0.8.7" }
"ocephes" { = "0.8" }
"lbfgs" { >= "0.8.7" }
"ocephes" { >= "0.8" }
]
6 changes: 6 additions & 0 deletions pkg/lite/META
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description="OCaml Math Library (Lite)"
requires="lacaml lbfgs ocephes"
version="0.0.6"
directory="."
archive(byte)="oml.cma"
archive(native)="oml.cmxa"
7 changes: 7 additions & 0 deletions pkg/lite/descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
An OCaml (only) Math, Statistics, and ML Library

Common algorithms and procedures to perform exploratory data analysis,
machine learning and mathematical simulations.

This package exports a subset of oml that does not depend on any
C or Frotran bindings.
19 changes: 19 additions & 0 deletions pkg/lite/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
opam-version: "1.2"
name: "oml-lite"
version: "0.0.6"
available: [ ocaml-version >= "4.01" ]
maintainer: "Leonid Rozenberg <leonidr@gmail.com>"
authors: "Leonid Rozenberg <leonidr@gmail.com>"
homepage: "https://github.com/hammerlab/oml/"
dev-repo: "https://github.com/hammerlab/oml.git"
bug-reports: "https://github.com/hammerlab/oml/issues"
license: "Apache2"
build: [make]
install: [make "install-lite"]
remove: ["ocamlfind" "remove" "oml-lite"]
depends: [
"ocamlfind" {build}
"lacaml" { >= "8.0.6" }
"lbfgs" { >= "0.8.7" }
"ocephes" { >= "0.8" }
]

0 comments on commit d234331

Please sign in to comment.