Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate julia-compile from julia #15864

Open
StefanKarpinski opened this issue Apr 13, 2016 · 10 comments
Open

separate julia-compile from julia #15864

StefanKarpinski opened this issue Apr 13, 2016 · 10 comments
Labels
compiler:precompilation Precompilation of modules domain:building Build system, or building Julia or its dependencies

Comments

@StefanKarpinski
Copy link
Sponsor Member

At this point it makes sense to separate julia into an interactive julia which runs scripts and starts the REPL and julia-compile which provides various bootstrapping and compilation features. The basic usage of julia-compile should be julia-compile program.jl which should produce an executable called program which, when run behaves the same way that julia program.jl would. In more advanced modes, it can behave like the current julia --compile=all, etc. Let's use this issue to discuss the desired API and how to split up the options.

@StefanKarpinski StefanKarpinski added needs decision A decision on this change is needed domain:building Build system, or building Julia or its dependencies compiler:precompilation Precompilation of modules labels Apr 13, 2016
@StefanKarpinski
Copy link
Sponsor Member Author

StefanKarpinski commented Apr 13, 2016

Straw man separation of flags (now updated).

Common (julia and julia-compile):

 -v, --version             Display version information
 -h, --help                Print this message

 -J, --sysimage <file>     Start up with the given system image file
 --precompiled={yes|no}    Use precompiled code from system image if available
 --compilecache={yes|no}   Enable/disable incremental precompilation of modules
 --handle-signals={yes|no} Enable or disable Julia's default signal handlers

 -C, --cpu-target <target> Limit usage of cpu features up to <target>
 -O, --optimize={0,1,2,3}  Set the optimization level (default 2 if unspecified or 3 if specified as -O)

 --inline={yes|no}         Control whether inlining is permitted (overrides functions declared as @inline)
 --check-bounds={yes|no}   Emit bounds checks always or never (ignoring declarations)
 --math-mode={ieee,fast}   Disallow or enable unsafe floating point optimizations (overrides @fastmath declaration)

 --depwarn={yes|no|error}  Enable or disable syntax and method deprecation warnings ("error" turns warnings into errors)

 --code-coverage={none|user|all}, --code-coverage
                           Count executions of source lines (omitting setting is equivalent to "user")
 --track-allocation={none|user|all}, --track-allocation
                           Count bytes allocated by each source line

Interactive only (julia):

 --startup-file={yes|no}   Load ~/.juliarc.jl
 -f, --no-startup          Don't load ~/.juliarc (deprecated, use --startup-file=no)
 -F                        Load ~/.juliarc (deprecated, use --startup-file=yes)

 -e, --eval <expr>         Evaluate <expr>
 -E, --print <expr>        Evaluate and show <expr>
 -P, --post-boot <expr>    Evaluate <expr>, but don't disable interactive mode (deprecated, use -i -e instead)
 -L, --load <file>         Load <file> immediately on all processors

 -p, --procs {N|auto}      Integer value N launches N additional local worker processes
                           "auto" launches as many workers as the number of local cores
 --machinefile <file>      Run processes on hosts listed in <file>

 -i                        Interactive mode; REPL runs and isinteractive() is true
 -q, --quiet               Quiet startup (no banner)
 --color={yes|no}          Enable or disable color text
 --history-file={yes|no}   Load or save history
 --no-history-file         Don't load history file (deprecated, use --history-file=no)

Compilation only (julia-compile):

 --compile={yes|no|all|min}Enable or disable JIT compiler, or request exhaustive compilation
 --output-o name           Generate an object file (including system image data)
 --output-ji name          Generate a system image data file (.ji)
 --output-bc name          Generate LLVM bitcode (.bc)

 --output-incremental=no   Generate an incremental output file (rather than complete)

@tkelman
Copy link
Contributor

tkelman commented Apr 13, 2016

I think -J is needed for both? handle-signals might be too?

@JeffBezanson
Copy link
Sponsor Member

Yes I think -J is needed for both. However if julia-compile were designed to always "start from zero" then it would actually only be needed by julia. I don't know whether that's a good idea or not.

--track-allocation and --code-coverage are probably also needed by both, for building instrumented binaries.

@StefanKarpinski
Copy link
Sponsor Member Author

After some more input, we can post another version with options moved around to where they should be.

@StefanKarpinski
Copy link
Sponsor Member Author

Updated to reflect feedback.

@sfchen
Copy link

sfchen commented Apr 24, 2016

Will julia-comiple be able to make a stand-alone executable binary, which can run even without julia installed?

@StefanKarpinski StefanKarpinski removed the needs decision A decision on this change is needed label Sep 13, 2016
@Tetralux
Copy link
Contributor

Tetralux commented Feb 13, 2017

Is there any progress or further thoughts on this? Presumably still pending?

I'd also like to note that when Julia has the ability to produce executables, it should probably also be able to produce dynamic libraries; Go has an issue with this as there would be multiple GC instances - in Go's case, they would all attempt to use the same storage area, and trample over each other, last I looked.
I'd like to draw attention to this so that it can be designed for better.
Ideally, the DLL would essentially defer its memory management to the parent process in some way so that you don't end up with several GC instances; one for each Julia DLL a program loads!
Even if it wouldn't hurt CPU time that much [to have multiple GC instances], it would presumably be simpler to design if there was only one--and reason about. Especially, in more real-time applications where every sub-millisecond matters. >)

@ablekh
Copy link

ablekh commented Sep 6, 2020

@StefanKarpinski Just ran across this issue. Good idea, in general. But why a separate command? I would suggest keeping julia command a single interaction point for a better developer UX. Meaning that julia and julia XYZ.jl commands would start relevant interactive Julia sessions (empty and with module XYZ loaded), whereas julia -c [rest of the arguments as suggested above] would launch a Julia compilation process with corresponding arguments via a separate Julia compiler executable. Thoughts?

@OliverEvans96
Copy link

I'm curious whether this is still being actively considered. Would this be basically be a CLI for PackageCompiler? @lucatrv's comment here makes it appear that julia-compile would not fully overlap with PackageCompiler.

@ViralBShah
Copy link
Member

This could potentially be called juliac. A first step for juliac would be to be a CLI wrapper around PackageCompiler that makes it convenient to use in Makefiles and such. It can install PackageCompiler.jl, while itself being a part of the Julia distribution. That way, we don't have to move PackageCompiler into Julia Base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules domain:building Build system, or building Julia or its dependencies
Projects
None yet
Development

No branches or pull requests

8 participants