<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?
<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
<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>
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>
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]