User Tools

Site Tools


opam-software

Opam

OPAM is a source-based package manager for OCaml. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.

v1.2.0

Usage

  • Show all available versions of opam
    module avail opam
  • Load opam module:
    module load opam/1.2.0
  • get quick help:
    man opam

Installation

  • Clone opam git repo, compile & install it to /export/apps/
    git clone https://github.com/ocaml/opam.git
    cd opam
    sudo mkdir -p /export/apps/opam/1.2.0/
    sudo chown -R joguya:joguya /export/apps/opam/1.2.0/
    git checkout rebuild
    ./configure --prefix=/export/apps/opam/1.2.0/
    make lib-ext
    make
    make install
    sudo chown -R root:root /export/apps/opam/1.2.0/
  • opam module file
    #%Module1.0
    #####################################################################
    ##
    ## Opam Modulefile
    ## By James Oguya, j.oguya@cgiar.org
    ## November, 2014
    ##
    
    set appname         opam
    set version         1.2.0
    set prefix          /export/apps/${appname}/${version}
    set exec_prefix     ${prefix}/bin
    set url "https://opam.ocaml.org/"
    set msg "OPAM is a source-based package manager for OCaml. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.\nOpam Official Site: $url\n"
    
    module-whatis $msg
    
    proc ModulesHelp { } {
        puts stderr "$msg"
    }
    
    conflict        opam
    
    prepend-path    PATH    ${exec_prefix}
    
    # opam depends on ocaml module
    if { ![is-loaded ocaml] } {
        module load ocaml
    }
  • deploy the new module using ansible
    ansible-playbook site.yml -u joguya -K -s --limit=compute --tags=module
opam-software.txt · Last modified: 2014/12/02 06:49 by joguya