Re-use pre-existing code or programs: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
took out "> " quotes so you can copy and paste commands more easily
mNo edit summary
Line 23: Line 23:
</pre>
</pre>


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 <code>make all</code> will build useful combinations and <code>make allclean</code> will clear out generated intermediate files.
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.  By convention <code>make all</code> will build generally useful combinations and <code>make allclean</code> will clear out generated intermediate files.


<pre>
<pre>

Revision as of 15:02, 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. By convention make all will build generally 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