caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Has anybody gotten delimcc to work?
@ 2018-02-22 23:18 Michael C Vanier
  2018-02-22 23:42 ` Nicolás Ojeda Bär
  0 siblings, 1 reply; 7+ messages in thread
From: Michael C Vanier @ 2018-02-22 23:18 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Has anybody gotten delimcc to work?
  2018-02-22 23:18 [Caml-list] Has anybody gotten delimcc to work? Michael C Vanier
@ 2018-02-22 23:42 ` Nicolás Ojeda Bär
  2018-02-22 23:58   ` Michael C Vanier
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolás Ojeda Bär @ 2018-02-22 23:42 UTC (permalink / raw)
  To: Michael C Vanier; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 3307 bytes --]

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
>

[-- Attachment #2: Type: text/html, Size: 4614 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Has anybody gotten delimcc to work?
  2018-02-22 23:42 ` Nicolás Ojeda Bär
@ 2018-02-22 23:58   ` Michael C Vanier
  2018-02-23  3:18     ` Michael C Vanier
  0 siblings, 1 reply; 7+ messages in thread
From: Michael C Vanier @ 2018-02-22 23:58 UTC (permalink / raw)
  To: Nicolás Ojeda Bär; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 3790 bytes --]

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 <mailto: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
>     <https://sympa.inria.fr/sympa/arc/caml-list>
>     Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>     <http://groups.yahoo.com/group/ocaml_beginners>
>     Bug reports: http://caml.inria.fr/bin/caml-bugs
>     <http://caml.inria.fr/bin/caml-bugs>
>
>


[-- Attachment #2: Type: text/html, Size: 6617 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Has anybody gotten delimcc to work?
  2018-02-22 23:58   ` Michael C Vanier
@ 2018-02-23  3:18     ` Michael C Vanier
  2018-02-23  5:15       ` Nicolás Ojeda Bär
  0 siblings, 1 reply; 7+ messages in thread
From: Michael C Vanier @ 2018-02-23  3:18 UTC (permalink / raw)
  To: Nicolás Ojeda Bär; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 6202 bytes --]

So... I was trying to figure out how to make a pull request on the 
delimcc repo (if there is one) and it was an exercise in frustration.  
The "opam-publish" tool doesn't seem to work anymore with recent ocaml 
builds due to a nest of dependency issues:

=====

 > opam install opam-publish
The following dependencies couldn't be met:
   - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0 -> 
extlib < 1.7.0
   - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0 -> 
extlib-compat < 1.7.0
   - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0 -> 
ocamlgraph <= 1.8.5
   - opam-publish -> publish -> opam-publish > 0.3.4 -> opam-lib > 1.2.2 
-> jsonm -> uutf (<= 0.9.4 | >= 1.0.0)
   - opam-publish -> publish -> opam-publish > 0.3.4 -> opam-lib > 1.2.2 
-> cmdliner <= 0.9.8
   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> cmdliner 
<= 0.9.8
   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> dose < 
3.4.0 -> ocamlgraph <= 1.8.5
   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> dose < 
3.4.0 -> extlib-compat < 1.7.0
   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> dose < 
3.4.0 -> extlib < 1.7.0
   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> jsonm -> 
uutf (<= 0.9.4 | >= 1.0.0)
Your request can't be satisfied:
   - cmdliner.0.9.4 is in conflict with uutf.1.0.1
   - extlib-compat<1.7.0 is not available because your system doesn't 
comply with ocaml-version < "4.05.0".
   - extlib<1.7.0 is not available because your system doesn't comply 
with ocaml-version < "4.05.0".
   - ocamlgraph.1.8.5 is not available because your system doesn't 
comply with ocaml-version < "4.06.0".
   - ocamlgraph<=1.8.5 is not available because your system doesn't 
comply with ocaml-version < "4.06.0".
   - uutf<=0.9.4 is not available because your system doesn't comply 
with ocaml-version >= "4.00.0" & ocaml-version < "4.06.0".

No solution found, exiting

=====

I tried forking the opam-repository repo but there is only metadata 
about the various packages and not the actual code to make a patch on.  
Is there some documentation on how to submit a bug fix to a package?  
Sorry if this is a dumb question.

Mike


On 2/22/18 3:58 PM, Michael C Vanier wrote:
>
> 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 <mailto: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
>>     <https://sympa.inria.fr/sympa/arc/caml-list>
>>     Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>>     <http://groups.yahoo.com/group/ocaml_beginners>
>>     Bug reports: http://caml.inria.fr/bin/caml-bugs
>>     <http://caml.inria.fr/bin/caml-bugs>
>>
>>
>


[-- Attachment #2: Type: text/html, Size: 10076 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Has anybody gotten delimcc to work?
  2018-02-23  3:18     ` Michael C Vanier
@ 2018-02-23  5:15       ` Nicolás Ojeda Bär
  2018-02-23  5:56         ` Michael C Vanier
  2018-02-26  5:42         ` Oleg
  0 siblings, 2 replies; 7+ messages in thread
From: Nicolás Ojeda Bär @ 2018-02-23  5:15 UTC (permalink / raw)
  To: Michael C Vanier; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 6959 bytes --]

Hello Mike,

Indeed the opam-repository is just a bunch of metadata and the opam-publish
tool is used to update this metadata. Typically this is done by the opam
package maintainer which may or may not be the package author (the latter
in this case).

In order to submit a patch to the delimcc package you need to figure out
the upstream repository. Typically you can do this by looking in the opam
metadata. In this case, the opam package is maintained at
https://github.com/zinid/delimcc, but there is no public repository of the
upstream source, rather it is distributed as a tar file by the author (Oleg
Kiselyov; see
http://okmij.org/ftp/continuations/implementations.html#caml-shift).

I went ahead and submitted a patch to the package maintainer (
https://github.com/zinid/delimcc/pull/1) and also sent it by email to Oleg
so that the upstream sources can be amended.

Best wishes,
Nicolás


On Fri, Feb 23, 2018 at 4:18 AM, Michael C Vanier <mvanier42@gmail.com>
wrote:

> So... I was trying to figure out how to make a pull request on the delimcc
> repo (if there is one) and it was an exercise in frustration.  The
> "opam-publish" tool doesn't seem to work anymore with recent ocaml builds
> due to a nest of dependency issues:
>
> =====
>
> > opam install opam-publish
> The following dependencies couldn't be met:
>   - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0 -> extlib
> < 1.7.0
>   - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0 ->
> extlib-compat < 1.7.0
>   - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0 ->
> ocamlgraph <= 1.8.5
>   - opam-publish -> publish -> opam-publish > 0.3.4 -> opam-lib > 1.2.2 ->
> jsonm -> uutf (<= 0.9.4 | >= 1.0.0)
>   - opam-publish -> publish -> opam-publish > 0.3.4 -> opam-lib > 1.2.2 ->
> cmdliner <= 0.9.8
>   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> cmdliner <=
> 0.9.8
>   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> dose <
> 3.4.0 -> ocamlgraph <= 1.8.5
>   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> dose <
> 3.4.0 -> extlib-compat < 1.7.0
>   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> dose <
> 3.4.0 -> extlib < 1.7.0
>   - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) -> jsonm ->
> uutf (<= 0.9.4 | >= 1.0.0)
> Your request can't be satisfied:
>   - cmdliner.0.9.4 is in conflict with uutf.1.0.1
>   - extlib-compat<1.7.0 is not available because your system doesn't
> comply with ocaml-version < "4.05.0".
>   - extlib<1.7.0 is not available because your system doesn't comply with
> ocaml-version < "4.05.0".
>   - ocamlgraph.1.8.5 is not available because your system doesn't comply
> with ocaml-version < "4.06.0".
>   - ocamlgraph<=1.8.5 is not available because your system doesn't comply
> with ocaml-version < "4.06.0".
>   - uutf<=0.9.4 is not available because your system doesn't comply with
> ocaml-version >= "4.00.0" & ocaml-version < "4.06.0".
>
> No solution found, exiting
>
> =====
>
> I tried forking the opam-repository repo but there is only metadata about
> the various packages and not the actual code to make a patch on.  Is there
> some documentation on how to submit a bug fix to a package?  Sorry if this
> is a dumb question.
>
> Mike
>
> On 2/22/18 3:58 PM, Michael C Vanier wrote:
>
> 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
>>
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 11790 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Has anybody gotten delimcc to work?
  2018-02-23  5:15       ` Nicolás Ojeda Bär
@ 2018-02-23  5:56         ` Michael C Vanier
  2018-02-26  5:42         ` Oleg
  1 sibling, 0 replies; 7+ messages in thread
From: Michael C Vanier @ 2018-02-23  5:56 UTC (permalink / raw)
  To: Nicolás Ojeda Bär; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 8097 bytes --]

Thanks again, Nicolas!

Mike


On 2/22/18 9:15 PM, Nicolás Ojeda Bär wrote:
> Hello Mike,
>
> Indeed the opam-repository is just a bunch of metadata and the 
> opam-publish tool is used to update this metadata. Typically this is 
> done by the opam package maintainer which may or may not be the 
> package author (the latter in this case).
>
> In order to submit a patch to the delimcc package you need to figure 
> out the upstream repository. Typically you can do this by looking in 
> the opam metadata. In this case, the opam package is maintained at 
> https://github.com/zinid/delimcc, but there is no public repository of 
> the upstream source, rather it is distributed as a tar file by the 
> author (Oleg Kiselyov; see 
> http://okmij.org/ftp/continuations/implementations.html#caml-shift).
>
> I went ahead and submitted a patch to the package maintainer 
> (https://github.com/zinid/delimcc/pull/1) and also sent it by email to 
> Oleg so that the upstream sources can be amended.
>
> Best wishes,
> Nicolás
>
>
> On Fri, Feb 23, 2018 at 4:18 AM, Michael C Vanier <mvanier42@gmail.com 
> <mailto:mvanier42@gmail.com>> wrote:
>
>     So... I was trying to figure out how to make a pull request on the
>     delimcc repo (if there is one) and it was an exercise in
>     frustration.  The "opam-publish" tool doesn't seem to work anymore
>     with recent ocaml builds due to a nest of dependency issues:
>
>     =====
>
>     > opam install opam-publish
>     The following dependencies couldn't be met:
>       - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0
>     -> extlib < 1.7.0
>       - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0
>     -> extlib-compat < 1.7.0
>       - opam-publish -> opam-lib (= 1.2.0 | = 1.2.2) -> dose < 3.4.0
>     -> ocamlgraph <= 1.8.5
>       - opam-publish -> publish -> opam-publish > 0.3.4 -> opam-lib >
>     1.2.2 -> jsonm -> uutf (<= 0.9.4 | >= 1.0.0)
>       - opam-publish -> publish -> opam-publish > 0.3.4 -> opam-lib >
>     1.2.2 -> cmdliner <= 0.9.8
>       - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) ->
>     cmdliner <= 0.9.8
>       - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) ->
>     dose < 3.4.0 -> ocamlgraph <= 1.8.5
>       - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) ->
>     dose < 3.4.0 -> extlib-compat < 1.7.0
>       - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) ->
>     dose < 3.4.0 -> extlib < 1.7.0
>       - opam-publish -> publish -> opam-lib (= 1.2.2 | > 1.2.2) ->
>     jsonm -> uutf (<= 0.9.4 | >= 1.0.0)
>     Your request can't be satisfied:
>       - cmdliner.0.9.4 is in conflict with uutf.1.0.1
>       - extlib-compat<1.7.0 is not available because your system
>     doesn't comply with ocaml-version < "4.05.0".
>       - extlib<1.7.0 is not available because your system doesn't
>     comply with ocaml-version < "4.05.0".
>       - ocamlgraph.1.8.5 is not available because your system doesn't
>     comply with ocaml-version < "4.06.0".
>       - ocamlgraph<=1.8.5 is not available because your system doesn't
>     comply with ocaml-version < "4.06.0".
>       - uutf<=0.9.4 is not available because your system doesn't
>     comply with ocaml-version >= "4.00.0" & ocaml-version < "4.06.0".
>
>     No solution found, exiting
>
>     =====
>
>     I tried forking the opam-repository repo but there is only
>     metadata about the various packages and not the actual code to
>     make a patch on.  Is there some documentation on how to submit a
>     bug fix to a package? Sorry if this is a dumb question.
>
>     Mike
>
>
>     On 2/22/18 3:58 PM, Michael C Vanier wrote:
>>
>>     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 <mailto: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
>>>         <https://sympa.inria.fr/sympa/arc/caml-list>
>>>         Beginner's list:
>>>         http://groups.yahoo.com/group/ocaml_beginners
>>>         <http://groups.yahoo.com/group/ocaml_beginners>
>>>         Bug reports: http://caml.inria.fr/bin/caml-bugs
>>>         <http://caml.inria.fr/bin/caml-bugs>
>>>
>>>
>>
>
>


[-- Attachment #2: Type: text/html, Size: 15233 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Has anybody gotten delimcc to work?
  2018-02-23  5:15       ` Nicolás Ojeda Bär
  2018-02-23  5:56         ` Michael C Vanier
@ 2018-02-26  5:42         ` Oleg
  1 sibling, 0 replies; 7+ messages in thread
From: Oleg @ 2018-02-26  5:42 UTC (permalink / raw)
  To: nicolas.ojeda.bar; +Cc: mvanier, caml-list


Thank you, Nicolas, for the patch. I have updated 
        http://okmij.org/ftp/continuations/caml-shift.tar.gz

It seems the compatibility.h has been changed with 4.06; hence the
problem. This is just as well, using the caml_ prefixed names is long
overdue (it turns out stacks-native.c was using the new names
already). Incidentally, the change effected by that patch is backward
compatible (as far back as OCaml 4.01, I think).



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-26  5:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 23:18 [Caml-list] Has anybody gotten delimcc to work? Michael C Vanier
2018-02-22 23:42 ` Nicolás Ojeda Bär
2018-02-22 23:58   ` Michael C Vanier
2018-02-23  3:18     ` Michael C Vanier
2018-02-23  5:15       ` Nicolás Ojeda Bär
2018-02-23  5:56         ` Michael C Vanier
2018-02-26  5:42         ` Oleg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).