From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p6SCi4r4004843 for ; Thu, 28 Jul 2011 14:44:04 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0DAERZMU5KfVK2kGdsb2JhbABPAjIBHx4DFAkBBlsTARIBBQEeS5glhm0BiBQIFAEBAQEJCQ0HFAQhqleCUgqMK4JShHw7iG0CAwaGOwSSeYxMPINe X-IronPort-AV: E=Sophos;i="4.67,282,1309730400"; d="scan'208";a="104114158" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 28 Jul 2011 14:43:59 +0200 Received: by wyg24 with SMTP id 24so713wyg.27 for ; Thu, 28 Jul 2011 05:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=D3d8pZP6b6AIIKlk/TFyAvTDDlpC129UelQoJLq9INI=; b=kBGNULimBjzEk18vsyiWr6M4aEsNOMVo/1CT0r++btdH5HzgEfYJaJvlOxwsSU3RLZ ZW4PC23iH7brIYYxaumHbhYSMRv/UbUa8UcZIElXMroRA2omzH/+/MGxIKNOuymI5Yyb Hf5GS22MTtVyK9WJQUWRIRM0aC3ztta3zG2mg= MIME-Version: 1.0 Received: by 10.227.27.195 with SMTP id j3mr208469wbc.45.1311857038788; Thu, 28 Jul 2011 05:43:58 -0700 (PDT) Received: by 10.216.61.141 with HTTP; Thu, 28 Jul 2011 05:43:58 -0700 (PDT) Date: Thu, 28 Jul 2011 14:43:58 +0200 Message-ID: From: ben mailist To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=0022159745eacb06cc04a920843e Subject: [Caml-list] creating a standalone labltk program --0022159745eacb06cc04a920843e Content-Type: text/plain; charset=ISO-8859-1 hi I try to staticall link all necessary libraries to create a standalone labltk application. So that it is no longer necessary to install the tcl/tk runtime on the target machine. Environment: - mac os x 10.6 - ocaml 3.12.1 Build command: $ ocamlopt -o lb -linkall -I +labltk labltk.cmxa listbox01.ml Size looks promising: $ du -sh lb 2.6 M But its not running. After disabling the Tk.framework directory, I get this Error: $ ./lb dyld: Library not loaded: /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk Referenced from: /Volumes/.../temp/./lb Reason: image not found Trace/BPT trap Apparently the '-linkall' switch is not enough. Is this something that has to be defined with ./configure when compiling ocaml? I couldn't find an appropriate ./configure switch for that. thanks in advance ben --0022159745eacb06cc04a920843e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable hi

I try to staticall link all necessary libraries to cr= eate a standalone labltk application. So that it is no longer necessary to = install the tcl/tk runtime on the target machine.

Environment:
=A0=A0- mac os x 10.6
=A0=A0- ocaml 3.12.1=

Build command:
=A0=A0 =A0
=A0= =A0 =A0$ ocamlopt -o lb -linkall =A0-I +labltk labltk.cmxa listbox01.ml=A0

Size looks promising:

=A0=A0 = =A0$ du -sh lb
=A0=A0 =A0 2.6 M

But its = not running. After disabling the Tk.framework directory, I get this=A0

Error:

=A0=A0 =A0$ ./lb
dyld: = Library not loaded: /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk=
=A0=A0Referenced from: /Volumes/.../temp/./lb
=A0=A0Re= ason: image not found
Trace/BPT trap

Apparently the '-lin= kall' switch is not enough. Is this something that has to be defined wi= th ./configure when compiling ocaml? I couldn't find an appropriate ./c= onfigure switch for that.

thanks in advance
ben
--0022159745eacb06cc04a920843e-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p6UAaUwH017400 for ; Sat, 30 Jul 2011 12:36:30 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYBAEfeM07RVaE2kGdsb2JhbAA0AQEBAQIBFAIqCAEfHQEDAQwHBQs1EhQSAhIBBQEkBxcnp0MIFAEBAQEJCQ0HFAQhiHwCow8KjC+CVIQzO4htAgMGhjwEh1SLJ4Ytgz6CYTyDXw X-IronPort-AV: E=Sophos;i="4.67,291,1309730400"; d="scan'208";a="114525943" Received: from mail-fx0-f54.google.com ([209.85.161.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jul 2011 12:36:14 +0200 Received: by fxe4 with SMTP id 4so5945544fxe.27 for ; Sat, 30 Jul 2011 03:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=1OMqLd75Q2teHWsV7g6wDfQWbzzO+eSojWzvZgph9sI=; b=KR1FsuvLgyv1PBIfn1t+4gRxDXMRUBsX7BMamaaTLoxvvPL7U6XG088tpuKEnp3AWb x8XOkYliFSiUPeAdtJtF8bhc6udQklDOEnI7sE44uwLsdCvbg9WV44zISiyVsQrd7bHq 7pn2b1NCrMkpXJDkiEpDM4kbP01VK2+1nCncc= Received: by 10.223.100.89 with SMTP id x25mr3296094fan.81.1312022173655; Sat, 30 Jul 2011 03:36:13 -0700 (PDT) Received: from lemon.local.tld (227-28-132-95.pool.ukrtel.net [95.132.28.227]) by mx.google.com with ESMTPS id e10sm1606750fak.42.2011.07.30.03.36.11 (version=SSLv3 cipher=OTHER); Sat, 30 Jul 2011 03:36:12 -0700 (PDT) Date: Sat, 30 Jul 2011 13:35:18 +0300 From: ygrek To: ben mailist Cc: caml-list@inria.fr Message-Id: <20110730133518.798c6a30.ygrekheretix@gmail.com> In-Reply-To: References: X-Mailer: Sylpheed 3.0.2 (GTK+ 2.24.4; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] creating a standalone labltk program On Thu, 28 Jul 2011 14:43:58 +0200 ben mailist wrote: > I try to staticall link all necessary libraries to create a standalone > labltk application. So that it is no longer necessary to install the tcl/tk > runtime on the target machine. > [...] > $ ocamlopt -o lb -linkall -I +labltk labltk.cmxa listbox01.ml -linkall links in all ocaml modules, it has nothing to do with linking of external libraries. In order to link everything statically you need to ask C linker to do so - the simplest way is to use `-ccopt -static` but that means linking in libc which is not good usually. More involved and correct way is to wrap all external libraries with `-Wl,-Bstatic -lxxx -Wl,-Bdynamic` on command-line. Note that using `ocamlopt -ccopt -Wl,-Bstatic -ccopt -Wl,-Bdynamic` (to wrap all libs at once) will not usually work as ocamlopt reorders `-ccopt` at will :( Use `-verbose` to check what is being passed to gcc. -- ygrek http://ygrek.org.ua From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p6UELWZu022512 for ; Sat, 30 Jul 2011 16:21:32 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnUHAAQTNE7RVdIyjWdsb2JhbABBnCuLLwgUAQEBAQkJCwkSBiGBQAEBAQECARICJgYBOAEDAQsBBQU0EjQBBQEcBjWHSqNuCo8DhBaJKAIDBoVdXwSHWIsjhi2GHzyBP4Is X-IronPort-AV: E=Sophos;i="4.67,291,1309730400"; d="scan'208";a="114536259" Received: from mail-pz0-f50.google.com ([209.85.210.50]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jul 2011 16:21:03 +0200 Received: by pzk2 with SMTP id 2so8665214pzk.37 for ; Sat, 30 Jul 2011 07:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=VYY/pGz4ol2xpws3FdycohUL02xfuF4nSUXE9E6SEIc=; b=CVbpd6Ji3CnOkAsDPpyXsqQUwo50hpCwiT3KD1IR68FL/p/Dyc/PGrIoXvDW6X98Kr yYz7+mQZKhu12Q1x1Ju9wIzknXL0kJ7LjSKZnGVjPRS2V27n2gg031JlBK+JgXvcCiwB c99HmnR+jn1ziIO2oqZ8TjkzmNh0oqXbPdO4w= Received: by 10.68.66.170 with SMTP id g10mr255914pbt.490.1312035662317; Sat, 30 Jul 2011 07:21:02 -0700 (PDT) Received: from tet.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) by mx.google.com with ESMTPS id v1sm3299766pbg.15.2011.07.30.07.21.00 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 30 Jul 2011 07:21:01 -0700 (PDT) Sender: Jacques Garrigue Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Jacques Garrigue In-Reply-To: Date: Sat, 30 Jul 2011 23:20:58 +0900 Cc: caml-list@inria.fr Message-Id: <570F5DAA-8018-494E-B4CB-8B63DB166157@math.nagoya-u.ac.jp> References: To: ben mailist X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p6UELWZu022512 Subject: Re: [Caml-list] creating a standalone labltk program On 2011/07/28, at 21:43, ben mailist wrote: > hi > > I try to staticall link all necessary libraries to create a standalone labltk application. So that it is no longer necessary to install the tcl/tk runtime on the target machine. Unfortunately, this is more or less impossible to achieve: Tcl/Tk requires its own library of tcl scripts to be installed on the target machine, so that you cannot be really standalone. By either using ocamlopt or ocamlc -custom, you limit the dependency to having the right version of Tcl/Tk installed, which should not be too hard on Unix/OSX or for a motivated windows user. The situation is a bit better with lablgtk: you can create standalone executables (see unison for instance for how to do that). You loose part of the functionality of gtk (themes and input methods require dynamic loading), but your application will still work. Jacques Garrigue