emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
emmanuelux has joined #ocaml
dnolen has joined #ocaml
sepp2k has quit [Quit: Leaving.]
dnolen has quit [Quit: dnolen]
lopex has quit []
dnolen has joined #ocaml
ftrvxmtrx has joined #ocaml
ymasory_ has joined #ocaml
joewilliams_away is now known as joewilliams
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
hyperboreean has quit [Ping timeout: 260 seconds]
lamawithonel has quit [Ping timeout: 240 seconds]
lamawithonel has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
zorun has quit [Ping timeout: 248 seconds]
emmanuelux has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
mlh has joined #ocaml
emmanuelux has quit [Read error: Operation timed out]
zorun has joined #ocaml
joewilliams is now known as joewilliams_away
ski has quit [Ping timeout: 260 seconds]
ski has joined #ocaml
ymasory_ has quit [Read error: Connection reset by peer]
hto_ has joined #ocaml
hto has quit [Ping timeout: 248 seconds]
lamawithonel has quit [Ping timeout: 240 seconds]
dnolen has quit [Quit: dnolen]
lamawithonel has joined #ocaml
dnolen has joined #ocaml
flux has quit [Ping timeout: 276 seconds]
philtor has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
hto_ has quit [Ping timeout: 264 seconds]
flux has joined #ocaml
ankit9|zzz has quit [Ping timeout: 276 seconds]
jamii has quit [Quit: Leaving]
ulfdoz has joined #ocaml
larhat has joined #ocaml
hto has joined #ocaml
ankit9 has joined #ocaml
dnolen has quit [Quit: dnolen]
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
ikaros has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
jderque has joined #ocaml
<larhat>
How does oasis determine $prefix variable? I have ocaml installed at /opt/oc312 and i expect that prefix will be same. as far as i recall, oasis on ubuntu determine $prefix relative to "ocaml" binary and install all binaries, which come with libraries near compiler and ocamlrun, to /opt/oc312/bin . But on BSD systems (Freebsd8 and macosx) with ocaml installed at same path (/opt/oc312), oasis uses $prefix=/usr/local. It's very bad, because I need to change
philtor has joined #ocaml
eye-scuzzy has joined #ocaml
ankit9 has quit [Quit: Leaving]
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
Derander has quit [Ping timeout: 240 seconds]
Derander has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD has quit [Client Quit]
BiDOrD has joined #ocaml
<flux>
I don't know, but my guess would be ocamlfind ocamlc -where
<larhat>
ocamlfind ocamlc -where return correct location, ("/opt/oc312/lib/ocaml") but $prefix anyway is "/usr/local" which makes me unhappy :-)
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
<larhat>
jderque: yes, I know that I can override defaults, i'm wondering, why oasis doesn't use relative path to "ocamlfind ocaml -c where" or smth like that. And I'm not at 100% sure (because I can't check it right now), but it happens only on bsd systems, and on ubuntu oasis computes correct $prefix .
<jderque>
uh I don't know. It looks like the "/usr/local" default value is hardcoded in setup.ml
<flux>
ocamlc -where might not be that great a default anyway
<flux>
for example, if you use system-installed ocamlc
fraggle_ has quit [Ping timeout: 276 seconds]
Rolands has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ankit9 has joined #ocaml
impy has quit [Read error: Connection reset by peer]
chambart has quit [Ping timeout: 246 seconds]
chambart has joined #ocaml
fraggle_ has joined #ocaml
Rolands has quit [Ping timeout: 240 seconds]
philtor has quit [Ping timeout: 260 seconds]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
eikke has joined #ocaml
astory has left #ocaml []
hyperboreean has joined #ocaml
BiDOrD_ has quit [Ping timeout: 260 seconds]
BiDOrD has joined #ocaml
jderque has quit [Quit: leaving]
BiDOrD has quit [Client Quit]
BiDOrD has joined #ocaml
ftrvxmtrx has joined #ocaml
BiDOrD has quit [Ping timeout: 260 seconds]
Rolands has joined #ocaml
BiDOrD has joined #ocaml
ankit9 has quit [Quit: Leaving]
ftrvxmtrx has quit [Quit: Leaving]
<gildor>
larhat: oasis use the same default as autoconf (GNU style)
<gildor>
larhat: for prefix and the rest
pdhborges has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
pdhborges has left #ocaml []
BiDOrD has joined #ocaml
BiDOrD has quit [Client Quit]
BiDOrD has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
sku has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
Lor has joined #ocaml
sku has quit [Ping timeout: 246 seconds]
ankit9 has joined #ocaml
sku has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
sku has quit [Client Quit]
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
lopex has joined #ocaml
jderque has joined #ocaml
edwin has joined #ocaml
Rolands has quit [Ping timeout: 260 seconds]
emmanuelux has joined #ocaml
Rolands has joined #ocaml
BiDOrD has quit [Remote host closed the connection]
vivanov has joined #ocaml
avsm has joined #ocaml
edwin has quit [Remote host closed the connection]
Rolands has quit [Ping timeout: 276 seconds]
oriba has joined #ocaml
Rolands has joined #ocaml
_andre has joined #ocaml
boscop_ has joined #ocaml
edwin has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
emmanuelux has quit [Ping timeout: 260 seconds]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
<Lor>
Are there any tools for creating binary distributions for ocaml-based software?
<Lor>
I.e. just a bundle that you can unpack somewhere and it provides all the binaries and libraries that are needed for running the application, and sets paths so that everything can be found?
<kaustuv>
Depends on the platform. It is much harder on Windows than on a Unix
<gildor>
but it is specific to ocisgen and bytecode application
<Lor>
All right, thanks, I'll have a look at those.
<Lor>
I could of course just try to use oasis to install stuff cleanly into a directory and then make a tarball out of that.
<Lor>
With some path hacks maybe.
<gildor>
Lor: it will work for exec, since ocaml does static compilation
<gildor>
not for library
<Lor>
No, lots of libraries have dll components.
<gildor>
humm, you can do something with a toplevel .sh and copying the output of ldd yourexec into a lib/
<Lor>
But yeah, this is just about distributing a couple of binaries and all their dependencies to a system that doesn't have anything ocaml-related installed.
<gildor>
you have to override the LD_LIBRARY_PATH in the .sh
<Lor>
Yeah, that's standard.
<gildor>
indeed, not really ocaml specific
<Lor>
Actually, I think ocaml has a separate path for looking up the dll components of its libraries.
<gildor>
if you do something with bytecode, you'll have to include ocamlrun as well and do a further analysis of your dep
pdhborges has joined #ocaml
<kaustuv>
I would think that making a static native binary would minimize problems
<kaustuv>
of course if your program uses dynlink or ldopen() then this won't work
<flux>
iirc the name resolving library doesn't like that?
<kaustuv>
http://www.magicermine.com/ seems even better, but maybe this isn't the best suggestion I've ever made
tildedave has quit [Read error: Connection reset by peer]
larhat has quit [Quit: Leaving.]
pdhborges has quit [Quit: Leaving.]
larhat has joined #ocaml
Associat0r has joined #ocaml
<iris1>
Dear experts, I ran into a problem which I hope is minor. I am using ocamlbuild for my program and it works well. However, I'd like to use ocamlprof on my program. Consulting the manual led me to believe that if I do "ocamlbuild myprog.d.native", and run it, a file called ocamlprof.dump would be created in my current directory. However, this has not happened. Is there something special I need to do to cause the ocamlprof.dump file to be
<iris1>
created? I realize that ultimately I need to use ocamlcp to compile, but I would like to be able to do that through ocamlbuild (my project has a number of source code files and my chances of getting it to compile without ocamlbuild are very bad :-( ). Thank you very much!
<adrien>
iris1: for native code, it uses gprof so you get a file names "gmon.out"
<adrien>
and you need to call gprof after that
thelema has quit [Read error: Operation timed out]
thelema_ has joined #ocaml
<iris1>
I am sorry, I just realized I made a typo... I meant to say "ocamlbuild myprog.d.byte"
<iris1>
I am aware of gprof but since I am using OS X I don't think it works. I am specifically trying to get ocamlprof to work for me.
<adrien>
I've never used ocamlprof =/
<adrien>
does myprog.d.byte run much slower than myprog.byte?
<iris1>
FTR, the ocamlbuild incantation for native profiling is "ocamlbuild myprog.p.native", and it does produce gmon.out (which on OS X has no timing data)
<adrien>
ah, ok
<adrien>
and forget what I said before that, I definitely don't know ocamlprof enough to say anything about it
<kaustuv>
ocamlbuild -classic-display foo.d.byte shows that it doesn't call ocamlcp
<kaustuv>
I think .p.native is the only profiling target available
<iris1>
adrien: myprog.d.byte and myprog.byte run in about the same time (to within 1% or so)
<iris1>
kaustuv: do you think there is no way to get ocamlbuild to invoke ocamlcp?
<kaustuv>
From the ocamlbuild user manual, section 3.18:
<kaustuv>
> Please note that the byte-code profiler works in a wholly different way and is not supported by ocamlbuild.
<iris1>
is ocamlcp a drop-in replacement for ocamlc? I could record what ocamlbuild does when I ask for it to compile myprog.byte and do a s/ocamlc/ocamlcp/ ...
<kaustuv>
I would imagine that ocamlcp is a drop-in replacement given that it is a frontend to ocamlc
<flux>
perhaps it's worth investigating if you can make gprof work regardless
<flux>
I think it should give much more accurate results
<flux>
and, for the native code, which is the interesting one if you're targetting performance..
<iris1>
flux: yes, I agree, that would be most interesting
<iris1>
I spent a bunch of time on that but could not make it work
<flux>
iris1, have you tried to make it work with a simple c program?
<kaustuv>
I think ocamlprof's counters are easier to read and you can get more fine-grained profile info such as how often a particular if/then/else branch is taken
<iris1>
there are a bunch of threads about it at various places
<iris1>
I don't know C, and hoping never to learn it :-(
<iris1>
for gprof, what I ended up doing is to run a VMware Linux machine on my Mac and doing gprof on that one...
<flux>
iris1, does this work for you? echo 'int main() { int c; int d = 42; for (c = 0; c < 100000000; ++c) { d = d ^ (d % (c + 1)); } }' >foo.c && gcc -g -pg -o foo foo.c && ./foo && gprof foo
<flux>
I guess not
<flux>
if you've tried so hard :)
<iris1>
kaustuv: your suggestion "ocamlbuild -ocamlc 'ocamlfind ocamlcp' foo.byte" works. I get ocamlprof.dump and can use it via ocamlprof. Thank you very much!!!
<avsm>
yes, the lack of timing in gprof in macos x is quite annoying; you have to compile C programs with -finstrument-functions and use Saturn, which isn't very compatible with gprof and -pg
<flux>
oh, that sucks.
<iris1>
flux: I can't tell if the code snippet you gave me works; it certainly runs without an error but in the end I get zero for the timing (http://pastebin.com/2mvyfy2J) Not sure if this means that my computer is really fast, or that the time is not being kept :-(
<iris1>
avsm: is it possible to get ocamlbuild to use Saturn ?
<flux>
iris1, I doubt your machine is that much faster, although mine is just a dual-core 2.4GHz Intel I3 ;)
ankit9 has quit [Quit: Leaving]
<iris1>
yeah I agree, mine is a 2.8GHz Xeon (a Mac Pro) :-)
<avsm>
iris1: its an ocamlopt thing; it needs to output the -finstruments-version of the instrumentation rather than gprof (the compiler needs to be patched)
<kaustuv>
Note: gcc sometimes removes useless loops. Not sure if -pg turns that optimization off or not.
PiepScuim has joined #ocaml
jderque has quit [Quit: leaving]
<adrien>
-O0 is the default but at higher levels that will kick in iirc: -fipa-pure-const : Discover which functions are pure or constant. Enabled by default at -O and higher.
<adrien>
(and that includes optimization of for loops I think)
boscop_ is now known as boscop
wtetzner has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
emmanuelux has joined #ocaml
lopex has quit []
jamii has joined #ocaml
joewilliams_away is now known as joewilliams
ymasory has quit [Quit: Leaving]
Rolands has quit [Ping timeout: 240 seconds]
jamii has quit [Ping timeout: 240 seconds]
vivanov has quit [Ping timeout: 240 seconds]
vivanov has joined #ocaml
ymasory has joined #ocaml
ftrvxmtrx has joined #ocaml
larhat has quit [Quit: Leaving.]
emmanuelux has quit [Quit: =>[]]
emmanuel_ has joined #ocaml
emmanuel_ has quit [Client Quit]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
emmanuelux has joined #ocaml
philtor has joined #ocaml
ankit9 has joined #ocaml
Associat0r has quit [Quit: Associat0r]
pdhborges has joined #ocaml
ulfdoz has joined #ocaml
jderque has joined #ocaml
oriba has left #ocaml []
ftrvxmtrx has joined #ocaml
PiepScuim has quit [Quit: Ex-Chat]
eikke has quit [Ping timeout: 260 seconds]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
joelr has joined #ocaml
<joelr>
good day
<joelr>
can you define module A that revers to B and vise versa?
<joelr>
more precisely, how do you do this?
<joelr>
ah! mutually recursive is the right description /googling/
avsm has quit [Quit: Leaving.]
<joelr>
sems to require a signature
hto has joined #ocaml
<edwin>
compile A.mli, B.mli and then A.ml and B.ml, assuming the .mli files are independent
impy has joined #ocaml
Associat0r has joined #ocaml
pdhborges has quit [Quit: Leaving.]
smerz has joined #ocaml
mjonsson has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
ymasory has quit [Quit: Leaving]
lopex has joined #ocaml
ankit9 is now known as ankit9|zzz
<joelr>
edwin: thanks
Associat0r has quit [Quit: Associat0r]
<thelema_>
joelr: in general, if A and B depend on each other, they need to be in the same file.
thelema_ is now known as thelema
<joelr>
right
<joelr>
I was trying to figure out how to do that in terms of module X = struct ... end
<joelr>
but it appears you can only do it in terms of signatures... or something
<joelr>
thelema: ^
<thelema>
you have to have full signatures + bodies of recursive modules in the same file.
<thelema>
module rec A : Sig_A = Body_A and B : Sig_B = Body_B ...
<joelr>
right, thanks
jderque has quit [Quit: leaving]
joewilliams is now known as joewilliams_away
joewilliams_away is now known as joewilliams
sheets1 has joined #ocaml
<sheets1>
I have two layers of objects: the outer layer is parameterized by a variant "box" which has tags with various subtypes of the second layer. I would like to write a higher-order method on the outer object to modify the inner layer through the common subtype that the variants hold. I currently have method bind_ob : 'o. ((#ob as 'o) -> 'o) -> 'self however the function argument seems to always get closed because of the variant constructors' types.
<sheets1>
Is this type of polymorphism possible? Should I be using some other part of the type system to get it?
ulfdoz has quit [Ping timeout: 260 seconds]
<thelema>
bind_ob : ([> ob] -> [> ob]) -> 'self ?
<sheets1>
thelema: ob is the common ancestor of the tagged boxes not the variant itself. I've already resigned myself to manually building the constructor unwrap pattern match
<sheets1>
so the match does something like: match self#box with | `Foo f -> self#set_box (`Foo (fn f))
<thelema>
that should return a new object of the same type as the outer layer object?
<sheets1>
yes with the inner box having been mapped with the passed function
<thelema>
That should be possible, why all the tagging?
<sheets1>
The tagging is to (attempt) to preserve the specific subtype of #ob
<sheets1>
that is, i would like to map a generic function over the contained objects and keep their most specific, closed object signatures
<thelema>
have you tried using the object clone syntax {< box = match self#box with `Foo x -> `Foo (fn x) ... >}?