A new note was posted.

Getting ReL working on the CS machines

I don't know if anyone else had trouble getting ReL working on the CS machines or not but I did. I've put together a quasi-instruction/how-to for those interested in working on CS machines.

First check to see that your JAVA_HOME environment variable is set correctly and pointing to the java JDK:

>> echo $JAVA_HOME
/usr/lib/jvm/java-6-openjdk/

if you you see nothing or something other than this, change it like so:

>> export JAVA_HOME=”/usr/bin/jvm/java-6-openjdk”

Note this will only set the $JAVA_HOME variable for the current session, when you log out and back in, it’s gone and you’ll have to do this again. So it’s also a good idea to set this in your ~/.profile.
To set it in your .profile add a line in the file similar to the one above:

JAVA_HOME=”/usr/bin/jvm/java-6-openjdk”

Also in the .profile file there should be a line that looks like:
export MAIL PS1 EDITOR MAILER JAVACC_HOME

add JAVA_HOME to the end of this line like so:
export MAIL PS1 EDITOR MAILER JAVACC_HOME JAVA_HOME

Save the file, and return to the command prompt and type:
>> source ~/.profile

Now create a directory in your home directory to store a fresh working copy of jython:

>> mkdir newJythonDirectoryOrSomething

cd into your new directory and check out a copy of jython with svn like so:

>> cd ./newJythonDirectoryOrSomething
>> svn checkout https://jython.svn.sourceforge.net/^Cnroot/jython/trunk/jython .

let svn do it’s magic... it will take a few minutes.

Copy the ReL.zip file into the same directory and unzip it like so repsonding 'y' or 'A' to all questions:

>> cp /u/cannata/public_html/cs345/New\ Class\ Notes/Rel.zip .
>> unzip Rel.zip

Use ant to build everything like so:

>> ant
blahblahblahoutput
...

You shouldn't see any compilation errors. If so, it's likely that one or more of your environmental variables are not set correctly.
Check that your new copy of jython is working (it will print out a bunch of stuff the first time you run it)

>> dist/bin/jython
>>> 1+3
4
>>>(lambda x:x)(4)
4
>>>(lambda x:x+2)(4)
6
>>>exit()

Hooray it works! Now run the demo for ReL like so:

>> cat tests/demo.py; dist/bin/jython ast/astview.py tests/demo.py

You should see the following:

MAKECONNECT URL jdbc:oracle:thin:@rising-sun.microlab.cs.utexas.edu:1521:orcl UNAME CS347_RICK PWORD CS347_RICK;
CREATE TABLE NEWTEST (VAL1 NUMBER, VAL2 NUMBER, VAL3 NUMBER);
INSERT INTO NEWTEST (VAL1, VAL2, VAL3) VALUES (1, 2, 3);
INSERT INTO NEWTEST (VAL1, VAL2, VAL3) VALUES (1, 4, 5);
INSERT INTO NEWTEST (VAL1, VAL2, VAL3) VALUES (6, 7, 8);
print (SELECT * FROM NEWTEST;)
print (SELECT VAL2 FROM NEWTEST;)
print (SELECT VAL1, VAL2 FROM NEWTEST WHERE VAL1 = 1;)('Module',
('body',
('Expr (1,0)',
('value', ('Connection (1,0)', ('elts',), ('ctx', ('Load',))))),
('Expr (2,0)', ('value', ('Tuple (2,0)', ('elts',), ('ctx', ('Load',))))),
('Expr (3,0)',
('value',
('Tuple (3,0)',
('elts',
('Num (3,47)', ('n', 1)),
('Num (3,50)', ('n', 2)),
('Num (3,53)', ('n', 3))),
('ctx', ('Load',))))),
('Expr (4,0)',
('value',
('Tuple (4,0)',
('elts',
('Num (4,47)', ('n', 1)),
('Num (4,50)', ('n', 4)),
('Num (4,53)', ('n', 5))),
('ctx', ('Load',))))),
('Expr (5,0)',
('value',
('Tuple (5,0)',
('elts',
('Num (5,47)', ('n', 6)),
('Num (5,50)', ('n', 7)),
('Num (5,53)', ('n', 8))),
('ctx', ('Load',))))),
('Print (6,0)',
('dest', None),
('values', ('Tuple (6,7)', ('elts',), ('ctx', ('Load',)))),
('nl', True)),
('Print (7,0)',
('dest', None),
('values', ('Tuple (7,7)', ('elts',), ('ctx', ('Load',)))),
('nl', True)),
('Print (8,0)',
('dest', None),
('values',
('Tuple (8,7)', ('elts', ('Num (8,51)', ('n', 1))), ('ctx', ('Load',)))),
('nl', True))))

Great! Up, running and ready for homework 4!
I hope this is helpful.

#homework4

Click here to view. Search or link to this question with @56.

Sign up for more classes at http://piazza.com/utexas.

Thanks,
The Piazza Team
--
Contact us at team@piazza.com

You're receiving this email because phil.cannata@oracle.com is enrolled in CS 345 at The University of Texas at Austin. Sign in or un-enroll from this class.
If you already have a Piazza account under another email address, link phil.cannata@oracle.com to that account here.