Hi Russel,

To initialize the runtime for library Chapel (since you've been asking about that recently :) ), you would want chpl_library_init, which will handle setting up the runtime and the standard modules. It can be found in $CHPL_HOME/runtime/src/chpl-init.c. The comment at the top of the function gives a psuedocode example of its use:

int main(int argc, char* argv) {
chpl_library_init(...)

chpl__init_MODULE_1(LINE, FILENAME)
  ...
chpl__init_MODULE_N(LINE, FILENAME)

call_chapel_function_from_MODULE_1()
  ...
call_chapel_function_from_MODULE_N()

chpl_library_finalize()
}

Thanks,
Lydia

On 09/10/2015 10:56 AM, Russel Winder wrote:
Clearly there is initialization of the Chapel runtime system that has
to happen, and which does normally because it is all set up in the code
run prior to the user code being executed. Is there a single function
that can be called to do this?

D has a similar issue, but for different reasons. With a D entry point
everything is set up for you. Calling D code from C, C++, Python,… you
have to cause the initialization to happen. Part is that each module
has a dynamic initializer, other part is explicit calling the runtime
system initialization function. This all turns out to be very
straightforward.

I am hoping Chapel has a similar capability…



------------------------------------------------------------------------------
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