gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
<tautologico> is there any documentation about what camlp4 extensions are active by default when using batteries?
_unK has joined #ocaml
rfg has quit [Quit: rfg]
<tautologico> also, how do I run a toplevel with batteries, after installing through godi?
rfg has joined #ocaml
rfg has quit [Quit: rfg]
sepp2k has quit [Quit: Leaving.]
seafood has joined #ocaml
seafood has quit [Quit: seafood]
psnively has quit [Quit: psnively]
tautologico has quit [Quit: Leaving]
|marius| has quit [Ping timeout: 265 seconds]
_unK has quit [Remote host closed the connection]
Ali_ has joined #ocaml
Ali_ has quit [Remote host closed the connection]
Associat0r has quit [Quit: Associat0r]
jakedouglas has quit [Quit: Leaving.]
tmaedaZ is now known as tmaeda
jakedouglas has joined #ocaml
ygrek has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
oc13 has joined #ocaml
Amorphous has quit [Ping timeout: 240 seconds]
easy4 has quit [Quit: easy4]
Amorphous has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
ygrek_ has joined #ocaml
easy4 has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
mjonsson has quit [Remote host closed the connection]
avsm has joined #ocaml
* ygrek_ hates gildor for choosing darcs for oasis, it can't just clone the repo hanging with 100% cpu, unbelievable
<julm> krkrkr
<ygrek_> darcs from testing manages with this hard task, dog slow and complains about some "harmless" CRC errors
<flux> erickt, can't you put the variants into one .ml, and include/open where you need elsewhere?
<flux> hmh, apparently including a .mliless module doesn't work in the signature
<flux> maybe it works with 3.12
<flux> include module type of Foo or something
<julm> I remember Piotr Wieczorek had to write a patch to import a signature from .cmi
<julm> it has not made its way upstream AFAIK
<adrien> actually, I use wget to clone darcs repositories :P (I should use lftp, which has nothing to do with ftp despite its name)
<julm> wget <3
<flux> yeah, lftp is great
Smerdyakov has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
Smerdyakov has quit [Quit: Leaving]
avsm has quit [Quit: Leaving.]
iago has quit [Quit: Leaving]
Yoric has joined #ocaml
ikaros has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
pikachuyann has joined #ocaml
Associat0r has joined #ocaml
Anarchos has joined #ocaml
oriba has joined #ocaml
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 240 seconds]
oriba_ has left #ocaml []
oriba has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<oriba> hi, I want to marry OCaml and some C stuff... I want to use Markus Mottl's Ocaml-Makefile, and need to add other compiler and linker flags, needed from the C-stuff I want so use together with OCaml
<oriba> where do I best add those flags?
rfg has joined #ocaml
<adrien> oriba: first time you use OCamlMakefile?
<oriba> not first time, but close to it ;) long ago I tried it... and forgot all that
<oriba> had C and Python during the last many of months
<oriba> it might be easy?
<oriba> adrien,
<adrien> ok, the typical use is: create a file named "Makefile", next line should read "include OCamlMakefile" (with this file in the current folder), and before that line, define 'LDFLAGS := $(shell pkg-config --libs fooooooo)'
<oriba> aha ok
<adrien> 'CFLAGS' works too
<oriba> so... first line I do the CFLAGS and ÖDFLAGS and afterwards include OcamlMakefile?
<adrien> see http://pastebin.com/Nf0Q6i55 for an example
<adrien> (yeah, quite a lot of files)
<oriba> hehe
<oriba> thx
<oriba> I will try it
_unK has joined #ocaml
<adrien> =)
avsm has joined #ocaml
<oriba> adrien, ok that works... how do I add C-sources now?
<adrien> oriba: you list them in SOURCES
<adrien> SOURCES must be sorted for .ml files (not for .c files)
ygrek_ has joined #ocaml
Yoric has quit [Quit: Yoric]
Anarchos has joined #ocaml
<oriba> adrien, I just mention all the *.c and *.ml in the OCamlMakefile? and both filetypes in SOURCES?
<oriba> not separated?
<adrien> yeah, everything in SOURCES
<oriba> ok
<oriba> cool
<oriba> hmhh strange... why does the compiler does not mourn about my "main()" in the c-file?
<oriba> I thought OCaml has it's own main?
<oriba> clear
<oriba> ?
<oriba> (forget the last lines... clear should go to the shell ;))#
ygrek_ has quit [Remote host closed the connection]
<oriba> adrien, when I use "ocaml" and #load the *.cma, I got a message, that the necessary libs are not available
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
<oriba> do I have to make then avaibalbe seperately (maybe using ocamlmktop?)?
<adrien> oriba: you have a main function in the c file? you shouldn't unless you want to call ocaml from C
<adrien> (and not the other way round)
<oriba> I will remove that
<oriba> now already did
<adrien> it won't hurt: it won't be used
<oriba> but shouldn't the compiler complain it?
<oriba> aha
<adrien> missing .so file?
<oriba> ok
<oriba> no
<oriba> there are a lot more files created than I expected
ygrek_ has joined #ocaml
<oriba> the *.so is loaded, but symbols missing there
<adrien> which symbols?
<oriba> from the lib that I want to use (I mean the C-code that is not writtenm by me)
<oriba> but AFAIK all CFLAGS and LDFLAGS I used as I have to
<adrien> when do you use -lyourclib?
<adrien> at which stage?
<oriba> I just set LDFLAGS and CFLAGS in my Makefile
<oriba> don't know, what OCamlMakefile will do with it
<oriba> I thought OCamlMakefile will ahandle all things automagically
<oriba> I used #load "mylib.cma" from toplevel
<adrien> I use '-cclib -lfoo' when using ocamlopt
<oriba> and it complained,m that in the *.so are symbols missing
<adrien> I think that .cma files will encode that information so that you don't have to provide it but not cmxa
<adrien> I can't remember well
<oriba> hmhh
<adrien> I think you need a .so file for toplevel-support, do you have it,
<adrien> and lablgtk2 handles it so you might want to take a look at how it's done (it creates its own toplevel, so that's one way, but that's not a requirementà
<adrien> )
ikaros has joined #ocaml
_unK has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
avsm has quit [Quit: Leaving.]
pikachuyann has quit [Quit: Quitte]
chee has joined #ocaml
sepp2k has joined #ocaml
iago has joined #ocaml
pikachuyann has joined #ocaml
mjonsson has joined #ocaml
<oriba> I want with OCamlMakefile do thw following: in one dir, I compile a library, in another I compile a tool, that uses that library... do I have to explicitly use "-I" and includse that stuff? When I use "LIBS", the tools-Makefile wants to also compile the library.... but that would be done by a different Makefile... hos can OCamlMakefile be used for this?
<oriba> hmhh INCDIRS seem to be enough :)
<oriba> ...for finding
<oriba> hmhh LDFLAGS...?!
<oriba> yeah
pikachuyann has quit [Quit: Quitte]
<Anarchos> where is the documentation in the ocaml tree ?
<thelema> Anarchos: it's in the .mli files - it gets built automatically
<flux> that's the reference guide, not all documentation..
jakedouglas has joined #ocaml
<thelema> yes, just the stdlib reference docs.
<thelema> other than that, what docs are there in the ocaml source tree?
chee has quit [Ping timeout: 265 seconds]
<flux> my file:///usr/share/doc/ocaml/docs/ocaml.html/index.html must come from ocaml distribution, no?
<thelema> in fact, I think it doesn't
<thelema> I can't find any such in the source tree
<flux> when I say apt-get source ocaml-doc, it starts retrieving some ocaml-doc*.tar
<thelema> yup, the reference manual is separate
<flux> but one'd expect that the html files aren't the working format..
tautologico has joined #ocaml
<oriba> how to fix that: undefined reference to `CAMLreturn' ?
<flux> compiling with your own C-code?
<flux> it looks like like a missing #include (CAMLreturn is a macro)
<oriba> I compiled a library, and this error did not occur
<oriba> I used that library... and get that error
<oriba> *.c *.ml => *.cma and so on
<oriba> using *.cma and I got that error
<oriba> ...ah the same problem as I had before...
avsm has joined #ocaml
<oriba> when using the library from the toplevel, it mourns that there is some real CLIB missing
<oriba> ah.... hmhhh.. do I have to include "." as DIR, if it is an *.so?
<oriba> flux, please look, I have pastebin'd http://pastebin.com/cehMTbP4
<oriba> any idea on that?
<oriba> strings shows me, that the needed stuff is inside the *.so
Edward_ has joined #ocaml
<flux> have you tried 'make install'ing it?
<flux> or, actually, make findlib_install
<flux> oops, I mean: make libinstall
<flux> (of course it requires root priviledges or a custom ocamlfind installation, which you may not have)
<adrien> and a META file :p
<flux> indeed, just browsing again and the package doesn't have it
<flux> my ocamlmklib-lines in Makefile have used -linkal -l(library names)
<flux> maybe you need some different kind of use of OCamlMakefile to properly build it
<oriba> hmhh
<oriba> I don't want to install it
<oriba> want to use it locally
<oriba> -linkal -l(library names) ?
<oriba> do you have an example?
<adrien> linkall*
<MarcWeber> http://caml.inria.fr/pub/docs/manual-camlp4/manual003.html Is this all documentation which exists about the streams & parsers extension?
<oriba> adrien, is this an option?
<adrien> yeah, but I don't think it'll solve your problem: it won't pull the imagemagick functions
<MarcWeber> adrien: You should update vim-addon-ocaml. Today a I fixed a (String. completion bug
<adrien> MarcWeber: ok, thanks for the work =)
<MarcWeber> I did it for myself only :)
<MarcWeber> It happens to be useful to others as well..
<MarcWeber> Are substreams always flattened?
mjonsson has quit [Read error: Connection reset by peer]
<adrien> oriba: in your Makefile, use "CLIBS := freetype tiff ...", might fix it
<adrien> oriba: yeah, that's the issue: you need to put the list of libs in CLIBS, not in LDFLAGS
<adrien> otherwise they're not passed to ocamlmklib
<Anarchos> Is it safe to use CAMLlocal(); and after that caml_c_thread_register() in the same function ?
<adrien> I've tried with: CLIBS := $(shell pkg-config --libs-only-l webkit-1.0 | sed -e 's/-l//g') , but this isn't perfect (ocamlmakefile takes 'freetype', not '-lfreetype', which is probably not a good thing)
roconnor_ has joined #ocaml
roconnor has quit [Ping timeout: 276 seconds]
iago has quit [Ping timeout: 255 seconds]
mjonsson has joined #ocaml
iago has joined #ocaml
<oriba> adrien, I tried around, what you said... but I could not get it running
<adrien> are you sure it rebuilt? and can I see the build log?
<oriba> I used make clean before
sepp2k1 has joined #ocaml
<oriba> adrien, this is, how I got the ImageMagick flags / how one should use it for C: # cc `MagickCore-config --cflags --cppflags` -O2 core.c `MagickCore-config --ldflags --libs`
<oriba> and that is, what I get: http://pastebin.com/xuF8GMBA
sepp2k has quit [Ping timeout: 272 seconds]
<adrien> and 'ocaml imagemagick_interface.cma' still gives you the undefined ref error?
<oriba> yes
<adrien> same one as before?
<oriba> yes
<oriba> do I have to load that explicitly?
<oriba> I mean: do I have to load some ImageMagick stuff before the cma-stuff?
<adrien> load what explicitely?
<adrien> the cma should be enough
<adrien> can you send me your code?
<oriba> like one also needs to load unix befores some other things that use it
<oriba> is there no file-upload in pastebin?
<oriba> need to copy it?
<adrien> I meant: the whole source archive (so I can try to compile it here)
<oriba> hmhh moment
<oriba> do you have sendfile installed? or where uploading it?
BiDOrD has joined #ocaml
<adrien> sendfile? probably not
<oriba> aha
<adrien> and nothing for upload, I can't remember what I was using before: been using pro/semipro hosting for some time now
<oriba> sendfile woulöd be the best IMHO
<oriba> would be
<oriba> most convenient
<oriba> ...for people who like the shell...
<adrien> I also directly host things on my computer (git or sanada), sanada is a very small webserver in perl that can server *one* file
<oriba> aha
<oriba> I could start apahce .... but it would need some work... sanada I didn't knew of
<oriba> and with git I only pulled so far
<adrien> git instaweb setups a gitweb for which you can give a link
<oriba> aha
<oriba> nice
<oriba> but let's just use the rapidshare link from aboce
<oriba> it's easier for now
oc13 has quit [Ping timeout: 252 seconds]
<oriba> adrien, you have the file?
<adrien> damn, my nm-fu has suffered severely
<oriba> nm-fu?
<adrien> oriba: that symbol is in libMagickWand, not libMagickCore
<adrien> see: nm -D /usr/lib64/libMagickWand.so |grep DrawPath
<adrien> and: nm -D /usr/lib64/libMagickCore.so |grep DrawPath (well, lib64 for me)
<adrien> it's T in the first one, U in the second one (see 'man nm')
<oriba> what?
<oriba> MagickWand is a different library
<oriba> I use magickCore
<adrien> does 'nm -D' on MagickCore return DrawPathStart with 'U'?
<oriba> does not give a result, but Drawpath I don't use
<oriba> oliver@siouxsie:~/Programmierung/pictureshell/imagick_ocaml$ nm -D /usr/lib64/libMagickCore.so |grep MagickCoreTerminus
<oriba> 00000000000ea4e0 T MagickCoreTerminus
<adrien> but maybe the MagickCore itself uses it
<adrien> here, it's defined in Wand and used in Core
<adrien> also, you need to CAMLlocal in each function which deals with the "value" type
<oriba> the problem is not Imagemagick... it is OCaml: CAMLreturn is not found
<adrien> err, I mean, CAMLparam
<oriba> CAMLparam I use
<adrien> that's because you're missing an include
<oriba> where?
<oriba> I don't understand
<adrien> you need to #include <caml/memory.h>
<oriba> oh, really?
<oriba> hmhh
<adrien> ya, rly
<oriba> now I get... undefined "caml__frame"
<adrien> and you need a call to 'CAMLparam1(v);' your function
<adrien> that ^^
<oriba> aha
<oriba> hmhh
<oriba> ok, Iit now again compiles.... I can also load it... just got a SEGFUAULT ;)
<oriba> but that might be my task now?
roconnor_ has left #ocaml []
<adrien> Signal -10, nice =)
roconnor has joined #ocaml
<adrien> happy debugging :P
<oriba> because argv and argc
<oriba> argv
<oriba> a CAMLreturn more early solves the problem
<oriba> thank you adrien!
<adrien> yeah, accessing argv[0] when argv is NULL isn't a very good idea :P
<oriba> you were of great help!
<oriba> :)
<adrien> :-)
<oriba> yes
<oriba> hehe
<Anarchos> when must i call caml_register_c_thread ?
<oriba> good that it is NULL... then it crashes with certainty
pikachuyann has joined #ocaml
sepp2k1 has quit [Quit: Leaving.]
<oriba> adrien, do you know, how I can pass argv[] from Ocaml to that C snippet?
<oriba> ...hmhh or I may fake that argv stuff hmhh
<adrien> wel, you can call 'dummy Sys.argv' instead of 'dummy ()'
<oriba> aha cool... and value v would also handle an array?
<oriba> yes
<oriba> IU have that here
<oriba> I
<oriba> I just wanted to have some rudimental code to start with
<adrien> yeah, a value can be anything coming from ocaml
<oriba> it's a while ago with that stuff...
<oriba> ok cool
<adrien> yeah, and it's really easy to make mistakes
<oriba> will need some time to rmember it or just read that wrapping stuff again
<oriba> why didn't the compiler complained earlier?
<oriba> maybe in C-land thats the typical problem.... not like with OCaml-only code
<oriba> where you get the messages that something is not bound
<oriba> but now I can go on :)
<adrien> the typing between C and OCaml is very very very very very very weak
<oriba> hehe
<oriba> when I now want to start the library makefile action...
<oriba> ...how to do that?
<oriba> or.... I mean.... how to make it dependend on that compilation?
<oriba> can OCamlMakefile handle that also easy?
<oriba> as a dependency?
<adrien> "library makefile action"?
<oriba> ok... slow
<oriba> ;)
<oriba> I have now the compilöation for that library
<oriba> that lib I want to use in a program
avsm has quit [Quit: Leaving.]
<oriba> but I want seperate directories
<oriba> and when the lib changes, the program must recompile (re-link)
<oriba> so... the library must be in the dependecies of the program
<oriba> can OCamlMakefile handle that easily?
<adrien> yeah
<oriba> aha
<oriba> can you explain me that?
<adrien> what I'm currently using is simply "make install" (but it's my own rule because ocamlmakefile's wasn't working for me): it runs 'ocamlfind install name-of-your-package-or-lib META list-of-files-to-install'
<adrien> you have to write the META yourself but it's easy: you can find a few examples quite easily (you probably have several META files installer on your system)
<oriba> you install the lib and then it will be detedted, if it changes?
<oriba> hmhh
uberlazy has joined #ocaml
<oriba> so...ocamlmakefile works NOT as I wish..?!
uberlazy has quit [Client Quit]
<adrien> I don't think it detects when something change: you'll have to rebuild explicitely
<flux> unfortunately I don't think any ocaml build system detects that
<flux> it'd be nice sometimes, when you have a project that installs many ocamlfind modules etc.. of course, you -could- build one with make, I suppose ocamlbuild would be flexible enough as well
<oriba> hmhh
<oriba> that means makefile hacking... oh oh ;)
<oriba> I may try it...
<flux> I have a feeling that to make it work perfectly, each installed library would need to provide its dependency map as well.. (for the intrefaces)
<flux> well, you could dig it out somehow from the cmi files
<adrien> well, the META should give it
<oriba> oh oh the OcamlMakefile is a long one...
<oriba> hmhh
<oriba> ok
<oriba> thx again
<adrien> flux: ocamlbuild could write the library version in _build/digests probably
<flux> adrien, but if you simply have a new version of a library, it doesn't mean you need to recompile everything
<flux> adrien, it's the library cmi-files that matter
<oriba> adrien, hahah I just touch a src-file in the dir of the program, when I "make" the lib... quick and dirty ;)
<adrien> flux: I meant that as a first step ;-)
<adrien> yeah, works well
iago has quit [Quit: Leaving]
<Anarchos> Is it safe to do in a C function "caml_c_thread_register(); CAMLparam0();"
* adrien never used threading in ocaml+c
* Anarchos should not use ocaml with C++...
<adrien> should only be a matter of wrapping inside 'extern "C"' hopefully
<flux> IMO c++ would have the potential to provide much neater and safer bindings to ocaml than C
<flux> I wonder, for example, if the connecting of stack to GC could be made with a scoped object
<Anarchos> adrien yes but not for my threads :/
chee has joined #ocaml
<flux> and all ocaml primitive types could be nicely as 'primitive types' in c++ as well
<Anarchos> nobody has an idea for my thread registering ?
<adrien> you should ask on the caml-list, seems like not many people have experience on that topic
<tautologico> so, who's using batteries?
<Anarchos> adrien it seems to work to call register_thread() before CAMLparam(), but is not very C standard...
boscop has joined #ocaml
boscop_ has quit [Ping timeout: 258 seconds]
chee has quit [Ping timeout: 265 seconds]
_unK has joined #ocaml
sepp2k has joined #ocaml
<oriba> good night
<oriba> good night adrien
oriba has quit [Quit: Verlassend]
<sepp2k> How is structural typing implemented in ocaml? In particular how does method dispatch work?
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ygrek_ has quit [Ping timeout: 245 seconds]
tautologico has quit [Quit: Leaving]
sepp2k has quit [Ping timeout: 265 seconds]
jakedouglas has quit [Quit: Leaving.]
ikaros has quit [Quit: Leave the magic to Houdini]
slunk has quit [Remote host closed the connection]
sepp2k has joined #ocaml
|marius| has joined #ocaml