Hi,
I have the following questions regarding building Julia from source:
1/ Is there a way to build a “light” version of Julia, for example without the documentation or even the REPL? If yes, how?
2/ Is there an option to add packages like DataFrames or CSV when building Julia to reduce functions compilations? If so how?
(I know I can use PackageCompiler to build sysimage, just want to known if the above is possible)
Isn’t the REPL a standard library? If so, I think you can also filter out standard libraries when creating a custom sysimage. Again, not sure how useful Julia will be without the REPL though.
I know I can do that PackageCompiler, my question is more how to do it when I build Julia from source.
No particular use case, it is just that it takes a lot of time to build Julia and I wanted to know if there is way to reduce that time by removing some part of the build process. Documentation and REPL are just example.
If I understand correctly that would made package like DataFrames and CSV load faster as well as remove the need for re-compilation because the code (functions and objects) would be cached? Is that correct? If so that would solve the issue in my second question, however I am not sure to understand how it would make building Julia from source faster?
Is it like running c or cpp code in terminal basically?
gcc test.cpp
gcc is the compiler for C++.
But you want to run julia file. thus
julia test.jl
Same things to obtain same results, but different languages. Different computation time.
If you want a plot and computation, yes you don’t need REPL indeed, because you just need to make Plots / PyPlot / GLMakie showing the window like gnuplot show the plot of your code in other language. The details need hard work.
Thank you @woclass, And what shoukd I do if I wanted to remove the REPL module from the build process or if I wanted to add a module to the build process?
Thank you @Elrod , so not sure to understand what goes inside that userimg.jl file.
For example let’s say I just created a module called ABC and I want to include it when building Julia from source. Then I should:
include my module ABC.jl in the directory base/
add a file called userimg.jl in that same folder
in the file userimg.jl write the following line of code `include(“ABC.jl”)
then build Julia from source by running make
Is that correct?
If so, what about including package CSV and DataFrames? Should I include them in the same base/ folder? What about their dependencies? Are these automatically taken into account?
I hadn’t tried that before, but sounds like it should work.
This I have done. Simply using CSV, DataFrames works.
You can do more than this, executing a few commands. However, there are a lot of things that won’t work (using OhMyREPL, for example, does not), so I suggest you start minimally.
Installing packages also will not work inside your userimg.jl, therefore they will already have to be installed.
Activating a project does work.
So make sure you have some project in which the packages you wish to use have already been installed for the Julia version you’re building, and then
using Pkg
Pkg.activate("/path/to/that/project")
using CSV, DataFrames, OtherPackage
should work.
If you’re using Julia’s master branch, I definitely suggest you checkout
which was linked by @giordano earlier.
The benefit putting a package in your userimg.jl has is that it almost eliminates using time, which that PR does not.