Cleaning unnecessary files after building Julia

Hi,

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 in advance for your help.

Have you tried make install?

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.

Umm… my usual sequence is as follows

make clean
make -jN # N is the number kf parallel workers
make install DESTDIR=/path/to/target

make install should copy files to the DESTDIR you set.

Could you explain what you are trying to do? Are you trying to deploy an application or something?

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 :slight_smile:

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.

Any feedback on the above is welcome. Thank you.

When installing julia on computers not on the internet, I’ve done a

$ make full-source-dist

on an internet connected machine. It produces a tarball which can be untared and used to build julia off internet.

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.