* [Caml-list] parmap package broken in opam switch 4.03.0
@ 2016-04-26 14:35 Sébastien Hinderer
2016-04-26 16:21 ` Roberto Di Cosmo
0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Hinderer @ 2016-04-26 14:35 UTC (permalink / raw)
To: caml-list
Hi,
It seems the Setcore module is not correctly included in the parmap
library in opam's 4.03.0 switch:
~$ ocamlobjinfo .opam/4.03.0/lib/parmap/parmap.cmxa | grep -i setcore
7d7337fa605045f3c5ec064376ede776 Setcore
-------------------------------- Setcore
(where the first line corresponds to the Interfaces imported by the
Parmap module and the second line to the Implementations imported by that
same module)
Practically, when one tries to compile a program using parmap, one gets
an error while trying to link parmap.cmxa about the Setcore symbol which
is not found.
Sébastien.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] parmap package broken in opam switch 4.03.0
2016-04-26 14:35 [Caml-list] parmap package broken in opam switch 4.03.0 Sébastien Hinderer
@ 2016-04-26 16:21 ` Roberto Di Cosmo
2016-04-26 17:16 ` Leo White
0 siblings, 1 reply; 5+ messages in thread
From: Roberto Di Cosmo @ 2016-04-26 16:21 UTC (permalink / raw)
To: caml-list
Hi Sebastien,
thanks for reporting this; in principle, it would be better to just open an
issue on https://github.com/rdicosmo/parmap but this seems indeed to be an issue
with 4.03, that may hit other people, so I'm following up here.
The problem is related to setcore.mli, which is just the interface for some C
code, so there is no setcore.ml, hence no setcore.cmx either; compilation of
such cases ran along just fine via ocamlbuild up to 4.02
It seems that in 4.03 one needs to add the -opaque flag when compiling
such stubs, otherwise things go astray, and it seems ocamlbuild does not
detect automatically such situations, so one needs to explicitly pass
the -opaque option when compiling setcore.mli (and only it).
If people on the list can confirm this, we'll then need to adapt parmap's
autoconf / makefile with code that spots whether we are using 4.03+.
If some kind soul wants to lend a hand, it would be much
appreciated... otherwise I'll try to do it in a moment of spare time
all the best
--
Roberto
On Tue, Apr 26, 2016 at 04:35:41PM +0200, Sébastien Hinderer wrote:
> Hi,
>
> It seems the Setcore module is not correctly included in the parmap
> library in opam's 4.03.0 switch:
>
> ~$ ocamlobjinfo .opam/4.03.0/lib/parmap/parmap.cmxa | grep -i setcore
> 7d7337fa605045f3c5ec064376ede776 Setcore
> -------------------------------- Setcore
>
> (where the first line corresponds to the Interfaces imported by the
> Parmap module and the second line to the Implementations imported by that
> same module)
>
> Practically, when one tries to compile a program using parmap, one gets
> an error while trying to link parmap.cmxa about the Setcore symbol which
> is not found.
>
> Sébastien.
>
> --
> 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
--
Roberto Di Cosmo
------------------------------------------------------------------
Professeur (on leave at/detache a INRIA Roquencourt)
IRIF E-mail : roberto@dicosmo.org
Universite Paris Diderot Web : http://www.dicosmo.org
Case 7014 Twitter : http://twitter.com/rdicosmo
5, Rue Thomas Mann
F-75205 Paris Cedex 13 France
------------------------------------------------------------------
Office location:
Paris Diderot INRIA
Bureau 3020 (3rd floor) Bureau C123
Batiment Sophie Germain Batiment C
8 place Aurélie Nemours 2, Rue Simone Iff
Tel: +33 1 57 27 92 20 Tel: +33 1 80 49 44 42
Metro
Bibliotheque F. Mitterrand Ligne 6: Dugommier
ligne 14/RER C Ligne 14/RER A: Gare de Lyon
------------------------------------------------------------------
GPG fingerprint 2931 20CE 3A5A 5390 98EC 8BFC FCCA C3BE 39CB 12D3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] parmap package broken in opam switch 4.03.0
2016-04-26 16:21 ` Roberto Di Cosmo
@ 2016-04-26 17:16 ` Leo White
2016-04-27 9:49 ` Roberto Di Cosmo
0 siblings, 1 reply; 5+ messages in thread
From: Leo White @ 2016-04-26 17:16 UTC (permalink / raw)
To: caml-list
> It seems that in 4.03 one needs to add the -opaque flag when compiling
> such stubs, otherwise things go astray, and it seems ocamlbuild does not
> detect automatically such situations, so one needs to explicitly pass
> the -opaque option when compiling setcore.mli (and only it).
I would not have thought that adding `-opaque` would be sufficient. It should get you
past the compilation of modules which depend on `setcore.mli`, but I would expect
linking to fail still. If that is not the case I guess it should be considered a bug because
in 4.03 referencing an `external` is supposed to force linking of the containing module.
The change was made because the existing behaviour was said to confuse people --
using a normal value from a module caused it to get linked whilst using an external value
didn't.
Regards,
Leo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] parmap package broken in opam switch 4.03.0
2016-04-26 17:16 ` Leo White
@ 2016-04-27 9:49 ` Roberto Di Cosmo
2016-04-27 11:24 ` Sébastien Hinderer
0 siblings, 1 reply; 5+ messages in thread
From: Roberto Di Cosmo @ 2016-04-27 9:49 UTC (permalink / raw)
To: Leo White; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 2972 bytes --]
Indeed, after some more investigation (thanks to Francois Berenger), it
seems that in 4.03 we can no longer just use a bare .mli file with the
interface to some external code, as it was possible before.
Now, we need to provide also an .ml file, in any case.
The fix in parmap is underway, and it was a simple matter of moving
setcore.mli to setcore.ml, without touching anything else.
For the curious, the content of setcore.ml (ex setcore.mli) is the
following:
(* uses the native affinity interface to
declare that the current process should be
attached to core number n *)
external numcores: unit -> int = "numcores"
external setcore: int -> unit = "setcore"
If you have similar patterns in your projects, take due notice :-)
--
Roberto
2016-04-26 19:16 GMT+02:00 Leo White <leo@lpw25.net>:
> > It seems that in 4.03 one needs to add the -opaque flag when compiling
> > such stubs, otherwise things go astray, and it seems ocamlbuild does not
> > detect automatically such situations, so one needs to explicitly pass
> > the -opaque option when compiling setcore.mli (and only it).
>
> I would not have thought that adding `-opaque` would be sufficient. It
> should get you
> past the compilation of modules which depend on `setcore.mli`, but I would
> expect
> linking to fail still. If that is not the case I guess it should be
> considered a bug because
> in 4.03 referencing an `external` is supposed to force linking of the
> containing module.
> The change was made because the existing behaviour was said to confuse
> people --
> using a normal value from a module caused it to get linked whilst using an
> external value
> didn't.
>
> Regards,
>
> Leo
>
> --
> 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
>
--
Roberto Di Cosmo
------------------------------------------------------------------
Professeur (on leave at/detache a INRIA Roquencourt)
IRIF email : roberto@dicosmo.org
Universite Paris Diderot web : http://www.dicosmo.org
Case 7014 Twitter : http://twitter.com/rdicosmo
5, Rue Thomas Mann
F-75205 Paris Cedex 13 FRANCE
------------------------------------------------------------------
Office location:
Paris Diderot INRIA
Bureau 3020 (3rd floor) Bureau C123
Batiment Sophie Germain Batiment C
8 place Aurélie Nemours 2, Rue Simone Iff
Tel: +33 1 57 27 92 20 Tel: +33 1 80 49 44 42
Metro
Bibliotheque F. Mitterrand Ligne 6: Dugommier
ligne 14/RER C Ligne 14/RER A: Gare de Lyon
------------------------------------------------------------------
GPG fingerprint 2931 20CE 3A5A 5390 98EC 8BFC FCCA C3BE 39CB 12D3
[-- Attachment #2: Type: text/html, Size: 4892 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] parmap package broken in opam switch 4.03.0
2016-04-27 9:49 ` Roberto Di Cosmo
@ 2016-04-27 11:24 ` Sébastien Hinderer
0 siblings, 0 replies; 5+ messages in thread
From: Sébastien Hinderer @ 2016-04-27 11:24 UTC (permalink / raw)
To: caml-list
Thanks a lot Roberto and François for your help with all this and for
the clear feedback!
Sébastien.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-04-27 11:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 14:35 [Caml-list] parmap package broken in opam switch 4.03.0 Sébastien Hinderer
2016-04-26 16:21 ` Roberto Di Cosmo
2016-04-26 17:16 ` Leo White
2016-04-27 9:49 ` Roberto Di Cosmo
2016-04-27 11:24 ` Sébastien Hinderer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox