Dollarg 2009: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
Jadrian Miles (talk | contribs)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Getting Started with $G =
= Getting Started with $G - January 2009 =


=== Setting Your Account's Environment Variables ===
== Setting Environment Variables for your User Account ==


Edit your ~/.cshrc file and add the lines:
Edit your ~/.environment file and add the lines:


<pre>
<pre>
setenv GROOT /map/gfx0
setenvvar GROOT /map/gfx0
source $GROOT/tools/gfxtools-startup-csh
setenvvar CVSROOT /map/gfx0/cvsroot
</pre>
 
If you use C-shell, edit your .cshrc and add somewhere below the <code>sourcefile $HOME/.environment</code> line:
 
<pre>
sourcefile $GROOT/tools/gfxtools-startup-csh
</pre>
 
If you use Bash, edit your .bashrc and add somewhere below the <code>sourcefile $HOME/.environment</code> line:
 
<pre>
sourcefile $GROOT/tools/gfxtools-startup-bash
</pre>
 
Remember that your environment variables will not be updated immediately; only newly-opened shells will get them, so close your current shell and open a new one.  You can check that everything worked by entering


setenv CVSROOT /map/gfx0/cvsroot
<pre>
echo $G
</pre>
</pre>


=== Checking out a project ===
If you get non-error output, then you're all set.


$G uses CVS for source control and you can read more about it [http://www.nongnu.org/cvs/ here].
== Checking out a project ==


You can work anywhere you choose, but a good location is:
$G uses CVS for source control and you can read more about it [http://www.nongnu.org/cvs/ on its official site] or [[w:Concurrent Versions System|on Wikipedia]].
 
You can work anywhere except under the $G directory.
At Brown ample disk space has been allocated here for students:


<pre>
<pre>
/map/gfx0/users/<your_user_id>
  /map/gfx0/users/$USER
</pre>
</pre>


So, for example, if your user id is "foo" and you wanted to check out the "wrist" project, you should type:
So, for example, if your user id is "goo" and you wanted to check out the "wrist" project, you should type:


<pre>
<pre>
/map/gfx0/users/<your_user_id>
  > mkdir  /map/gfx0/users/goo
cvs co project/wrist
  > cd    /map/gfx0/users/goo
  > cvs co project/wrist        # Creates:  /map/gfx0/users/goo/project/wrist/...
</pre>
</pre>
Please do not waste space and retain only the files you need.
When you are done with your account please be sure to delete it.
== Building a project ==
Type "make all" to build a project.  Continuing the wrist project example from above, you would type:
<pre>
  > cd  /map/gfx0/users/foo/project/wrist
  > make  all
</pre>
By convention simple projects that build a single program or library can be built just by typing "make".
== Creating a "test" for a project ==
Testing is helpful to find bugs, detect problems discovered by system upgrades, and to help make sure projects are working on a daily basis.
Each project should contain a simple smoke test with the target name "test".
It should ensure basic functionality and run reasonably fast.
For example, to run the test for the wrist project you would type:
<pre>
  > cd  /map/gfx0/users/foo/project/wrist
  > make  test
</pre>
Projects can include additional tests.
By convention the make target should be named with a prefix, "test" (e.g. testmore).
[[Category:$G]][[Category:Software Development]][[Category:IT Tools]][[Category:$G HOWTO]]

Latest revision as of 18:24, 9 December 2009

Getting Started with $G - January 2009

Setting Environment Variables for your User Account

Edit your ~/.environment file and add the lines:

setenvvar GROOT /map/gfx0
setenvvar CVSROOT /map/gfx0/cvsroot

If you use C-shell, edit your .cshrc and add somewhere below the sourcefile $HOME/.environment line:

sourcefile $GROOT/tools/gfxtools-startup-csh

If you use Bash, edit your .bashrc and add somewhere below the sourcefile $HOME/.environment line:

sourcefile $GROOT/tools/gfxtools-startup-bash

Remember that your environment variables will not be updated immediately; only newly-opened shells will get them, so close your current shell and open a new one. You can check that everything worked by entering

echo $G

If you get non-error output, then you're all set.

Checking out a project

$G uses CVS for source control and you can read more about it on its official site or on Wikipedia.

You can work anywhere except under the $G directory. At Brown ample disk space has been allocated here for students:

   /map/gfx0/users/$USER

So, for example, if your user id is "goo" and you wanted to check out the "wrist" project, you should type:

   > mkdir  /map/gfx0/users/goo
   > cd     /map/gfx0/users/goo
   > cvs  co  project/wrist        # Creates:  /map/gfx0/users/goo/project/wrist/...

Please do not waste space and retain only the files you need. When you are done with your account please be sure to delete it.

Building a project

Type "make all" to build a project. Continuing the wrist project example from above, you would type:

   > cd  /map/gfx0/users/foo/project/wrist
   > make  all

By convention simple projects that build a single program or library can be built just by typing "make".

Creating a "test" for a project

Testing is helpful to find bugs, detect problems discovered by system upgrades, and to help make sure projects are working on a daily basis.

Each project should contain a simple smoke test with the target name "test". It should ensure basic functionality and run reasonably fast. For example, to run the test for the wrist project you would type:

   > cd  /map/gfx0/users/foo/project/wrist
   > make  test

Projects can include additional tests. By convention the make target should be named with a prefix, "test" (e.g. testmore).