hi
after sneaking around the skydeck blog and its source projects for too
long, I finally decided to do it. Installing the ocamljs orpc combo.
Several hours and a stiff neck later I come to the conclusion that the
installation process is a bit harder than expected.
So here are a few notes. Maybe they are helpfull for another ubuntu
user. Maybe you see stupid thing on my behalf and help me to correct
it.
All in all I have to say that working (not coding) with ocaml
libraries feels like walking on broken glas.
Ok a quick recapitulation of the biggest stumble blocks so far:
my host:
>$ cat /etc/lsb-release
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"
== OCAMLJS
Ocaml version
------------------
1. the most recent ocaml rel 3.11.1 is not working.
2. the next compatible version is 3.11.0 which in turn can not be
installed by godi. (I've tried it with './bootstrap -prefix $HOME/godi
-section 3.11.0' )
3. ocamljs / ocaml / godi
-----------------------------
I was not happy the idea to wipe godi of my system so I tried to
install it parallel and separate godi and the base system (ocaml). It
didn't work because of later problems with ocamlbuild and it seemed
complicated to really to it right, so I removed everything ocaml
related including godi and started from scratch.
4. Installation of Ocaml 3.11.0 from scratch
-----------------------------------------------------
the clean new installation of 3.11.0, I'm used to do it with
./configure
make world
make opt
sudo make install
wasn't enough if you want install ulex later. The problem have
something to do with ocamlbuild, because there were errors about
missing ocamlbuild.cmx. Also messages like:
:make inconsistent assumptions over implementation Ocamlbuild_pack:
Simply running make in the 'ocamlbuild' directory of ocaml-3.11.0 and
manualy copying the file didn't solve the problem. After after a lot
of try and error and running 'make all' and 'make world.opt' it
worked.so you have to install ocaml-3.11.0:
./configure
make all
make world.opt
sudo make install
5. Installation of ulex-1.1
--------------------------------
Again: In order to build ulex from scratch you have to make sure the
file ocamlbuild.cmx is in in your library ( eg: /usr/local/lib/ocaml/
ocamlbuild/ocamlbuild.cmx)
6. Installation of ocamljs
--------------------------------
I couldn't use the latest code from svn because of unsolvable errors
when compiling the examples ('make examples'):
File "
canvas.ml", line 25, characters 22-35:
Error: Unbound value Ocamljs.jsfun
(maybe I'll make a separate post for this error)
Using the release ocamljs-0.2 solved the problem.
7. Installation of ocamlnet (orpc2)
-----------------------------------
Ok, next pain point: orpc needs ocamlnet1, which seems to be obsolete
nowadays. But the much worse problem was that I couldn't build
ocamlnet 2.2.9, 2.2.8, 2.2.7, ... always the same error:
rpclocal.c: In function ‘unix_get_peer_credentials’:
rpclocal.c:40: error: storage size of ‘credentials’ isn’t known
rpclocal.c:42: error: invalid application of ‘sizeof’ to incomplete
type ‘struct ucred’
rpclocal.c:40: warning: unused variable ‘credentials’
rpclocal.c: In function ‘unix_peek_peer_credentials’:
rpclocal.c:91: error: dereferencing pointer to incomplete type
rpclocal.c:135: error: dereferencing pointer to incomplete type
rpclocal.c:136: error: dereferencing pointer to incomplete type
rpclocal.c:91: warning: unused variable ‘buf’
make[1]: *** [rpclocal.o] Error 2
After hours I've spent trying different things out I found one line to
add on top of rpclocal.c, to make it work:
#define _GNU_SOURCE
the next error I get is something I'm not able to solve, so the
journey end with:
error: Unbound type constructor Nethttpd_services.dynamic_service
(maybe I'll make a separate post for this error)
phew