Cleaning unnecessary files after building Julia


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…