From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id B107D7EF37 for ; Fri, 17 Jul 2015 21:08:29 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of wangshuai901@gmail.com) identity=pra; client-ip=209.85.216.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="wangshuai901@gmail.com"; x-sender="wangshuai901@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of wangshuai901@gmail.com designates 209.85.216.47 as permitted sender) identity=mailfrom; client-ip=209.85.216.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="wangshuai901@gmail.com"; x-sender="wangshuai901@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vn0-f47.google.com) identity=helo; client-ip=209.85.216.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="wangshuai901@gmail.com"; x-sender="postmaster@mail-vn0-f47.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DXAQB+UalVmy/YVdFagkaBIVoPBoMduBaCJIV7AoFCB0wBAQEBAQESAQEBAQEGCwsJIS6EIwEBAQMBEhEdARsXBgEDAQsGAwILDSoCAiEBAREBBQEcBhMIGod2AQMKCA2dEY8/gSw+MYs/gWyCeYslChknDVeEVwEBAQEBAQQBAQEBAQEBFQEFDos+gk2BZwEBUAeCaIFDBZRHBYRvgmCCaYFngUNGj1ODRoIXEiOBFREGghwcgW8iMQEBgQuBPgEBAQ X-IPAS-Result: A0DXAQB+UalVmy/YVdFagkaBIVoPBoMduBaCJIV7AoFCB0wBAQEBAQESAQEBAQEGCwsJIS6EIwEBAQMBEhEdARsXBgEDAQsGAwILDSoCAiEBAREBBQEcBhMIGod2AQMKCA2dEY8/gSw+MYs/gWyCeYslChknDVeEVwEBAQEBAQQBAQEBAQEBFQEFDos+gk2BZwEBUAeCaIFDBZRHBYRvgmCCaYFngUNGj1ODRoIXEiOBFREGghwcgW8iMQEBgQuBPgEBAQ X-IronPort-AV: E=Sophos;i="5.15,497,1432591200"; d="scan'208";a="140400290" Received: from mail-vn0-f47.google.com ([209.85.216.47]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 17 Jul 2015 21:08:28 +0200 Received: by vnk197 with SMTP id 197so4299289vnk.3 for ; Fri, 17 Jul 2015 12:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PcjH/P4xpgu0GBRbZglvRyBf5ao+fHuN0smQEXpPyvI=; b=T9XtbgQYRojEn33pQijuVMUhqN/VKKqsyek45gmgRWFjmSVHeHHlJyiAj4V+T1lJDT /2pQbE2LhVC18o79nvhwJJpAVJZbBVJo7EMMjQKbkVi4KYLTEXkGAyC6yrHHtzJP2R3+ 5cWj3mG9YGtalKEiKM3H4O7zAfqPRQ4B1LAuJNpRI+7dFjfYE4hmE5WCjNWAvIxCY+rh ZMWV9w5v+YSmZ9KwMxRhv+BHDnSATHaMQW1au7dil4uGYE97DhfTdtJ0FgfivH6M0xwl H82Bic+kxEyGn2s6g+ePUPPjNNpzO5P41IuZYS2HEVbkqkHUtKx05sBTiSnQSbReKS2q NCDw== MIME-Version: 1.0 X-Received: by 10.52.164.130 with SMTP id yq2mr18465658vdb.73.1437160107286; Fri, 17 Jul 2015 12:08:27 -0700 (PDT) Received: by 10.31.4.8 with HTTP; Fri, 17 Jul 2015 12:08:27 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Jul 2015 15:08:27 -0400 Message-ID: From: Shuai Wang To: Kenneth Adam Miller Cc: caml users Content-Type: multipart/alternative; boundary=001a11c2c960ae2812051b16e944 Subject: Re: [Caml-list] Cannot execute "main" function --001a11c2c960ae2812051b16e944 Content-Type: text/plain; charset=UTF-8 Thank you Kenneth, here is the starting of my init.ml, I simplified it to make it more understandable, did I make any stupid problem.. ? Criticise me if it was true.. I didn't touch this part for a long time.. let main () = if Array.length Sys.argv <> 2 then print_string "XXX\n" else if check_strip Sys.argv.(1) == false then print_string "XXX\n" else XXX let () = main () On Fri, Jul 17, 2015 at 2:57 PM, Kenneth Adam Miller < kennethadammiller@gmail.com> wrote: > Right, I was wondering if I should tell you that. That means: > > let _ = > my main definition... > > or > > let () = > my main definition... > > each get evaluated very similarly to how a main function would. Is there > code that you can post in order that I/we can help you? > > On Fri, Jul 17, 2015 at 2:53 PM, Shuai Wang > wrote: > >> Here is my compilation script. >> >> ocamlbuild -use-ocamlfind XXX1.native XXX2.native ... init.native >> -ocamlopt "-inline 20" -ocamlopt -nodynlink >> >> And our tool always execute init.native. >> >> >> >> >> On Fri, Jul 17, 2015 at 2:50 PM, Kenneth Adam Miller < >> kennethadammiller@gmail.com> wrote: >> >>> Can you post your build specification? >>> >>> On Fri, Jul 17, 2015 at 2:35 PM, Shuai Wang >>> wrote: >>> >>>> Dear list, >>>> >>>> >>>> I am working on some tools written in OCaml (compiled by OCaml version >>>> 4.01.0). >>>> >>>> This morning I changed some code, compiled it and let it processing >>>> some large data (~ 4G), it never stops after over 2 hours. >>>> >>>> I feed the tool with a tiny input which took less than 1 second to >>>> process before, and I figured out that now it takes around 2.5 minutes >>>> before entering into "main" function! >>>> >>>> I tried to clean the whole codebase, and recompile it ( I use >>>> ocamlbuild 4.01.0), but the same wired situation still happens.. >>>> >>>> I did this: >>>> >>>> ltrace ./init.native input >>>> >>>> and I got this output flushing out for a very long time (sorry mail >>>> list blocks my large image.. ): >>>> >>>> http://i.stack.imgur.com/sEkKk.png >>>> >>>> >>>> >>>> Is anyone aware this kind of issue before..? Am I messed up >>>> something..? >>>> I have been working on OCaml for a relatively long time and I didn't >>>> encounter this kind of stuff before... >>>> >>>> >>>> Sincerely, >>>> Shuai >>>> >>> >>> >> > --001a11c2c960ae2812051b16e944 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you Kenneth, here is the starting of my init.ml, I simplified it to make it more understandable,= =C2=A0did I make any stupid problem.. ? Criticise me if it was true..=C2= =A0
I didn't touch this part for a long time..

<= br>

=C2=A0 let main () =3D
=C2=A0 = =C2=A0 if Array.length Sys.argv <> 2 then
=C2=A0 =C2=A0 =C2= =A0 print_string "XXX\n"
=C2=A0 =C2=A0 else if check_st= rip Sys.argv.(1) =3D=3D false then
=C2=A0 =C2=A0 =C2=A0 print_str= ing "XXX\n"
=C2=A0 =C2=A0 else
=C2=A0 =C2=A0 = =C2=A0 XXX
=C2=A0 =C2=A0 =C2=A0=C2=A0
let () =3D
<= div>=C2=A0 main ()




O= n Fri, Jul 17, 2015 at 2:57 PM, Kenneth Adam Miller <<= a href=3D"mailto:kennethadammiller@gmail.com" target=3D"_blank">kennethadam= miller@gmail.com> wrote:
Right, I was wondering if I should tell you that. That means= :

let _ =3D=C2=A0
=C2=A0 my main definition...=

or=C2=A0

let () =3D
=C2=A0 my main definition...

each get evalua= ted very similarly to how a main function would. Is there code that you can= post in order that I/we can help you?

On= Fri, Jul 17, 2015 at 2:53 PM, Shuai Wang <wangshuai901@gmail.com= > wrote:
= Here is my compilation script.=C2=A0

ocamlbuild -u= se-ocamlfind =C2=A0XXX1.native XXX2.native ... init.native =C2=A0-ocamlopt = "-inline 20" -ocamlopt -nodynlink

And ou= r tool always execute init.native.=C2=A0




On Fri, Jul 17, 2015 at 2:50 PM, Kenneth Adam Miller <kennethadammiller@gmail.com> wrote:
Can you post your build specification?

On Fr= i, Jul 17, 2015 at 2:35 PM, Shuai Wang <wangshuai901@gmail.com>= ; wrote:
Dear list,


I am working on som= e tools written in OCaml (compiled by OCaml version 4.01.0).=C2=A0

This morning I changed some code, compiled it and let i= t processing some large data (~ 4G), it never stops after over 2 hours.=C2= =A0

I feed the tool with a tiny input which t= ook less than 1 second to process before, and =C2=A0I figured out that now = it takes around 2.5 minutes before entering into "main" function!=

I tried to clean the whole codebase, and recom= pile it ( I use ocamlbuild 4.01.0), but the same wired situation still happ= ens..=C2=A0

I did this:

=C2=A0 =C2=A0 ltrace ./init.native input

a= nd I got this output flushing out for a very long time (sorry mail list blo= cks my large image.. ):


Is anyone aware this k= ind of issue before..? Am I messed up something..?=C2=A0
I have been working on OCaml for a relativel= y long time and I didn't encounter this kind of stuff before...


= Sincerely,
Shuai




--001a11c2c960ae2812051b16e944--