forked from JuliaComputing/static-julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
program.c
35 lines (27 loc) · 835 Bytes
/
program.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// This file is a part of Julia. License is MIT: http://julialang.org/license
// Standard headers
#include <string.h>
#include <stdint.h>
// Julia headers (for initialization and gc commands)
#include "uv.h"
#include "julia.h"
#ifdef JULIA_DEFINE_FAST_TLS // only available in Julia v0.7 and above
JULIA_DEFINE_FAST_TLS()
#endif
// Declare C prototype of a function defined in Julia
extern void julia_main();
int main(int argc, char *argv[])
{
intptr_t v;
// Initialize Julia
uv_setup_args(argc, argv); // no-op on Windows
libsupport_init();
// JULIAC_PROGRAM_LIBNAME defined on command-line for compilation
jl_options.image_file = JULIAC_PROGRAM_LIBNAME;
julia_init(JL_IMAGE_JULIA_HOME);
// Do some work
julia_main();
// Cleanup and graceful exit
jl_atexit_hook(0);
return 0;
}