package starterkit

  1. Overview
  2. Docs


Welcome to OCaml coding, here's an example _oasis file to get you started

OASISFormat: 0.4 OCamlVersion: >= 4.02.0 Name: opam_package_name Version: 0.1.0 Maintainers: New OCaml programmer Homepage: Synopsis: Some short description Authors: License: BSD-3-clause Plugins: META (0.4), DevFiles (0.4) AlphaFeatures: ocamlbuild_more_args

Description: Some cool description

This is a comment and this below creates an binary program

Executable <some_program_name> Path: src BuildTools:ocamlbuild install: true MainIs: CompiledObject: native BuildDepends: package_one, package_two

Another comment, this builds a library called pg

Library pg Path: src

oasis will figure out the dependencies,

Just list the modules you want public,

Note that there's no .ml, just give the name

Modules: Pg CompiledObject: best BuildDepends: some_package, another_package

Here's one that uses C/C++ code, adapt as needed

Library lib_with_c Path: src BuildTools:ocamlbuild install: true CClib: -L/usr/local/lib -lfoo -lbar -lstdc++ CCOpt: -g -Wall -std=c++11 -x c++ -I/usr/local/include NativeOpt: -cc g++ ByteOpt: -cc g++ Modules: Some_lib CompiledObject: best CSources: some_lib_stubs.c BuildDepends: opam_lib1, opam_lib2

Auto generate everything with:

oasis setup -setup-update dynamic

then a simple

make builds your project.

Published: 28 Mar 2016

Dev Dependencies


Used by





Innovation. Community. Security.