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
