• This repository has been archived on 04/Mar/2019
  • Stars
    star
    146
  • Rank 245,257 (Top 5 %)
  • Language
    Julia
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Static AOT Julia compilation, demos and instructions

NOTE: This repository is mainly for purposes of experimentation and no longer expected to be used going forward. juliac.jl has been merged into PackageCompiler.jl. Please install that package to use juliac.jl.


Static Julia Compiler

Building shared libraries and executables from Julia code.

Run juliac.jl -h for help:

usage: juliac.jl [-v] [-q] [-c] [-J <file>]
                 [--compile {yes|no|all|min}] [-C <target>]
                 [-O {0,1,2,3}] [-g {0,1,2}] [--inline {yes|no}]
                 [--check-bounds {yes|no}] [--math-mode {ieee,fast}]
                 [--depwarn {yes|no|error}] [-a] [-o] [-s] [-e] [-j]
                 [--version] [-h] juliaprog [cprog] [builddir]

Static Julia Compiler

positional arguments:
  juliaprog             Julia program to compile
  cprog                 C program to compile (required only when
                        building an executable; if not provided a
                        minimal standard program is used)
  builddir              build directory, either absolute or relative
                        to the Julia program directory (default:
                        "builddir")

optional arguments:
  -v, --verbose         increase verbosity
  -q, --quiet           suppress non-error messages
  -c, --clean           delete builddir
  -J, --sysimage <file>
                        start up with the given system image file
  --compile {yes|no|all|min}
                        enable or disable JIT compiler, or request
                        exhaustive compilation
  -C, --cpu-target <target>
                        limit usage of CPU features up to <target>
  -O, --optimize {0,1,2,3}
                        set optimization level (type: Int64)
  -g {0,1,2}            set debugging information level (type: Int64)
  --inline {yes|no}     control whether inlining is permitted
  --check-bounds {yes|no}
                        emit bounds checks always or never
  --math-mode {ieee,fast}
                        set floating point optimizations
  --depwarn {yes|no|error}
                        set syntax and method deprecation warnings
  -a, --autodeps        automatically build required dependencies
  -o, --object          build object file
  -s, --shared          build shared library
  -e, --executable      build executable file
  -j, --julialibs       sync Julia libraries to builddir
  --version             show version information and exit
  -h, --help            show this help message and exit

examples:
  juliac.jl -vae hello.jl        # verbose, build executable and deps
  juliac.jl -vae hello.jl prog.c # embed into user defined C program
  juliac.jl -qo hello.jl         # quiet, build object file only
  juliac.jl -vosej hello.jl      # build all and sync Julia libs

Notes

  1. The juliac.jl script uses the ArgParse package, make sure it is installed.

  2. On Windows install Cygwin and the mingw64-x86_64-gcc-core package, see:
    https://github.com/JuliaLang/julia/blob/master/README.windows.md

  3. A shared library containing the system image libhello.so, and a driver binary hello are created in the builddir directory. Running hello produces the following output:

   $ ./hello
   hello, world
   f() = -0.37549581296986956
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   100 โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โข€โ Žโ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โกฐโ โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โฃ โ Šโ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โข€โ ”โ โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โข€โ ”โ โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โก โ Šโ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โก โ Šโ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โก โ Šโ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โข€โ คโ Šโ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โฃ€โ ”โ โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โข€โ คโ Šโ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โฃ€โ คโ ’โ โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โข€โก โ ”โ Šโ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ”‚โ €โ €โ €โ €โ €โ €โข€โฃ€โ คโ ”โ Šโ โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
     0 โ”‚โฃ€โ คโ คโ ”โ ’โ ‰โ โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ €โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       1                                       10

Under the hood

The juliac.jl script uses the --output-o switch to compile the user script into object code, and then builds it into the system image specified by the -J switch. This prepares an object file, which is then linked into a shared library containing the system image and user code. A driver script such as the one in program.c can then be used to build a binary that runs the julia code.

Instead of a driver script, the generated system image can be embedded into a larger program following the embedding examples and relevant sections in the Julia manual. Note that the name of the generated system image ("libhello" for hello.jl) is accessible from C in the preprocessor macro JULIAC_PROGRAM_LIBNAME.

With Julia 0.7, a single large binary can be created, which does not require the driver program to load the shared library. An example of that is in program2.c, where the image file is the binary itself.

For more information on static Julia compilation see:
https://juliacomputing.com/blog/2016/02/09/static-julia.html

For more information on embedding Julia see:
https://github.com/JuliaLang/julia/blob/master/doc/src/manual/embedding.md

More Repositories

1

DataSets.jl

Julia
104
star
2

TableView.jl

A Tables.jl compatible table viewer based on ag-grid
Julia
100
star
3

pluto-vscode

Pluto inside a VS Code Webview, WIP
TypeScript
97
star
4

PlotlyLight.jl

Plotly.js via Julia made easy.
Julia
94
star
5

Miletus.jl

Writing financial contracts in Julia
Julia
81
star
6

XML.jl

Read and write XML in pure Julia
Julia
78
star
7

FemtoCleaner.jl

The code behind femtocleaner
Julia
63
star
8

Kuber.jl

Julia Kubernetes Client
Julia
59
star
9

MultiDocumenter.jl

Aggregating all the docs
Julia
57
star
10

gRPCClient.jl

A Julia gRPC Client
Julia
46
star
11

Cobweb.jl

๐Ÿ•ธ๏ธ Cobble together web content in Julia
Julia
46
star
12

Training

Jupyter Notebook
45
star
13

IRViz.jl

Tools for visualizing Julia IR
Julia
44
star
14

Unums.jl

Unum arithmetic in Julia
Julia
41
star
15

EasyConfig.jl

Easy-to-write JSON-like data structure for Julia
Julia
39
star
16

OReilly

Jupyter Notebook
39
star
17

ModelingToolkitWorkshop

Training materials for ModelingToolkit and JuliaSim
HTML
38
star
18

OpenAPI.jl

OpenAPI helper and code generator for Julia
Julia
38
star
19

Swagger.jl

Swagger (OpenAPI) helper and code generator for Julia
Julia
37
star
20

AMQPClient.jl

A Julia AMQP (Advanced Message Queuing Protocol) / RabbitMQ Client.
Julia
36
star
21

SQLStrings.jl

Safe interpolations for SQL query strings
Julia
32
star
22

HTTPDownloads.jl

Use Downloads.jl as a backend for HTTP.jl
Julia
29
star
23

SQLiteGraph.jl

A lightweight SQLite-based Graph Database for Julia.
Julia
28
star
24

Azure.jl

Julia interface to Azure APIs
Julia
28
star
25

JuliaInXL

JuliaInXL C# code to create JuliaInXL plugin for Microsoft Excel
C#
25
star
26

ODSC2019

Material for "Differentiable programming with Flux" at ODSC East & Europe, 2019
Jupyter Notebook
24
star
27

ScoringEngineDemo.jl

Demo of a scoring engine. From data wrangling to model serving on docker
HTML
22
star
28

Deprecations.jl

A database of julia deprecations and how to fix them
Julia
17
star
29

MosaicPlutoPlugin.jl

A Pluto.jl plugin for embedding Mosaic inside a notebook for interactive schematic analysis
Julia
16
star
30

gdb-solib-wine

GDB enhanced to debug wine processes
C
15
star
31

JuliaHub.jl

A Julia client for the JuliaHub platform
Julia
15
star
32

KML.jl

Write in Google Earth's KML format in pure Julia
Julia
15
star
33

Badges.jl

Badges in Julia
Julia
14
star
34

OmniPackage.jl

Big package depending on a lot of open source repos.
Julia
14
star
35

JuliaInXL.jl

Julia interface to JuliaInXL addin
Julia
13
star
36

Xyce.jl

A Julia wrapper for Xyce.
Julia
12
star
37

nvidia-driver-pcie-rebar

Patches to enable PCIe resizable BARs in the Linux NVIDIA kernel driver
Makefile
12
star
38

SemiringAlgebra.jl

Semiring Algebra
Julia
12
star
39

Humpty.jl

All the kings horses and all the king's men can put our Jacobians together again
Julia
9
star
40

TrueFX

JuliaDB demonstration using TrueFX data
Jupyter Notebook
8
star
41

JuliaSimIssues

Public issue tracker for JuliaSim by JuliaHub
8
star
42

GitLab.jl

Julia
8
star
43

GenieAppTutorial.jl

Tutorial for hosting a Genie app on JuliaHub
JavaScript
8
star
44

ScaledNumbersInput.jl

Provides an `@SI` macro for converting numbers with SI prefixes
Julia
8
star
45

ORNLTraining

Jupyter Notebook
8
star
46

semgrep-rules-julia

Julia rules for semgrep
Julia
8
star
47

JuliaHubVSCodeExtensionTutorial.jl

Tutorial on usage of JuliaHub VSCode extension
Julia
8
star
48

Training.jl

Collection of Training Materials for Julia
Julia
8
star
49

JuliaPharmaDemo

HTML
7
star
50

HPCDC

Notebooks for Intel's HPC DevCon '17
Jupyter Notebook
7
star
51

Daal.jl

Julia wrapper for Intel Data Analytics Acceleration Library (DAAL)
Julia
7
star
52

FixedSizeStrings.jl

a type for efficiently storing short strings of known size
Julia
7
star
53

Gunrock.jl

Julia Wrapper for Gunrock library
Julia
6
star
54

JuliaHub-Feedback

Public repo for filing JuliaHub issues
6
star
55

DepotDelivery.jl

Julia Project โ†’ Standalone Julia Depot
Julia
6
star
56

CentralizedCaches.jl

Making it possible to clear all your caches at once
Julia
6
star
57

QuanserInterface.jl

An Julia interface to the Quanser hardware devices
Julia
5
star
58

SJCE-workshop

Jupyter Notebook
5
star
59

IntroductionTraining

Julia
4
star
60

CxxrtlCosim

Cosimulation of ModelingToolkit and Cxxrtl
Julia
4
star
61

NgSpice.jl

This package wraps NgSpice for Julia users
Julia
4
star
62

JSC-Training

Julia
4
star
63

JuliaRunClient.jl

A client library to invoke JuliaRun HTTP APIs
Julia
4
star
64

StateSelection.jl

Common algorithmic core for state selection in MTK, DAECompiler, JuliaSimCompiler
Julia
4
star
65

HTMLSanitizer.jl

HTML sanitization in Julia
Julia
3
star
66

DynamicScope.jl

Dynamically scoped functions in Julia
Julia
3
star
67

PkgAuthentication.jl

Julia
3
star
68

VectorPrisms.jl

Making structs viewable as AbstractVectors
Julia
3
star
69

rootfs-images

Julia
2
star
70

Heise_October

Supplementary Materials for the Julia article in Heise October 2020 issue
HTML
2
star
71

SecretAnalysis.jl

Julia
2
star
72

DashTutorials

Tutorials for running Dash.jl apps on JuliaHub
Julia
2
star
73

PyData2017

PyData NYC 2017 Tutorial
Jupyter Notebook
2
star
74

JuliaSimTraining

Julia
2
star
75

IngestTest.jl

project to test ingesting
Julia
2
star
76

ScaledNumbersOutput.jl

Pretty printing of numbers that are rounded and in SI notation (eg 3.25n)
Julia
2
star
77

Webinar_PumasQSP_20230321

Julia
2
star
78

InteractiveGeospatial.jl

Julia
2
star
79

PublicNotebooks

Pluto notebooks for demonstrations and public consumption
Julia
1
star
80

OpenPolicyAgent.jl

Julia OpenPolicyAgent Client, Server and CLI.
Julia
1
star
81

JuliaHub101App

Simple Stipple application using the JuliaHub101.jl package
JavaScript
1
star
82

JuliaProIssues

1
star
83

JuliaTeam-GCP-k8s

This repo contains the CLI instructions that could be used to deploy JuliaTeam on GCP
Shell
1
star
84

JuliaHub101.jl

Welcome to JuliaHub 101 - explore features and capabilities of the platform with this package.
Julia
1
star
85

QBO.jl

Work with QuickBooksOnline from Julia
Julia
1
star
86

Finance_demos

Jupyter Notebook
1
star