caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: Portability of applications written in OCAML: C stuff
@ 2000-02-25 12:29 Juergen Pfitzenmaier
  2000-02-25 16:51 ` skaller
  0 siblings, 1 reply; 15+ messages in thread
From: Juergen Pfitzenmaier @ 2000-02-25 12:29 UTC (permalink / raw)
  To: caml-list

Max Skaller wrote on Wed, 23 Feb 2000 10:43:46 +1100
>         1. DO NOT USE A FILE CALLED 'config.h'
....
>        do NOT use generic names on the assumption your code will
>        be built with your Makefile in a separate directory.

I have seen some big projects (> 100 MB code) and several smaller ones. In each of
them people had to fight with the configuration. They all settled for what seems to
be the least pain: built and distribute (!) in small blocks; keep each block in its
own directory; use the same general frame for each block if possible (yes: use the
name config.h over and over again).
Even if its leading away from OCaml: I think that your real problem is with "make"
and its way of building project. Look for "configuration management" and "make replacement"
on the net.

pfitzen



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Portability of applications written in OCAML: C stuff
@ 2000-02-26 18:47 Juergen Pfitzenmaier
  0 siblings, 0 replies; 15+ messages in thread
From: Juergen Pfitzenmaier @ 2000-02-26 18:47 UTC (permalink / raw)
  To: caml-list

Sorry, I forgot that URL last time. Here they are.
   http://www.baldmt.com/cons/
   ftp://ftp.cs.colorado.edu/pub/distribs/odin/

pfitzen



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re:  Portability of applications written in OCAML: C stuff
@ 2000-02-25 14:05 Juergen Pfitzenmaier
  0 siblings, 0 replies; 15+ messages in thread
From: Juergen Pfitzenmaier @ 2000-02-25 14:05 UTC (permalink / raw)
  To: caml-list

Alan Schmitt wrote on Fri, 25 Feb 2000 08:37:43 +0000
>  Now if you would be so kind as to explain what better solution you
>  have compared to makefiles, I'm all ears.
I don't know what others have to say, but take a look at tools like odin and cons.

pfitzen



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Portability of applications written in OCAML
@ 2000-02-15 13:01 Claude Marche
  2000-02-16 22:49 ` Gerd Stolpmann
  0 siblings, 1 reply; 15+ messages in thread
From: Claude Marche @ 2000-02-15 13:01 UTC (permalink / raw)
  To: caml-list


Bonjour,

[long message, english translation follows]

J'ai des remarques et des questions à propos de la façon dont on peut
distribuer une application écrite en Objective CAML, et sur la
portabilité à laquelle on peut s'attendre.

Voici mon problème : supposons que l'on ait programmé une application
en ocaml, que l'on a envie de distribuer (gratuitement) sur le
Web, comment doit-on procéder pour la distribuer ? Supposons que cette
application n'ait en elle-meme rien à voir avec CAML, et que l'on
souhaite atteindre un public qui a priori ne connait pas ce langage,
et ne dispose pas du compilateur ni de l'interpréteur.

Pour distribuer, on peut proposer a priori les sources, et aussi des
exécutables (compilés avec ocamlopt pour que ça aille
vite). Proposer les sources pose un problème car une personne
intéressée par cette application devra au préalable installer ocaml
sur son ordinateur, et cela rebuterait je pense une grande partie des
personnes intéressées au départ. Proposer des binaires contourne ce
problème mais on entre dans de multiples problemes de configuration,
car l'exécutable ne pourra fonctionner que sur la bonne architecture,
avec la bonne version du bon OS, sans oublier les problèmes de
versions de bibliothèques dynamiques (curses/ncurses, libc/glibc,
etc.) 

Le juste milieu me semble être d'utiliser le bytecode : Est-ce que
c'est vrai qu'il est possible d'executer n'importe quel bytecode sur
n'importe quel archi et OS à partir du moment où on a le ocamlrun
approprié pour cette architecture et cet OS ? (Meme sous des OS non
unix comme Microsoft-Windows ou Mac-OS ?) Si oui, un utilisateur
potentiel de l'application n'aurait pas besoin d'installer tout ocaml
mais seulement une version de ocamlrun appropriée pour sa combinaison
architecture/OS. Cela permettrait a cet utilisateur potentiel de
facilement essayer l'application qui l'interesse, et s'il la trouve
utile pour lui, il sera alors motivé pour faire l'effort d'installer
ocaml pour compiler une version en code natif de cette application
pour son archi et son OS.

Pour que cela fonctionne, il faudrait qu'il existe quelque part sur le
Web une sorte d'archive de versions de ocamlrun, permettant de choisir
son architecture, son OS, la version ocaml requise, peut-etre aussi
certaines variantes de bibliotheques comme libc 5 ou 6, glibc.

Je pense qu'il y a potentiellement un nombre non negligeable
d'applications concernées, il suffit de se promener un peu sur la «
bosse » : HeVeA, GeneWeb, Bibtex2html, et bien d'autres.

Il y a néanmoins un problème ennuyeux: dès qu'une application devient
un peu conséquente, il arrive que l'on commence à utiliser des
bibliothèques comme unix, str, nums, threads, qui nécessitent une
compilation en -custom. Si j'ai bien compris, les binaires obtenus
contiennent le code natif de l'interpréteur de bytecode lui-même, et
ne sont plus portables. Est-il techniquement possible de changer cela
en utilisant un ocamlrun linké avec ces bibliothèques ?

Pour résumer mon propos, voici donc les questions que je me pose :

1) Un fichier de bytecode est-il exécutable par ocamlrun sur n'importe
   quelle combinaison d'une architecture et d'un OS ? Y compris OS non
   unix ?

2) Est-il possible de fabriquer des versions d'ocamlrun contenant en
   plus des bibliothèques linkées habituellement avec -custom : unix,
   str, nums, threads ; et par conséquent pourraient exécuter des
   bytecode portables utilisant ces bibliotheques ?

Si ceci est techniquement faisable, cela m'intéresserait de connaitre
les personnes intéressées par l'utiliser, pour distribuer leur propre
application sous forme de bytecode portable. De plus, pour constituer
cette archive de binaires ocamlrun, il faudrait la participation du
plus grand nombre de personnes possible afin de couvrir largement les
combinaisons d'architectures et d'OS. Personnellement j'ai accès à des
PC sous Linux (Distribution Redhat en général) et des SPARC sous
Solaris 2.7, mais c'est tout.

Toutes remarques, toutes suggestions et tous commentaires sont les
bienvenus. Mon but est de pouvoir distribuer le plus largement
possible une application écrite en Ocaml, en évitant des remarques du
genre « cette application m'intéresse mais je ne peux pas compiler le
Ocaml et vous ne fournissez pas un binaire adapté à ma configuration
», et je serais heureux d'entendre toute suggestion permettant
d'atteindre ce but.

[English translation]

I have a few remarks and questions about how one may distribute an
application written in Objective CAML, and how much portability one
may expect.

Here is my problem: suppose one has written an application in ocaml,
and wants to distribute it (freely) on the Web, how should he proceed?
Suppose that the application itself has nothing to do with CAML, and
one wants to reach people that do not know a priori this langage, so
do not have caml installed on their computer.

Distribution could be achieve by making the source files available,
and also some binary executables (compiled with ocamlopt for
efficiency). Installing from source is not nice because anyone
interested must first install ocaml on his computer, and I think that
many people in that case would not do it, and will better try to find
another application doing the same thing but easier to install.
Distributing binaries is not nice also, because one may encounter many
configuration problems, the program will run only for the right
architecture, the right version of the right OS, not to mention
problems with versions of dynamic libraries (curses/ncurses,
libc/glibc, etc.)

One idea could be distributing bytecode: is it true the any bytecode
can be executed on any architecture and OS as soon as the right
ocamlrun is used? (Even under non unix OSs like Microsoft-Windows or
Mac-OS?) If yes, anyone interested in using the application would
need only to install the suitable ocamlrun for its architecture/OS
combination.  It would allow any potentially interested user to try
the application, and in case he finds it suitable for its need, he
would be motivated to install ocaml for compiling from the sources and
getting a faster application.

For this to work, a kind of archive of various versions of ocamlrun
should exist somewhere on the web, allowing to choose the right
architecture/OS, also the right ocaml version, the right libraries
like libc 5 or 6 or glibc.

I think there is a significant number of applications that could be
interested in being distributed like this, like the ones that are on
the ``hump'': HeVeA, GeneWeb, Bibtex2html, and many others.

Nevertheless, there is a problem for applications that use other
libraries like unix, str, nums, threads, that need to be compiled in
-custom mode. If I understand well, binaries compiled with -custom
contain the native code of the interpreter itself, so are not portable
anymore. Techically speaking, is it possible to build an ocamlrun
interpreter that contains those libraries statically linked?

So to conclude, I would like to know two things:

1) Can a bytecode file be run using any ocamlrun version, on any
   combination of architecture and OS? Even a non-unix OS?

2) Is it possible to build an ocamlrun interpreter containing also
   some librairies usually linked with -custom: unix, str, nums,
   threads ; hence being able to run portable bytecode files using
   such libraries ? 

If this is technically feasible, I would like to know people who are
interested in using this for distribution of their own application in
bytecode form. Moreover, for building this archive of ocamlrun
binaries, many people are needed to cover a wide range of
architecture/OS combinations. I have access myself to PCs under Linux
(Redhat distribution) and SPARC/Solaris 2.7, that's all.

Any comments, remarks and suggestions will be welcome. My goal is be
able to distribute as widely as possible an application written in
Ocaml, avoiding remarks like ``I'm interested in this application but
I cannot compile Ocaml sources, and you do not offer a suitable binary
for my configuration », and I would be glad to hear any suggestion for
achieving this goal.

- Claude



-- 
| Claude Marché           | mailto:Claude.Marche@lri.fr |
| LRI - Bât. 490          | http://www.lri.fr/~marche/  |
| Université de Paris-Sud | phoneto: +33 1 69 15 64 85  |
| F-91405 ORSAY Cedex     | faxto: +33 1 69 15 65 86    |



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2000-02-28 23:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-25 12:29 Portability of applications written in OCAML: C stuff Juergen Pfitzenmaier
2000-02-25 16:51 ` skaller
  -- strict thread matches above, loose matches on Subject: below --
2000-02-26 18:47 Juergen Pfitzenmaier
2000-02-25 14:05 Juergen Pfitzenmaier
2000-02-15 13:01 Portability of applications written in OCAML Claude Marche
2000-02-16 22:49 ` Gerd Stolpmann
2000-02-18  9:36   ` Xavier Leroy
2000-02-22  8:13     ` Sven LUTHER
2000-02-22  9:21       ` Xavier Leroy
2000-02-22 23:43         ` Portability of applications written in OCAML: C stuff Max Skaller
2000-02-23 18:31           ` Markus Mottl
2000-02-24  2:55             ` Max Skaller
2000-02-24 14:44               ` Sven LUTHER
2000-02-24 15:04               ` Alan Schmitt
2000-02-24 23:51                 ` Max Skaller
2000-02-25  8:37                   ` Alan Schmitt
2000-02-25 16:58                     ` skaller
2000-02-24 20:17               ` Gerd Stolpmann
2000-02-25  0:35                 ` Max Skaller
2000-02-25 13:21                   ` STARYNKEVITCH Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).