$G in practice: Difference between revisions
| Line 13: | Line 13: | ||
The CVS repository is accessed by setting the '''CVSROOT'' variable. Once set you will be able to checkout code and make updates to the repository. | The CVS repository is accessed by setting the '''CVSROOT'' variable. Once set you will be able to checkout code and make updates to the repository. | ||
On Linux set '''CVSROOT''' to: <code>/map/gfx0/cvsroot/</code> | On Linux set '''CVSROOT''' to: <code>/map/gfx0/cvsroot/</code> | ||
Revision as of 15:57, 19 April 2010
Development Environment
The graphics group has developed a system over many years that allows easy development of a large, shared base of software. We give the whole thing the nickname $G ("dollar gee"), named after the environment variable that represents the root of the source tree.
There source code our group has created is modified and backed up through a source control system called CVS (Concurrent Versioning System). You must have CVS set up properly in order to develop with our shared codebase.
Source control works by allowing an individual user to make structured copies of the master versions of files (this process is called "checking out" the files). The user then modifies his or her personal copies of the files, and then "checks in" the changes once they're certain that the code compiles and runs properly. The location where a user modifies a personal copy of shared code is called a "sandbox", because it is in some sense walled off from the master copy: destructive changes to the code in the sandbox do not affect the master copy, provided the user doesn't check them in.
Environment variables are used to configure the development environment. Visit this page for general instructions for Setting Environment Variables and using them.
Access to CVS
The CVS repository is accessed by setting the 'CVSROOT variable. Once set you will be able to checkout code and make updates to the repository.
On Linux set CVSROOT to: /map/gfx0/cvsroot/
On Windows set CVSROOT to: Y:\map\gfx0\cvsroot\
Setting up $G
Creating a development sandbox
Your sandbox is the area where you work. It can be any directory, but the area /map/gfx0/users/<Login Id> is set aside for students in the graphics group. Create a directory there to work in or if you'd like also create a subdirectory to work in. To create your own sandbox, do the following (the ">" just indicates the beginning of each command):
> cd /map/gfx0/users > mkdir -p $USER
You can get a private copy of all source code migrated to the new version of $G by executing the following command afterward:
> cd <Sandbox> > cvs co common project
The common directory contains software shared by projects and the project directory contains student applications. There are two other directories of interest. One is the import directory which is where third party software is installed. The other is the install_linux or install_WIN32 directory. This is where software that you build is installed when you perform a "make install".
All of these directories can be arranged to suite your needs. If you are just getting started just create them all at the top level of your sandbox. For now just create the top level directories and populate them later.
> mkdir import > mkdir install_linux
Setting Environment Variables
There are several environment variables to set up. You can set these up in your login scripts along with the setting for CVSROOT.
GARCH: Designate the platform architecture.
GARCH = WIN32 # Use this setting on Windows. GARCH = linux # Use this setting on Linux.
G: This is used to access the G Build system and is set to the location of the common directory. By default it is also used to access the import directory. If your sandbox is at the top of your users' directory then set:
G = /map/gfx0/users/<login>
GROOT: At Brown this variable is used to access these directories:
$GROOT/data # Contains large data sets. $GROOT/users # Work areas for end users.
GROOT = /map/gfx0
GTO: This is the location of the install directories. Usually you will want to keep them at the top of your sandbox then it will be the same as $G.
GTO = $G