CISER header image
Cornell University Cornell University CISER

CISER Computing

Q: How do I add a user defined library and *.src file on the CISER Research Computing System?

A: Follow these instructions:  

Step1: Edit gauss.cfg and user.lcg

Step2: Create an environmental variables, GAUSS70_CFG

Step3: (Optional) Test using "example.src"

 

By Jiyoun An, CISER Computing Helpdesk Consultant, 10/18/2006

We appreciate that Stephen D. Younger helped us to know this method.

 

Step1: Edit gauss.cfg and user.lcg

1) Create directories in the followings:

u:\userXX\your netid\mygauss

u:\userXX\your netid\mygauss\lib

u:\userXX\your netid\mygauss\myprocs

For example,

u:\user2\ja256\mygauss

u:\user2\ja256\mygauss\lib

u:\user2\ja256\mygauss\myprocs

 

image of user directory

Then, copy .src file(that you have downloaded or created) in a path,

u:\userXX\your netid\mygauss\myprocs

For example,  let’s say you have created example.src file. 

Then copy the file in u:\user2\ja256\mygauss\myprocs

image2 of user directory

2) Go to Start->All Programs->GAUSS7.0->GAUSS7.0 Directory

image of C:\gauss7.0 directory

3) Copy all files in ~\GAUSS7.0\lib and paste them in a path, u:\userXX\your netid\mygauss\lib

image of copied files to user directory

4) Copy gauss.cfg in ~\GAUSS7.0 and paste the file in a path, u:\userXX\your netid\mygauss

image showing gauss.cfg file

5) Open u:\userXX\your netid\mygauss\gauss.cfg with text editor(ex.textpad or notepad). 

1. src_path line,

type “ ;u:\userXX\your netid\mygauss\myprocs “

2. lib_path line,

replace “ $(GAUSSDIR)\lib “ as “ u:\userXX\your netid\mygauss\lib”

for example,

image of edited pathname

NOTE: You can change other lines in gauss.cfg file for your convenience.  For example, if you change

the save_path as u:\userXX\your netid\mygauss\save then all output files will be saved in that directory.

6) Open u:\userXX\your netid\mygauss\lib\user.lcg with text editor(ex.textpad or notepad)

Then, edit ~\lib\user.lcg to include reference to your new .src file and the procedures in it.

For example, I have example.src file with a roots procedure that generate roots.  Then, I put the

following two lines in user.lcg.

u:\user2\ja256\gauss\myprocs\example.src

   roots:proc

image of user.lcg

 

Step2: Create an environmental variable, GAUSS70_CFG

Important Note: GAUSS70_CFG redirects Gauss to your own directories. But because it is an

environmental variable specific to the computing node you are using, you will need to create GAUSS70_CFG

again when you use other computing nodes.

1) Go to Start->My computer->Right click->Properties

image of locating computer properties

 

2) Left click on Properties->Go to Advanced Tab->Click Environment Variables

image of System Properties window

3) Click New on the Advanced Tab

image of Advance Tab in System Properties window

4) Type

Variable name: GAUSS70_CFG

Variable value: u:\userXX\netid\user defined folder

                         (ex. U:\user2\ja256\mygauss)

image of New User Variable box in System Propeties window

5) Click OK

 

Step3: How to test using example.src

1) Use any text editor to create a file: "example.src" with the following text, and place it in u:\userXX\your netid\mygauss\myprocs

proc (2)=roots(a,b,c);
local w, r1, r2;
w=sqrt(b^2-4*a*c);
r1=(-b+w)/(2*a);
r2=(-b-w)/(2*a);
retp(r1,r2);
endp;

2) Type the following two lines in u:\userXX\your netid\gauss\lib\user.lcg

u:\userXX\your netid\gauss\myprocs\example.src

   roots:proc

image of edited user.lcg

3) Open Gauss.

In Command Input-Output window, type

» library user;

» roots(1,2,3);

Then, you will get

 

      -1.0000000 +        1.4142136i

      -1.0000000 -        1.4142136i

image of gauss command input

 

 

Now, you have successfully added a user defined library and example.src file on a computing node.