If you want to use a computational library on a high-performance computing center where you have no root access to install new software you can use header-only template libraries such as MTL4, Eigen3, GMM++ easily by including the library folder in the linking path. How about other libraries such as PetSc, Trilinos, Armadillo, Blaze, GSL,... that require compilation? Is there a way to use them on a machine where you have no root access if they are not preinstalled?
-
$\begingroup$ Have you tried asking the system administrators? If it is a high-performance computing center, they should have nothing against installing a few well-known HPC libraries. $\endgroup$– Federico PoloniMay 21, 2015 at 14:23
-
$\begingroup$ Thanks @FedericoPoloni I know that this is a possibility anyway, but I am trying to be independent of the level of friendliness of system administrators, specifically when one doesn't know where he will be working! $\endgroup$– TarekMay 21, 2015 at 14:36
-
$\begingroup$ The biggest risk with manual installation is the so-called dependency hell: package A depends on packages B, C and D, which you have to install manually too. Package B depends on package E, F, G, and H. And you see where this is going. $\endgroup$– Federico PoloniMay 21, 2015 at 16:41
2 Answers
Almost everything you can build and install in your own space. With GNU autotools, you can do something like ./configure --prefix=/path/to/your/work/space ...
and then follow the usual compilation instructions. Things based on CMake and Scons have similar facilities.
-
1$\begingroup$ Indeed. For CMake-based projects (Trilinos, deal.II), you would pass
-DCMAKE_INSTALL_PREFIX=/path/to/where/you/want/it/installed
. $\endgroup$ May 21, 2015 at 16:08 -
2$\begingroup$ Let me add a minor addendum. Even when I have root access to a computational facility (let it be a HPC cluster, or a small Linux server) I will never (let me repeat never) compile and install scientific software as root. You should use root privileges only when strictly necessary, and this is never the case with scientific software. (Unique exception: low level drivers and firmware for special computing HW, like GPU's, but this is a different story.) $\endgroup$ May 21, 2015 at 18:30
-
$\begingroup$ @StefanoM, I think your position is oversold. All the scientific packages on our systems, including some of the ones that come with the OS, are installed by root. What harm are you contemplating? $\endgroup$ May 21, 2015 at 18:52
-
$\begingroup$ @BillBarth maybe it is more an habit than a real necessity: but my rule of thumb is that I install as root only SW that has been packaged with the OS package manager and undergoes a strict security audit. For everything else I use a group of system users that are the "owners" of all self installed SW. By doing so I can easily tell the origin of each file, and I do not risk mixing up different or incompatible SW pieces. And for sure root priviliges are excessive in UNIX, so I tend to remain on the safe side... $\endgroup$ May 21, 2015 at 20:11
If you want to use Python libraries, you can even use the pip
package manager to install a package for your user account only with this invocation:
pip install --user <package>
Another possibility for Python is using virtualenv
, which allows you to set up isolated Python environments without the need for root access.