Skip to content

Instantly share code, notes, and snippets.

@ImreSamu
Created September 8, 2018 10:24
Show Gist options
  • Save ImreSamu/1964b22e49d7950d57c560930e3093e0 to your computer and use it in GitHub Desktop.
Save ImreSamu/1964b22e49d7950d57c560930e3093e0 to your computer and use it in GitHub Desktop.
julia - test.c
#include <julia.h>
JULIA_DEFINE_FAST_TLS() // only define this once, in an executable (not in a shared library) if you want fast code.
int main(int argc, char *argv[])
{
/* required: setup the Julia context */
jl_init();
/* run Julia commands */
jl_eval_string("print(sqrt(2.0))");
/* strongly recommended: notify Julia that the
program is about to terminate. this allows
Julia time to cleanup pending write requests
and run all finalizers
*/
jl_atexit_hook(0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment