Perhaps I shouldn't add to the uncertainty, but I wanted
to note that:

0) I don't think this feature has been used or exercised
    much, so I always worry about how much weight it
    can support at present.

That said, my impression is that you should be able to:

1) declare some of your symbols as 'export' as Michael
    suggests

2) compile with the --library flag to get a library rather
    than an exeutable.

The above seems to work for me and generate a .a
file.  I then thought that:

3) using the --dynamic flag would generate a .so
    library

but instead I got ld errors.  So, like Michael, I'm hoping
Lydia might have more information about how the Python
interoperability makes use of this (because I think it does).

Best wishes,
-Brad

________________________________________
From: Michael Ferguson [[email protected]]
Sent: Thursday, September 10, 2015 7:18 AM
To: Russel Winder; Chapel_Users
Subject: Re: shared objects / dynamic link libraries

Hi -

It's possible to mark function to be callable from C
using the 'export' keyword (similar in use to 'extern').
You can use that to call back in to Chapel from C code.

I'm less clear on whether or not you can actually create

a shared library with the Chapel compiler. The Python integration
might have some capabilities along these lines, but I'm not so
familiar with it. Perhaps Lydia (cc'd) can fill us in on
that part?

In any case, if all the Chapel code to be dynamically
linked together is compiled to a single shared object,
and then loaded from a C program (e.g.), there aren't
any significant technical barriers. I think it would
be mostly a matter of modifying the Makefiles that run
to generate the final binary and not including main().
There are challenges though if you want to dynamically load
2 different Chapel libraries and have them interoperate.
(I'm not saying such a thing could never work - just that
 it will require some effort to achieve).

Let me know if you'd like to try modifying the Makefiles
and I can offer some pointers.

Best,

-michael

On 9/10/15, 6:26 AM, "Russel Winder" <[email protected]> wrote:

>Maybe I should already know the answerĊ  maybe this is a question I
>should have asked long agoĊ 
>
>Is there a way of creating a shared object / dynamic link library with
>C linkage exports from Chapel code?
>
>Clearly Chapel can use C linkage libraries, but the reverse is much
>more interesting.
>
>--
>Russel.
>==========================================================================
>===
>Dr Russel Winder      t: +44 20 7585 2200   voip:
>sip:[email protected]
>41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
>London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to