systems changed the topic of #ocaml to: Archive of Caml Weekly News http://pauillac.inria.fr/~aschmitt/cwn/ | ICFP Programming Contest 2003 http://www.dtek.chalmers.se/groups/icfpcontest/ | A tutorial http://merjis.com/richj/computers/ocaml/tutorial/ | Good free book http://cristal.inria.fr/~remy/cours/appsem/ | Mailing list (best mailing list ever for any computer language) http://caml.inria.fr/bin/wilma/caml-list
<Smerdyakov> I'm trying to, in the repl, #load a library that relies on some external C functions. What's the easiest way to do this without recompiling the repl executable?
<Smerdyakov> (Recompiling to include the .o file with those functions, I mean.)
brwill_zzz is now known as brwill
brwill is now known as brwill_out
<Smerdyakov> Does anyone know how to make all functions defined in a C .o file accessible as external functions from the ocaml toplevel repl?
<teratorn> i don't think you want to use the .o files
<teratorn> probably the final .so
<Smerdyakov> I only have .o files.
<Smerdyakov> One .o file with 8 or so functions, needed by a teeny bit of a library I want to play with.
<teratorn> why?
<teratorn> you ought to be able to compile your source file with gcc -shared
<teratorn> and output that to an .so file
<Smerdyakov> OK, so what do I do if I have a .so?
<teratorn> but i don't know crap about the ocaml-C interface :(
<Smerdyakov> Soooo.... you have suggested .so's without having any reason to think I can deal with them more easily for this?
<mattam> ocamlmktop ?
<Smerdyakov> mattam, I've run it with the .o file as an argument, along with -custom, and that doesn't seem to do it.
<mattam> -dlllib maybe
<mattam> with the so, it should work
<Smerdyakov> Yikes! Error on dynamically loaded library: ./dllfloat.so: ELF file's phentsize not the expected size
<mattam> what's a phentsize ?
<Smerdyakov> I don't know. :-(
jewel has joined #ocaml
<Smerdyakov> What is the proper command line to create a .so file from a .c file with gcc?
<mattam> ld -shared -o object.so object.o
<Smerdyakov> Oh. Tricky!
<mattam> uh, a c file: gcc -shared -o object.so object.c, but i guess you guessed :)
<Smerdyakov> Well, I've built the toplevel, but it says it can't find the .so file, which is in the current directory and /usr/local/lib. :-(
<mattam> with -dllpath . it could get even better
<Smerdyakov> Ah. Now it loads. We'll see if the functions are available. :)
<Smerdyakov> It does!
* Smerdyakov kisses mattam.
<Xcalibor> Smerdyakov: have you compiled the files with -fPIC? you have to tell the compiler to generate Position Independent Code in order to build a -shared library with gcc...
<mattam> thanks Smerdyakov :)
<Smerdyakov> Xcalibor, I don't care. :P
<Xcalibor> Smerdyakov: they probably were compiled with -fPIC or -fpic... try to make a file foo.o and also make a file yourlib.so and see what it says
<Xcalibor> :)
<Smerdyakov> NO! I want crashes!
jewel has quit ["bedtime"]
vect is now known as gl
gl is now known as vect
<Xcalibor> you want crashes?
__DL__ has quit [Remote closed the connection]
polin8 has joined #ocaml
Kinners has joined #ocaml
polin8_ has joined #ocaml
polin8 has quit [Read error: 104 (Connection reset by peer)]
polin8_ is now known as polin8
polin8 has quit [Client Quit]
polin8 has joined #ocaml
polin8 has quit [Read error: 54 (Connection reset by peer)]
polin8 has joined #ocaml
* Xcalibor leaves to bed... laters ad thanks!
Xcalibor has quit ["Terminando cliente"]
jdrake has joined #ocaml
<jdrake> MOOF!
brwill_out is now known as brwill_zzz
jdrake has quit ["Oops. This machine just fell asleep"]
Kinners has left #ocaml []
klamath has quit []
jdmarshall has joined #ocaml
bk_ has joined #ocaml
whee has quit ["Leaving"]
srv has joined #ocaml
Nate1975 has joined #ocaml
__DL__ has joined #ocaml
Nate1975 has quit ["using sirc version 2.211+KSIRC/1.2.4"]
Nate1975 has joined #ocaml
bk_ has quit ["I'll be back"]
mellum has quit [Read error: 110 (Connection timed out)]
foxster has joined #ocaml
srv has quit ["Bye"]
<phubuh> how can i find out where an exception was thrown?
<mrvn> phubuh: catch it
<phubuh> yeah, i could put catches everywhere it could be thrown, but isn't there a more scalable way? :/
<mrvn> 9:23:respawn:/usr/sbin/pppd nodetach call dsl-provider >>/var/log/dsl 2>&1
<mrvn> ups
<mrvn> phubuh: I haven't found one yet.
<phubuh> :(
<mrvn> Wh the problem with catching all exceptions?
<mrvn> s/wh/what is
<__DL__> phubuh: if it go all the way up, it can be printed by the interpreter.
<phubuh> __DL__, it is printed by the interpreter, but only what exception it is, not where it was thrown
<__DL__> there is an option to set.
<phubuh> ooh!
<mrvn> __DL__: by the way, how do I get __FILE__ and __LINE__ in ocaml?
<phubuh> ah, -b
<phubuh> that's gerat
<__DL__> you use camlp4.
<phubuh> great*
<phubuh> haha, it gives the offsets in characters, not lines+characters
<phubuh> how incredibly annoying
<phubuh> ah, emacs saves the day
<__DL__> there is a tool somewhere that do the conversion
<__DL__> and emacs can also do it of course
srv has joined #ocaml
mrvn_ has joined #ocaml
<phubuh> Fatal error: exception Match_failure("directConnect.ml", 204, 236) -- what do those numbers mean?
<__DL__> I don't remeber well (make a lot time that I didn't have such a pb) but it must be first and last char of the raise close
<phubuh> oh, okay, that makes sense
<__DL__> (it look like a "location" that you could fine in camlp4 and ocamlc source code)
<phubuh> i haven't read much ocamlc source code, unfortunately
srv has quit ["leaving"]
srv has joined #ocaml
foxster has quit [Client Quit]
mrvn has quit [Read error: 110 (Connection timed out)]
mrvn has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
__DL__ has quit [Remote closed the connection]
Hipo has quit [Read error: 104 (Connection reset by peer)]
Hipo has joined #ocaml
Nate75Sanders has joined #ocaml
Riastrad1 has joined #ocaml
karryall has joined #ocaml
Riastradh has quit [Connection timed out]
Xcalibor has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
whee has joined #ocaml
Riastrad1 is now known as Riastradh
<Smerdyakov> How can I have the toplevel print what bindings are introduced when I #load a file?
phubuh has quit [Remote closed the connection]
bk_ has joined #ocaml
polin8 has quit [Read error: 110 (Connection timed out)]
<Xcalibor> Smerdyakov: no idea, sorry
<jdmarshall> Besides the tutorials listed in the channel info, is there a FAQ somewhere for O'caml newbies?
<Smerdyakov> There are FAQ's linked from http://www.ocaml.org/
<Smerdyakov> Look in the Documentation section at the right of the page.
<Smerdyakov> Oh, actually, it has its own section. :)
Demitar has joined #ocaml
<jdmarshall> Ah. Right. Are those suitable for when I break something and I'm trying to figure out what I did wrong? I guess what I'm really looking for is a troubleshooting guide, now that I think about it.
Demitar has quit ["Bubbles everywhere!"]
bk_ has quit ["I'll be back"]
<Xcalibor> troubleshooting should use compiler errors
foxster has joined #ocaml
brwill_zzz is now known as brwill
brwill is now known as brwill_zzz
bk_ has joined #ocaml
buggs|afk is now known as buggs
buggs|afk has joined #ocaml
buggs has quit [Nick collision from services.]
buggs|afk is now known as buggs
bk_ has quit ["I'll be back"]