Using .ji files

995 views
Skip to first unread message

Leonardo

unread,
Dec 12, 2015, 11:35:42 AM12/12/15
to julia-users
Hello,
How can I create .ji files and execute with julia executable?

I've compiled in native code a simple program (with BuildExecutable package), but result is huge! (with all dynamic libraries); it's possible instead produce a .ji file (other than modules with Base.compilcache("<modulename>") ) and execute it?

Many thanks

Leonardo

Tero Frondelius

unread,
Dec 12, 2015, 1:37:29 PM12/12/15
to julia-users

Tero Frondelius

unread,
Dec 12, 2015, 1:55:43 PM12/12/15
to julia-users
Namely:
julia [switches] -- [programfile] [args...]
--output-ji name          Generate a system image data file (.ji)

Leonardo

unread,
Dec 13, 2015, 4:07:55 PM12/13/15
to julia-users
Thanks, but I have still some trouble.

I try to better explain my problems:
  1. .ji file creation: I can create a .ji file for a module with precompilation (e.g. with Base.compilecache()); attempting to create .ji file from a julia source using julia executable with command:
    $JULIA_HOME/bin/julia --output-ji out.ji -- src.jl
    it complains with following message:
    ERROR: could not open file boot.jl
  2. .ji file execution: I don't know how to start a julia program precompiled in .ji

Leonardo

Samuel Gómez

unread,
Feb 27, 2016, 10:28:43 AM2/27/16
to julia-users
I'm afraid there is not still a solution. Isn't it?

I find the same problem :-(

Steven G. Johnson

unread,
Feb 27, 2016, 4:12:00 PM2/27/16
to julia-users


On Sunday, December 13, 2015 at 4:07:55 PM UTC-5, Leonardo wrote:
Thanks, but I have still some trouble.

I try to better explain my problems:
  1. .ji file creation: I can create a .ji file for a module with precompilation (e.g. with Base.compilecache()); attempting to create .ji file from a julia source using julia executable with command:
    $JULIA_HOME/bin/julia --output-ji out.ji -- src.jl
    it complains with following message:
    ERROR: could not open file boot.jl

  1. .ji file execution: I don't know how to start a julia program precompiled in .ji
The undocumented low-level call to load a .ji file is, I believe:

Base._include_from_serialized(open(readbytes, "myfile.ji"))

However, this does not actually execute any code, it just loads the functions and constants and modules defined in that .ji file.   You still need to run some code in a .jl file that actually calls one of these functions.

You have to realize that the .ji file is not really the equivalent of a precompiled executable program.  It is more like a precompiled shared library.
 
Reply all
Reply to author
Forward
0 new messages