Problem using GRC when executing the grc examples

Hello,

I can run some examples like dial_tone.py, audio_fft.py, and others.

But when using GRC to open grc examples, I can not execute the grc
examples
like dial_tone.grc.

Then I try to add the following to .bashrc

export BOOST_PREFIX=/opt/boost_1_37_0
export LD_LIBRARY_PATH=$BOOST_PREFIX/lib

But I can not do that because .bashrc is read only.

Therefore how to solve the problem?

Thank you for your help.
Makmur

This is the error:

Loading: “/usr/share/gnuradio/examples/grc/simple/ber_simulation.grc”

Done

Showing: “/usr/share/gnuradio/examples/grc/simple/ber_simulation.grc”

Generating: “/usr/share/gnuradio/examples/grc/simple/ber_sim.py”
Generate Error: [Errno 13] Permission denied:
‘/usr/share/gnuradio/examples/grc/simple/ber_sim.py’

Failue
Traceback (most recent call last):
File
“/usr/lib/python2.6/dist-packages/gnuradio/grc/gui/ActionHandler.py”,
line 313, in handle_states
generator.write()
File
“/usr/lib/python2.6/dist-packages/gnuradio/grc/python/Generator.py”,
line 61, in write
open(self.get_file_path(), ‘w’).write(str(self))
IOError: [Errno 13] Permission denied:
‘/usr/share/gnuradio/examples/grc/simple/ber_sim.py’

Executing: “/usr/share/gnuradio/examples/grc/simple/ber_sim.py”

python: can’t open file
‘/usr/share/gnuradio/examples/grc/simple/ber_sim.py’: [Errno 2] No such
file
or directory

Makmur H. wrote:

Then I try to add the following to .bashrc

export BOOST_PREFIX=/opt/boost_1_37_0
export LD_LIBRARY_PATH=$BOOST_PREFIX/lib

But I can not do that because .bashrc is read only.

Therefore how to solve the problem?
$chmod +w .bashrc
would make the above file writable. But “.bashrc” shouldn’t really be
r/o, should it? This file should be readable by everyone, and
read/writable for the owner. At least in my experience.

Cheers,
//Mattias

2010/3/3 Mattias K. [email protected]

$chmod +w .bashrc
would make the above file writable. But “.bashrc” shouldn’t really be
r/o, should it? This file should be readable by everyone, and
read/writable for the owner. At least in my experience.

Thanks Mattias,

After I did–> $chmod +w .bashrc
Then there is an error --> chmod: cannot access ‘.bashrc’: No such file
or
directory

Any way, is it correct what I did changing .bashrc for solving the error
when executing the grc examples?

Thank you
Makmur

Makmur H. wrote:

Thanks Mattias,

After I did–> $chmod +w .bashrc
Then there is an error --> chmod: cannot access ‘.bashrc’: No such
file or directory
Have you actually checked that you have a file named ‘.bashrc’? If you
do not, its just to create one.

Something like:
$echo ‘export BOOST_PREFIX=/opt/boost_1_37_0’ > .bashrc
$echo ‘export LD_LIBRARY_PATH=$BOOST_PREFIX/lib’ >> .bashrc

would do the trick i think…

Any way, is it correct what I did changing .bashrc for solving the
error when executing the grc examples?
I don’t really know, since I’m not familiar with GRC…

Cheers!
//Mattias

You need to access .bashrc with super user rights.

Open a terminal, and type the following commands:

cd ~
sudo gedit .bashrc

This will prompt for your password, then open .bashrc in an editable
mode.

A less recommended method of getting around this, would to change the
access
rights to .basrc with the following commands:

cd ~
sudo chmod +w .bashrc

-Michael B.

On Wed, Mar 3, 2010 at 4:05 AM, Makmur H. [email protected]
wrote:

export LD_LIBRARY_PATH=$BOOST_PREFIX/lib
Loading: “/usr/share/gnuradio/examples/grc/simple/ber_simulation.grc”
File

http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

-Michael B.

Makmur,

.bashrc is just a convenient way to set environment variables and
aliases when you open a terminal.

if setting theose environment variables (BOOST_PREFIX and
LD_LIBRARY_PATH) before you run grc from the command line fixes your
problem, then you would want to add them to your .bashrc file.

Your .bashrc should be in your home directory. It should be writable by
you.

-Tom

You need to access .bashrc with super user rights.

Shouldn’t ~/.bashrc be a user- override of the global /etc/bashrc (in
ubuntu /etc/bash.bashrc) ?

For instance if I want to change the promt to something like
“[hh.mm.ss]:username@host >$” instead of the
default one, I’d put those changes in my ~/.bashrc. That was always my
assumption, but I might be wrong.

Sorry for the off- topic, off- list, off- everything remark/question.
//Mattias

Just to clarify, this problem with the examples has nothing to do with
.bashrc. Nevertheless, it is good to understand the .bashrc when working
on a unix system (specifically one with bash).

For your installation, just save the .grc file to a writable directory.

For the future: I just pushed a branch that will generate the python
file in your system’s temp directory should the default directory be
read-only.

-Josh

The error says:

Generating: “/usr/share/gnuradio/examples/grc/simple/ber_sim.py”
Generate Error: [Errno 13] Permission denied:
‘/usr/share/gnuradio/examples/grc/simple/ber_sim.py’

GRC generates the python files in the directory that the .grc file is
found. Since the examples are installed in a root owned part of the file
system /usr/share, you do not have permission to create files there as a
regular user.

Just open the file in grc and do a save-as in into your user home
directory. Then try to run the flow graph.

-Josh

On Wed, Mar 3, 2010 at 10:06, Josh B. [email protected] wrote:

For the future: I just pushed a branch that will generate the python file in
your system’s temp directory should the default directory be read-only.

This has been merged into master.

Johnathan