Created
September 8, 2018 10:24
-
-
Save ImreSamu/1964b22e49d7950d57c560930e3093e0 to your computer and use it in GitHub Desktop.
julia - test.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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