-
Notifications
You must be signed in to change notification settings - Fork 45
Create binary code file
We will introduce how to make binary files. Below tutorial is based on the Julia package PackageCompiler.jl, please install it by
using Pkg
Pkg.add("PackageCompiler")
The sysimage file is the compiled binary file. The package will be loaded automatically when we start julia with its sysimage file.
julia> using PackageCompiler
julia> create_sysimage(["JWAS"]; sysimage_path="JWASsysimage.so")
The JWASsysimage.so file is about 200 Mb. It took a few minutes to create JWASsysimage.so file.
julia is required
assume JWAS is not installed in your computer
> julia -J JWASsysimage.so
You can see Base.loaded_modules
that the complied JWAS has been loaded automatically.
Load the package by using .JWAS
, instead of using JWAS
, because the latter one requires UUID, while the computer does not install JWAS.
julia> using .JWAS
"Use-cases for Julia-apps are for example when one wants to provide some kind of functionality where the fact that the code was written in Julia is just an implementation detail and where requiring the user to download and use Julia to run the code would be a distraction. There is also no need to provide the original Julia source code for apps since everything gets baked into the sysimage."
Assume JWAS is not installed in your julia. Firstly, download JWAS package from GitHub, then we will have a “JWAS.jl” folder.
> git clone https://github.com/reworkhow/JWAS.jl.git
Add a main function, see: https://discourse.julialang.org/t/how-to-use-the-app-generated-by-packagecompiler-jl/76994
julia> using PackageCompiler
julia> create_app("JWAS.jl", "JWASCompiled")
julia> exit()
It took 10 minutes to create this app. Then we will see a folder named "JWASCompied". We can compress the folder by tar -zcvf JWASComplied.tar.gz JWASCompiled
, the size of JWASComplied.tar.gz is 111 MB.
In the JWASCompied folder, there are three sub-folder named "lib", "bin", and "share". In "bin", there are two Unix Executable files: julia
and JWAS
.
Julia is not required
see: https://discourse.julialang.org/t/how-to-use-the-app-generated-by-packagecompiler-jl/76994
Joint Analysis of Continuous, Censored and Categorical Traits
Integrating Phenotypic Causal Networks in GWAS
single trait and multiple trait GBLUP by providing the relationship matrix directly
User-defined Prediction Equation
Description of Mixed Effects Model
Constraint on variance components