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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 331148239C for ; Fri, 23 Feb 2018 00:58:12 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mvanier@cms.caltech.edu; spf=None smtp.mailfrom=mvanier@cms.caltech.edu; spf=None smtp.helo=postmaster@canitpro.cms.caltech.edu Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mvanier@cms.caltech.edu) identity=pra; client-ip=131.215.140.61; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mvanier@cms.caltech.edu"; x-sender="mvanier@cms.caltech.edu"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mvanier@cms.caltech.edu) identity=mailfrom; client-ip=131.215.140.61; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mvanier@cms.caltech.edu"; x-sender="mvanier@cms.caltech.edu"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@canitpro.cms.caltech.edu) identity=helo; client-ip=131.215.140.61; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mvanier@cms.caltech.edu"; x-sender="postmaster@canitpro.cms.caltech.edu"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AS4yjZRD/x09OYxoFMpTSUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSPTzocbcNUDSrc9gkEXOFd2Cra4c0KyO6+jJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6?= =?us-ascii?q?JvjvGo7Vks+7y/2+94fcbglUijexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfO?= =?us-ascii?q?pWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnM?= =?us-ascii?q?VhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs7Xims77pwSB/wli?= =?us-ascii?q?gIKyI5/m/Qisx1lq1boRShrAF7z4PbZIyZMfxzdb7fc9wHX2pMRttfWTJPAo28?= =?us-ascii?q?bIUBAeQOMulaoIbhvFYBtweyCBO2Ce/zxDJFhHn71rA63eQ7FgHG2RQtEdUPsH?= =?us-ascii?q?vIrNX6LrkdUeSox6TW0D7MYOlZ2TH86IfWaBAqvPaBXbduccXLz0kvFh3Kjk+L?= =?us-ascii?q?pIP5OjOVzf4BvHSB4OpkSeKglXIoqwFrrjex28gsl5DEi4QIwV7K8iV5xZw6Jd?= =?us-ascii?q?y+SENjYN6kFoFQtyCAOIdsTMMiWXlkuSYgxb0Gvp67ezIGx4ggxx7abfGMbouG?= =?us-ascii?q?4gr7WeqMLzp0mWhpdKyiixuy60Ss1+LxWtWu3FtLsyZJisTAu34Q2xDJ9MSLV/?= =?us-ascii?q?tw8l281TuAygzf8PxILEE3mKfdNpUv2KQ/loAJvkTGBiL2mFv5jKuRdkg85uen?= =?us-ascii?q?8eLnYrT6pp+ELY90jRvyPbgrmsykG+g3LhIBX2yH+euiyLLj/Vf1T6tXgf0riq?= =?us-ascii?q?XZsZbaKtoHpqOhHgNY3Jsv5wyhAzu70NkUh2QLIV1ZdB6djoXlJknCIPXiAve+?= =?us-ascii?q?h1Ssni1rx/fDPrD5B5XNMGLMkLHgfblj8U5R0xY8zdVE555OFr4OOvbzWlPvu9?= =?us-ascii?q?PEDh81KRK7zPv6CNllzIMRRXqPArOFMKPVqVKH+vggI+yIZIMMvDb9KuMl5+L1?= =?us-ascii?q?gH8imV4deLGp0oENZHC5GPRmOUSZbmD2jtcPC2dZ9jY5Gcrrg1qG2CVkQHS/U6?= =?us-ascii?q?sLzL0hQNagDIzEQom2xruD0SuyWJdffEhCB0CNH3aufIKBDaQiciWXd+pgmTwN?= =?us-ascii?q?WLzpYMcf3BevuRWyn795J+zV9zcwvpf4ktN84/HenhF0+DBpWZfOm1qRRn15yz?= =?us-ascii?q?tbDwQ927py9BAskwbR4e1Dm/VdUOdrybZMWwY+O4TbyrUlWdv3QUTKd9OVRV2m?= =?us-ascii?q?BNiqHGNpF45j85o1e094Xu6aoFXbxSPzXO0ekqfND5Uw7q/X3z78K9svky+bhp?= =?us-ascii?q?lktEEvR450DUPjhqN78FKNVYXAlUSFj7ytM68Zx2jG/WOfwGGO+kxUTVwoXA?= =?us-ascii?q?=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CEAADxV49ahz2M14NdGQEBAQEBAQEBA?= =?us-ascii?q?QEBAQcBAQEBAYQ1cCiDaIoljXyBUDJ7G4FQlH4UggIBCSOFEQKCLhkGBTAYAQI?= =?us-ascii?q?BAQEBAQEBAQESAQEBCgsJCCgvgjgMgmABBSNLCxALGA0aAwICRQERBg0GAgEBD?= =?us-ascii?q?ol5AxUQq2mCJyaEWoI4A1IHY4IeAQEBAQEBAQEBAQEBAQEBAQEBAQEehRmCJ4F?= =?us-ascii?q?XgWcpgk82gyWBRoMSPYJlBYh5DIplkFUJiCiQbZE9jgyKHoE8H4IKTSUTOoJDC?= =?us-ascii?q?YISSYIzV4xoAQEB?= X-IPAS-Result: =?us-ascii?q?A0CEAADxV49ahz2M14NdGQEBAQEBAQEBAQEBAQcBAQEBAYQ?= =?us-ascii?q?1cCiDaIoljXyBUDJ7G4FQlH4UggIBCSOFEQKCLhkGBTAYAQIBAQEBAQEBAQESA?= =?us-ascii?q?QEBCgsJCCgvgjgMgmABBSNLCxALGA0aAwICRQERBg0GAgEBDol5AxUQq2mCJya?= =?us-ascii?q?EWoI4A1IHY4IeAQEBAQEBAQEBAQEBAQEBAQEBAQEehRmCJ4FXgWcpgk82gyWBR?= =?us-ascii?q?oMSPYJlBYh5DIplkFUJiCiQbZE9jgyKHoE8H4IKTSUTOoJDCYISSYIzV4xoAQE?= =?us-ascii?q?B?= X-IronPort-AV: E=Sophos;i="5.47,381,1515452400"; d="scan'208,217";a="314931194" Received: from canitpro.cms.caltech.edu ([131.215.140.61]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2018 00:58:09 +0100 Received: from lee-vm2.cms.caltech.edu (lee-vm2.cms.caltech.edu [131.215.140.25]) by canitpro.cms.caltech.edu (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w1MNw6C3023901; Thu, 22 Feb 2018 15:58:07 -0800 Received: from DHCP-141-168.caltech.edu (DHCP-141-168.caltech.edu [131.215.141.168]) by lee-vm2.cms.caltech.edu (Postfix) with ESMTPSA id CA6451E260; Thu, 22 Feb 2018 15:58:06 -0800 (PST) To: =?UTF-8?Q?Nicol=c3=a1s_Ojeda_B=c3=a4r?= Cc: caml-list References: <7441c664-00ae-c125-9ce4-80e5a67fcd8e@cms.caltech.edu> From: Michael C Vanier Message-ID: <3f1c38bf-97e0-c887-c6b4-0c327aecae56@cms.caltech.edu> Date: Thu, 22 Feb 2018 15:58:06 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------4EE20A7E67D8FC6148463BFB" Content-Language: en-US X-Spam-Score: undef - relay 131.215.140.25 marked with skip_spam_scan X-CanIt-Incident-Id: 01VdXW7iL X-CanIt-Geo: ip=131.215.140.25; country=US; region=California; city=Pasadena; latitude=34.1613; longitude=-118.0895; http://maps.google.com/maps?q=34.1613,-118.0895&z=6 X-CanItPRO-Stream: Outgoing (inherits from default) X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 131.215.140.61 Subject: Re: [Caml-list] Has anybody gotten delimcc to work? This is a multi-part message in MIME format. --------------4EE20A7E67D8FC6148463BFB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit It works!  Thank you so much Nicolas! Mike On 2/22/18 3:42 PM, Nicolás Ojeda Bär wrote: > Dear Mike, > > I was able to successfully load delimcc into the toplevel after > applying the tiny patch below. > You can give it a try by doing: > >   opam source delimcc >   cd delimcc.(version) >   (apply patch) >   opam pin add . > > (you have to replace the stuff between parentheses by whatever is > correct in your setup.) > > diff --git a/stacks.c b/stacks.c > index fdab2a7..5765710 100644 > --- a/stacks.c > +++ b/stacks.c > @@ -203,13 +203,13 @@ value copy_stack_fragment(const value vek1) >  #endif >    if (size < Max_young_wosize) { > -    block = alloc(size, 0); > +    block = caml_alloc(size, 0); >      memcpy(&Field(block, 0), tp2, size * sizeof(value)); >    } else { > -    block = alloc_shr(size, 0); > +    block = caml_alloc_shr(size, 0); >      mlsize_t i; >      for (i = 0; i < size; i++) > -      initialize(&Field(block, i), tp2[i]); > +      caml_initialize(&Field(block, i), tp2[i]); >    } >    /* We check the invariants after the allocation of block, which may > @@ -382,4 +382,3 @@ value dbg_note(const value message) >    fprintf(stderr,"%s\n",String_val(message)); >    return Val_unit; >  } > > Hope it helps, > Nicolás > > > > On Fri, Feb 23, 2018 at 12:18 AM, Michael C Vanier > > wrote: > > I've been trying to use the delimcc delimited continuation > library, but so far I've been unsuccessful.  I'm using OCaml > 4.06.1 and I've tried it on both Mac OS X (High Sierra) and Ubuntu > MATE 17.10. I'm fine sticking to bytecode.  The opam package > installs correctly but when you try to run it you get errors from > the dynamically-linked libraries.  On Mac OS X I get this: > > # #require "delimcc";; > Cannot load required shared library dlldelimcc. > Reason: /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so: > dlopen(/Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so, > 10): Symbol not found: _alloc >   Referenced from: > /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so >   Expected in: flat namespace >  in /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so. > > And on Ubuntu I get this: > > # #require "delimcc";; > /home/mvanier/.opam/4.06.1/lib/delimcc: added to search path > /home/mvanier/.opam/4.06.1/lib/delimcc/delimcc.cma: loaded > Cannot load required shared library dlldelimcc. > Reason: /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so: > dlopen(/Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so, > 10): Symbol not found: initialize. > > However, in either case I can do: > > # open Delimcc;; > > and it reports no errors, but then if I try e.g.: > > # shift;; > Reference to undefined global `Delimcc` > > so it appears the library isn't there or isn't functional. > Compiling from the delimcc source also appears to work, but gcc > warns about implicit declarations of "alloc", "alloc_shr" and > "initialize" when compiling stacks.c, which makes sense.  > Compiling any of the test programs also fails. > > So it appears that this library no longer works.  Does anyone know > any way to make it work? > > Thanks in advance, > > Mike > > > -- > Caml-list mailing list.  Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > --------------4EE20A7E67D8FC6148463BFB Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

It works!  Thank you so much Nicolas!

Mike


On 2/22/18 3:42 PM, Nicolás Ojeda Bär wrote:
Dear Mike,

I was able to successfully load delimcc into the toplevel after applying the tiny patch below.
You can give it a try by doing:

  opam source delimcc
  cd delimcc.(version)
  (apply patch)
  opam pin add .

(you have to replace the stuff between parentheses by whatever is correct in your setup.)

diff --git a/stacks.c b/stacks.c
index fdab2a7..5765710 100644
--- a/stacks.c
+++ b/stacks.c
@@ -203,13 +203,13 @@ value copy_stack_fragment(const value vek1)
 #endif
 
   if (size < Max_young_wosize) {
-    block = alloc(size, 0);
+    block = caml_alloc(size, 0);
     memcpy(&Field(block, 0), tp2, size * sizeof(value));
   } else {
-    block = alloc_shr(size, 0);
+    block = caml_alloc_shr(size, 0);
     mlsize_t i;
     for (i = 0; i < size; i++)
-      initialize(&Field(block, i), tp2[i]);
+      caml_initialize(&Field(block, i), tp2[i]);
   }
 
   /* We check the invariants after the allocation of block, which may
@@ -382,4 +382,3 @@ value dbg_note(const value message)
   fprintf(stderr,"%s\n",String_val(message));
   return Val_unit;
 }

Hope it helps,
Nicolás



On Fri, Feb 23, 2018 at 12:18 AM, Michael C Vanier <mvanier@cms.caltech.edu> wrote:
I've been trying to use the delimcc delimited continuation library, but so far I've been unsuccessful.  I'm using OCaml 4.06.1 and I've tried it on both Mac OS X (High Sierra) and Ubuntu MATE 17.10. I'm fine sticking to bytecode.  The opam package installs correctly but when you try to run it you get errors from the dynamically-linked libraries.  On Mac OS X I get this:

# #require "delimcc";;
Cannot load required shared library dlldelimcc.
Reason: /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so: dlopen(/Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so, 10): Symbol not found: _alloc
  Referenced from: /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so
  Expected in: flat namespace
 in /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so.

And on Ubuntu I get this:

# #require "delimcc";;
/home/mvanier/.opam/4.06.1/lib/delimcc: added to search path
/home/mvanier/.opam/4.06.1/lib/delimcc/delimcc.cma: loaded
Cannot load required shared library dlldelimcc.
Reason: /Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so: dlopen(/Users/mvanier/.opam/4.06.1/lib/stublibs/dlldelimcc.so, 10): Symbol not found: initialize.

However, in either case I can do:

# open Delimcc;;

and it reports no errors, but then if I try e.g.:

# shift;;
Reference to undefined global `Delimcc`

so it appears the library isn't there or isn't functional. Compiling from the delimcc source also appears to work, but gcc warns about implicit declarations of "alloc", "alloc_shr" and "initialize" when compiling stacks.c, which makes sense.  Compiling any of the test programs also fails.

So it appears that this library no longer works.  Does anyone know any way to make it work?

Thanks in advance,

Mike


--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


--------------4EE20A7E67D8FC6148463BFB--