Installing software in your home directory: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(partial first draft)
 
(→‎configure; make; make install: clarify sudo, replace HOME with PROJECT)
Line 15: Line 15:
is a very common instruction pattern. Variations include <code>cmake .</code> replacing <code>./configure</code>, and <code>sudo make install</code> replacing <code>make install</code>.
is a very common instruction pattern. Variations include <code>cmake .</code> replacing <code>./configure</code>, and <code>sudo make install</code> replacing <code>make install</code>.


Sometimes this will work exactly as prescribed, but sometimes it will fail at <code>make install</code> or <code>sudo make install</code> because the package expects to be able to write to <code>/usr/local</code> or some other shared area in the file system. The usual solution is to supply a <code>--prefix</code> flag at the <code>configure</code> step, to direct the installation to go to the directory of your choice, ''e.g.:''
Sometimes this will work exactly as prescribed, but sometimes it will fail at <code>make install</code> because the package expects to be able to write to <code>/usr/local</code> or some other shared area in the file system. It will always fail if <code>sudo make install</code> is attempted, because <code>sudo</code> is a request for "root" or administrator privileges. The usual solution is to supply a <code>--prefix</code> flag at the <code>configure</code> step, to direct the installation to go to the directory of your choice, ''e.g.:''
{{Command|./configure --prefix{{=}}$HOME/some-package && make && make install}}
{{Command|./configure --prefix{{=}}$PROJECT/some-package && make && make install}}


If other errors arise, contact [mailto:support@computecanada.ca support]. For more information see [[Make]], [[Autotools]], and [[CMake]].
If other errors arise, contact [mailto:support@computecanada.ca support]. For more information see [[Make]], [[Autotools]], and [[CMake]].

Revision as of 19:49, 24 November 2016


This article is a draft

This is not a complete article: This is a draft, a work in progress that is intended to be published into an article, which may or may not be ready for inclusion in the main wiki. It should not necessarily be considered factual or authoritative.




Much academic software is freely available on the internet. You can email Compute Canada support staff, provide them with a URL, and ask them to install any such package so that you and other users will be able access it via a module load command. If the license terms and technical requirements are met they will make it available, typically in one or two business days.

You are permitted to install software in your own $HOME or $PROJECT directory if you wish. You might choose to do this, for example,

  • if you plan to make your own modifications to the code, or
  • if you wish to evaluate it on a shorter timescale than "one or two business days".

Read the installation instructions that accompany the software. These instructions often fall into one of the classes described below.

configure; make; make install

[name@server ~]$ ./configure
[name@server ~]$ make
[name@server ~]$ make install

is a very common instruction pattern. Variations include cmake . replacing ./configure, and sudo make install replacing make install.

Sometimes this will work exactly as prescribed, but sometimes it will fail at make install because the package expects to be able to write to /usr/local or some other shared area in the file system. It will always fail if sudo make install is attempted, because sudo is a request for "root" or administrator privileges. The usual solution is to supply a --prefix flag at the configure step, to direct the installation to go to the directory of your choice, e.g.:

Question.png
[name@server ~]$ ./configure --prefix=$PROJECT/some-package && make && make install

If other errors arise, contact support. For more information see Make, Autotools, and CMake.