Re-use pre-existing code or programs: Difference between revisions
mNo edit summary |
took out "> " quotes so you can copy and paste commands more easily |
||
| Line 6: | Line 6: | ||
<pre> | <pre> | ||
mkdir $GROOT/users/$USER/install_linux/ | |||
</pre> | </pre> | ||
| Line 12: | Line 12: | ||
<pre> | <pre> | ||
cd $GROOT/users/$USER | |||
cvs co common/include common/gg common/mri | |||
</pre> | </pre> | ||
| Line 19: | Line 19: | ||
<pre> | <pre> | ||
cd $GROOT/users/$USER/common/include/nag/ | |||
make install | |||
</pre> | </pre> | ||
| Line 26: | Line 26: | ||
<pre> | <pre> | ||
cd $GROOT/users/$USER/common/gg/ | |||
make allclean | |||
make all | |||
</pre> | </pre> | ||
| Line 34: | Line 34: | ||
<pre> | <pre> | ||
cd $GROOT/users/$USER | |||
cvs co project/brain | |||
cd project/brain/brainapp | |||
make allclean | |||
make all | |||
</pre> | </pre> | ||
Revision as of 15:00, 29 May 2009
After you have set up the $G environment variables you can check out and build existing programs and libraries in your sandbox. Programs and libraries installed in the public $G area (e.g. $G/install_linux/bin/) are conveniently pre-built, but are subject to change. Building and using your own local copy ensures that you will be working with a private stable version.
Do not use the command examples on this page without understanding them. They are only examples and not rote commands. You will have to create variations appropriate to your own circumstances.
Before you can install private copies you need to create a directory for installed files. The installation directory is named install_$GARCH; where $GARCH is the platform name (e.g. install_linux or install_WIN32). By default the installation directory is at the top of your sandbox; which can be your home directory or in the $G user area. Advanced users can designate any location by setting the $GTO variable.
mkdir $GROOT/users/$USER/install_linux/
Utilities and libraries used by multiple projects are stored under the common/ directory. It is small enough that you can check out the whole thing or just the sub-directories you will be using. The following example checks out common include files (for the Nag libraries) and the gg and mri libraries and utilities.
cd $GROOT/users/$USER cvs co common/include common/gg common/mri
Now you can start to install software. Dependent software must be built before building components that use it. Many programs depend on the Nag headers so that can be installed first. The common/include/ directory contains just headers and has nothing to build.
cd $GROOT/users/$USER/common/include/nag/ make install
Other directories will need to be built before they are installed. The build process for a particular project is determined by the project developers and may vary. This is because there are many combinations of compilers, platforms, and versions that can potentially be built. Generally though make all will build useful combinations and make allclean will clear out generated intermediate files.
cd $GROOT/users/$USER/common/gg/ make allclean make all
After building and installing common code you can do likewise for projects. Project code tends to be larger so you should only checkout the projects you will be working with.
cd $GROOT/users/$USER cvs co project/brain cd project/brain/brainapp make allclean make all