Articles Labelled with “4Sigma”

Installing OPAM 1.1.1 on a CentOS 6.5

I'm in this situation: I need to compile an OCaml program on a CentOS 6.5 server. This is actually quite problematic, because CentOS 6.5 provide out of the box a very old OCaml 3.11.2, released by INRIA in January 2010, more than four years ago.

No problem, OPAM come to the rescue! No. The OPAM team doesn't provide a binary executable compatible with the (actually very old) system libraries present in CentOS.

Ok, step back: OPAM can be compiled from sources (instructions here) so it's just a matter of minutes. Again: nope. To compile OPAM you need at least OCaml 3.12.1, while in CentOS we have only 3.11.2.

Step back: first compile and install OCaml from sources. This time I say no, because the whole point of OPAM is to get an up and running OCaml environment in a few minutes, which is actually true in most cases.

I decide to install OCaml using GODI, the “old” OCaml source distribution, the one everybody used before OPAM was born. So the fastest steps to have an OPAM and OCaml environment on a CentOS server are:

  • download and install GODI;
  • clone the OPAM repository, compile and install it; it will find a “system” compiler provided by GODI;
  • $ opam switch 4.01.0 will recompile a new environment;
  • $ opam switch remove system to delete the “system” environment;
  • $ rm -Rf ~/godi.

No root access is required in this process, I usually install OPAM in ~/opam, and GODI in ~/godi.

There is an irony in all this story: GODI has been the OCaml source distribution for years, and the coming of OPAM, which is actually newer and has some important features missing in GODI, has produced many frictions in the OCaml community, that in the end caused the shut down of GODI.

The moral part here is: embrace the new things, but don't be too impatient in throwing out the window the precious work that, in the end, still works.

In any case, I want to thank both Gerd Stolpmann (author of GODI) and the OPAM team: they gave to the OCaml community a mature, industrial grade, set of tools to use OCaml.

Debugging memory in OCaml: any advice?

Memory consumption chart

A server I just deployed (written in OCaml, of course) seems to eat RAM at breakfast. This is the chart of the RSS field of "ps" in the past 24h (click to enlarge). The program starts with almost 6 Mb and is now reaching 40 Mb, in a linear trend that has nothing good to say.

Any advice on how to debug the memory consumption?

Segnalazione… pubblicitaria

Brevissimo post per segnalarvi la nascita di un nuovo fantastico blog, cui tengo molto visto che racconterà storie interessanti (si spera) che riguardano una piccola realtà italiana, lo Studio Associato 4Sigma.

Il fatto che incidentalmente io sia uno dei soci dello studio non vi tragga in inganno: il mio giudizio sul nuovo blog è del tutto disinteressato ;-)

Di cosa tratterà? A dire la verità non lo so ancora, per adesso direi che parleremo di tutto quello che possiamo ritenere interessante su due fronti, almeno: la gestione ed i problemi che affronta una piccola realtà che vuole fare della qualità (in Italia!) la propria bandiera e qualche argomento più prettamente tecnico, ispirato dalle quotidiane battaglie con la tecnologia informatica.

Non disdegneremo anche qualche aneddoto divertente nel rapporto di amore/odio con i clienti e, soprattutto, le critiche ai cosiddetti professionisti dell'ambiente. Che spesso si rivelano degli autentici truffatori.

Incubo PHP

Sto facendo la manutenzione di un vecchio sito che avevamo scritto in PHP.

Avevo pessimi ricordi di PHP, ma non mi ricordavo più quanto fosse un incubo programmare in questo, chiamiamolo così, linguaggio.

Disgustoso!

Copyright © 2004–2019 by .
Creative Commons License Content on this site is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Italy License.

RSS Feed. Valid XHTML 1.1. This blog is written in Objective Caml. Design based on the work of Rodrigo Galindez.