Where should I put software I compile myself?

Since Sagemath is not in the repos, I want to compile it myself. I’m unsure of where to put custom compiled software, though. The Ubuntu docs tell me to avoid make install because it makes it hard to remove the package later, and to use checkinstall instead.

https://help.ubuntu.com/community/CompilingEasyHowTo
https://help.ubuntu.com/community/CompilingSoftware
https://help.ubuntu.com/community/CheckInstall

The guides for installing Sage, however, tell me that Sage lives in an isolated directory and does not interfere with the rest of the system. They recommend extracting the tarball into a subdirectory of of my home folder, cd into the created directory, and just run make (after making sure I have the required dependencies). They recommend NOT installing as root, and they don’t run make install.

http://doc.sagemath.org/html/en/installation/source.html#step-by-step-installation-procedure

Should I just put Sage in a subdirectory of my home folder like they instruct me too? It won’t be hard to delete it later if I want, since it is all contained in one directory. Is it the better option?

Beyond Sage, where do you prefer to put programs you built from source yourself? Thanks!

I think the home folder would be a good option if you are going to be the only user.
Generally /opt is used for this kind of additional applications too (http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html).

2 Likes

I am the only user on this machine, so I’m definitely going to use $HOME for my build. And it seems to be what the Sage team intended. :slight_smile:
I was under the impression that /usr/local was also used as a place to put programs the user compiled herself (http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html). Why two locations? Is one considered better than the other?

You can choose what fits your needs better. For instance on servers I usually see /opt on a separate device from / to store big applications that consume lots of space or are better isolated.