I manage to build Julia from source.
It seems that the outputs of the build are in a folder called “usr”. In that folder I can see that there are the default folder that comes with a “normal” Julia installation, i.e. bin etc include lib libexec…etc. However the size of that usr folder is quite huge compare to a normal Julia installation folder.
How can I remove all the u necessary files under “usr” which are not necessary for this local built of Julia to work properly?
Thank you @mkitti but it seems that only rebuild the sysimage for julia and other packages. It does not delete all the unnecessary files in the various folder under “usr” and that are not needed for Julia to work.
No not trying to deploy anything. I am just trying to remove all the unnecessary files (which are taking a lot of space) after I have finished building Julia, so that what remains is only the files which are needed to have a properly working version of Julia. That is all
After doing your step 1 and 2, I already have a working version of Julia in the folder “usr”, I just need to get rid of everything that is not needed to run Julia.
The thing is that make install will copy all necessary files to the given location. Afterwards, you can delete your entire build folder (i.e. the cloned julia repo).
Ok thanks, that command seems to rebuild the sysimage and then fails because julia tries to connect to internet…but the machine is not connected to internet… any idea how to finish this offline? Not sure why it needs to connect to internet because the julia version that i have in the folder “usr” is working properly…
So after fiddling around with the build process for some times, here are my findings:
1/ building the doc part does not work at all for me, probably because I am behind a firewall/proxy, so I excluded the relevant instruction in the makefile. If anyone is interested in the error I get, I can copy it here.
2/ once the above issue taken care of, make and make install work fine and I am able to build a portable version of julia with just the necessary files.
3/ I noticed that make is not necessary and that you can skip that step and go straight to make install -j N. That will actually do a fine job, at least on windows!
4/ I don’t know if there are some redundant steps between make and make install . But I did the following and it made the install part so much quicker. I got rid of the line @$(MAKE) $(QUIET_MAKE) $(JULIA_BUILD_MODE) in the Makefile in for the install part. This might explain also why I don’t need to do a make and a make install , and that a make install is enough.
The only outstanding question I have is:
Is it intentional that make and make install both build Julia from scratch, i.e. there are some duplicated steps ? make install also build other things like the documentation and a portable version of Julia which make does not do…
Or maybe I just did not understand at all what is intended …
The make files declare a set of dependencies for various targets. The install target depends on building everything else, so yes this is expected that make install will build everything AND then install it to the destination.