[Date Prev][Date Next] [Chronological] [Thread] [Top]

Some problems with JoCaml on MacOsX



Hi everybody.

I tried to install JoCaml v1.07Bêta on my PowerBook G4 Titanium.
I use MacOs X v10.2.3 with ggc v3.1

First of all, the configure file was too old to know what was my 
system... It was enabled to recognize the host type.

So, I copied the config.sub and config.guess from OCaml v3.06 (which 
functions perfectly) in the config/auto-aux repertory of JoCaml.
Fine. It seems to be a good solution : the ./configure procedure works 
good. It simply says that the native-code compiler is not supported. 
Probably because MacOsX is unknown from JoCaml.

The second problem was harder to solve, and I don't know if I made the 
good thinks...
I had this message when trying a make world :

[...]
gcc -g -I../../camlrun -I ../threads -O -fno-defer-pop -Wall   -c -o 
multicast_c.o multicast_c.c
multicast_c.c: In function `setsock_multicast':
multicast_c.c:31: warning: implicit declaration of function `setsockopt'
multicast_c.c:31: `IPPROTO_IP' undeclared (first use in this function)
multicast_c.c:31: (Each undeclared identifier is reported only once
multicast_c.c:31: for each function it appears in.)
multicast_c.c:31: `IP_MULTICAST_TTL' undeclared (first use in this 
function)
multicast_c.c: In function `setsock_join':
multicast_c.c:38: storage size of `mreq' isn't known
multicast_c.c:42: `INADDR_ANY' undeclared (first use in this function)
multicast_c.c:44: `IPPROTO_IP' undeclared (first use in this function)
multicast_c.c:44: `IP_ADD_MEMBERSHIP' undeclared (first use in this 
function)
multicast_c.c:38: warning: unused variable `mreq'
multicast_c.c: In function `setsock_leave':
multicast_c.c:51: storage size of `mreq' isn't known
multicast_c.c:55: `INADDR_ANY' undeclared (first use in this function)
multicast_c.c:57: `IPPROTO_IP' undeclared (first use in this function)
multicast_c.c:57: `IP_DROP_MEMBERSHIP' undeclared (first use in this 
function)
multicast_c.c:51: warning: unused variable `mreq'
make[1]: *** [multicast_c.o] Error 1
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o open.o open.c
open.c: In function `gr_open_graph':
open.c:175: warning: implicit declaration of function `getpid'
open.c: In function `gr_update_display':
open.c:414: warning: assignment from incompatible pointer type
open.c: In function `rl_inserer':
open.c:438: warning: assignment from incompatible pointer type
open.c: In function `rl_liberer':
open.c:450: warning: assignment from incompatible pointer type
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o draw.o draw.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o fill.o fill.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o color.o color.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o text.o text.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o image.o image.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o make_img.o make_img.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o dump_img.o dump_img.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o point_col.o point_col.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o sound.o sound.c
gcc -I../../camlrun -g -I/usr/X11R6/include -O -fno-defer-pop -Wall   
-c -o events.o events.c
rm -f libgraphics.a
ar rc libgraphics.a open.o draw.o fill.o color.o text.o image.o 
make_img.o dump_img.o point_col.o sound.o events.o
ranlib libgraphics.a
../../boot/jocamlrun ../../jocamlc -I ../../stdlib -c graphics.mli
../../boot/jocamlrun ../../jocamlc -I ../../stdlib -c graphics.ml
../../boot/jocamlrun ../../jocamlc -I ../../stdlib -cca "-lgraphics 
-L/usr/X11R6/lib -lX11" -o graphics.cma graphics.cmo
make[1]: *** No rule to make target `../join/jocrun', needed by 
`jogrun'.  Stop.
make: *** [otherlibraries] Error 2

(I attach the complete log file.)

As you can see, there is a problem of compilation with the file 
otherlibs/join/multicast_c.c and this problem makes a fatal error 
during the execution of the Makefile of otherlibs/graph
(I'm sure of this point)
To solve the problem, I included in the file multicast_c.c the lines :

#include <sys/socket.h>
#include <netinet/in.h>

to define the function setsockopt and the constants IPPROTO_IP and so 
on.

It solved the problem with the make world. I succeded in installing 
jocaml and jocamlc.

My questions are the following :
1) Did I do good job, or is it a bad solution to change the 
multicast_c.c file ?

2) Now, I can't use the jocaml top level to do some specific things of 
JoCaml.
For example : let a = 2 in a + 3 ;;
works good.
But let def f! x = print_int x ; ;;
raises the error :

slot_for_getglobal
Reference to undefined global `Join'

I know some people who have installed jocaml under Linux on a PC 
without changing the configure.sub, configure.guess, and multicast_c.c 
files and who have the same problem...
So : what to do to solve this point ?

Thank you.
Sylvain Chevillard