Problem Installing -- CLAW = variable

41 views
Skip to first unread message

Eric Johnson

unread,
Oct 10, 2011, 5:42:13 PM10/10/11
to claw-users
Hi there.

I'm working on getting ClawPack running, but I'm running into a
problem within the setenv.py file.

I get the error {below}. I have tried putting the file location in
single and double quotes as well as just as listed.

>
[Xiphactinus@localhost ClawPack]$ cd clawpack-4.6.1
[Xiphactinus@localhost clawpack-4.6.1]$ ls
amrclaw clawpack lib matlab41 python
setenv.bash_Backup sys
apps doc LICENSE.txt myclaw README.txt
setenv.csh util
book geoclaw matlab os setenv.bash setenv.py
[Xiphactinus@localhost clawpack-4.6.1]$ python setenv.py
File "setenv.py", line 22
CLAW = /home/Xiphactinus/ClawPack/clawpack-4.6.1/
^
SyntaxError: invalid syntax
[Xiphactinus@localhost clawpack-4.6.1]$
<

If I put the folder location in single quotes or double quotes I get
the following error;

>
[Xiphactinus@localhost clawpack-4.6.1]$ python setenv.py

------------------------------------------------------------
Full path to claw directory should be:
$CLAW = /home/Xiphactinus/ClawPack/clawpack-4.6.1
------------------------------------------------------------
The files setenv.csh and setenv.bash contain the appropriate
commands to set environment variables for csh or bash shells
and also some aliases you may find convenient
------------------------------------------------------------

[Xiphactinus@localhost clawpack-4.6.1]$
<

What am I doing wrong? I read the manual, etc. Any help will be
*greatly* appreciated!

Thank you!

E

Randall John LeVeque

unread,
Oct 11, 2011, 1:42:23 PM10/11/11
to claw-...@googlegroups.com
I'm not sure. Line 22 of setenv.py should be
CLAW = clawdir

where clawdir is set to a string in the previous line. I've not run
into problems executing this on any machines.

- Randy

> --
> You received this message because you are subscribed to the Google Groups "claw-users" group.
> To post to this group, send email to claw-...@googlegroups.com.
> To unsubscribe from this group, send email to claw-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/claw-users?hl=en.
>
>

Kyle Mandli

unread,
Oct 11, 2011, 5:40:16 PM10/11/11
to claw-...@googlegroups.com
The second output is the one you want, it's just telling you what it
did. You need to source the resulting files (setenv.bash or
setenv.csh) so that all the correct environment variables can be set.

Kyle

Lubna Amir

unread,
Jan 3, 2012, 4:41:38 AM1/3/12
to claw-...@googlegroups.com
Hello,

I am new in python
I tried to set up the claw variable as described in the tutorial.
but when i want to check if everything is correct with the commant printenv claw, the prompt doesn t show me the path.
so i have no idea if my variables are set up correctly.

when i wnated to test some examples for tsunami as mentionned with the quick start modeling tsunami, i also found difficulty with the path to geotools for python.

Any Idea?
Thank You,
Lubna

2011/10/11 Kyle Mandli <kyle....@gmail.com>

Lubna Amir

unread,
Jan 3, 2012, 5:04:16 AM1/3/12
to claw-...@googlegroups.com
Hello again,

I was again reading at the troubleshooting section.
Should we have to set up environmental variables each time we open a shell or can it be done once for all through the initialization of the setenv.py?

Thank you again and Happy new year,
Lubna

2011/10/11 Kyle Mandli <kyle....@gmail.com>
The second output is the one you want, it's just telling you what it

Eric N Johnson

unread,
Jan 3, 2012, 4:17:46 PM1/3/12
to claw-...@googlegroups.com
Lubna,

What people said previously is correct.  The setenv.py file needs to be modified so that:

CLAW = '/home/{system name}/{Clawpack directory}/'

For example, mine says CLAW = '/home/ChuckNorris/ClawPack/claw-4.6.1/'

Every time you run Clawpack, you need to type the following in the terminal window that you are going to use to run the tsunami model {in this case for bash shell}:

$ python setenv.py
$ source setenv.bash

The output you should get from the first line (above) is something like:
"
------------------------------------------------------------
Full path to claw directory should be:
     $CLAW =   /home/ChuckNorris/ClawPack/claw-4.6.1/ 

------------------------------------------------------------
The files setenv.csh and setenv.bash contain the appropriate
commands to set environment variables for csh or bash shells
 and also some aliases you may find convenient
------------------------------------------------------------
"
You will know it's right if you are able to make the topo files etc. for a model. 

Hope that answers your question!

Eric

Eric Johnson

unread,
Jan 3, 2012, 4:12:13 PM1/3/12
to claw-...@googlegroups.com
Lubna,

What people said previously is correct.  The setenv.py file needs to be modified so that:

CLAW = '/home/{system name}/{Clawpack directory}/'

For example, mine says CLAW = '/home/ChuckNorris/ClawPack/claw-4.6.1/'

Every time you run Clawpack, you need to type the following in the terminal window that you are going to use to run the tsunami model {in this case for bash shell}:

$ python setenv.py
$ source setenv.bash

The output you should get from the first line (above) is something like:
"
------------------------------------------------------------
Full path to claw directory should be:
     $CLAW =   /home/ChuckNorris/ClawPack/claw-4.6.1/ 

------------------------------------------------------------
The files setenv.csh and setenv.bash contain the appropriate
commands to set environment variables for csh or bash shells
 and also some aliases you may find convenient
------------------------------------------------------------
"

Matteo Parsani

unread,
Jan 4, 2012, 12:51:30 AM1/4/12
to claw-...@googlegroups.com
Hi Lubna,
I think the best way is to set up once for all the environmental variables by adding them to your initialisation profile script, i.e. in a BASH shell using export and in a CSH/TCSH using setenv.
The environmental variables you have to set in your initialisation script are those listed at http://depts.washington.edu/clawpack/users-4.6/installing.html#setting-environment-variables

In order to do that you can copy and paste the output of setenv.bash or setenv.csh into your initialisation script.

In my case, since I have software that uses environmental variables with the same names and I want to have a complete control of which environmental variables I am setting when I open a new shell I group each block of environmental variables within a "function", e.g.


clawpack4-6-1()
{
    export CLAW='..................'
    export FC='gfortran'
    export PYTHONPATH='......................'
}

I hope this helps.

Best


Matteo

Lubna Amir

unread,
Jan 5, 2012, 5:06:00 AM1/5/12
to claw-...@googlegroups.com
Hi Eric,
Yes, it answers perfectly,
Happy new year.
Lubna

2012/1/3 Eric Johnson <ericnath...@gmail.com>

--

Randall John LeVeque

unread,
Jan 11, 2012, 1:38:51 AM1/11/12
to claw-...@googlegroups.com
Actually running setenv.py should set CLAW properly if you run it from the top Clawpack directory.

You really only need to run this once, and then if you put the resulting commands from setenv.bash into your .bashrc file you don't even have to source these each time you start a new shell.

 - Randy

--
You received this message because you are subscribed to the Google Groups "claw-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/claw-users/-/0tUq0P3hf_MJ.

Matteo Parsani

unread,
Jan 11, 2012, 1:44:18 AM1/11/12
to claw-users
Hi Lubna,
I think the best way is to set up once for all the environmental
variables by adding them to your initialisation profile script, i.e.
in a BASH shell using export and in a CSH/TCSH using setenv.
The environmental variables you have to set in your initialisation
script are those listed at
http://depts.washington.edu/clawpack/users-4.6/installing.html#setting-environment-variables

In order to do that you can copy and paste the output of setenv.bash
or setenv.csh into your initialisation script.

In my case, since I have software that uses environmental variables
with the same names and I want to have a complete control of which
environmental variables I am setting when I open a new shell I group
each block of environmental variables within a "function", e.g.


clawpack4-6-1()
{
export CLAW='..................'
export FC='gfortran'
export PYTHONPATH='......................'
}

I hope this helps.

Best

On Jan 11, 9:38 am, Randall John LeVeque <r...@uw.edu> wrote:
> Actually running setenv.py should set CLAW properly if you run it from the
> top Clawpack directory.
>
> You really only need to run this once, and then if you put the resulting
> commands from setenv.bash into your .bashrc file you don't even have to
> source these each time you start a new shell.
>
>  - Randy
>
> On Tue, Jan 3, 2012 at 1:17 PM, Eric N Johnson
> <ericnathanjohn...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Lubna,
>
> > What people said previously is correct.  The setenv.py file needs to be
> > modified so that:
>
> > CLAW = '/home/{system name}/{Clawpack directory}/'
>
> > For example, mine says CLAW = '/home/ChuckNorris/ClawPack/**claw-4.6.1/'
>
> > Every time you run Clawpack, you need to type the following in the
> > terminal window that you are going to use to run the tsunami model {in this
> > case for bash shell}:
>
> > $ python setenv.py
> > $ source setenv.bash
>
> > The output you should get from the first line (above) is something like:
> > "
> > ------------------------------**------------------------------
> > Full path to claw directory should be:
> >      $CLAW =   /home/ChuckNorris/ClawPack/**claw-4.6.1/
>
> > ------------------------------**------------------------------
> > The files setenv.csh and setenv.bash contain the appropriate
> > commands to set environment variables for csh or bash shells
> >  and also some aliases you may find convenient
> > ------------------------------**------------------------------
Reply all
Reply to author
Forward
0 new messages