Forum: GNU Radio Ubuntu make error -> Unable to open file gnuradio_swig_py_runtime.py

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fabian U. (Guest)
on 2009-02-03 19:34
(Received via mailing list)
Hello!

I'm testing GNURadio under Ubuntu (8.10), because of problems with
Gentoo ("Tuning problem - usrp_fft.py -> segmentation fault").
The installation of GNURadio works with the package "gnuradio
(3.0.4-2ubuntu2)".
usrp_fft.py -R A -f 1724.4e6
shows me the spectrum.

Now, for building OpenBTS I want to have the current svn release
version, but this does not compile without errors.
Configure seems to be okay, but make fails:

make[5]: Leaving directory `/home/openbts/Desktop/gnuradio/gnuradio-
core/src/lib'
Making all in swig
make[5]: Entering directory `/home/openbts/Desktop/gnuradio/gnuradio-
core/src/lib/swig'
if /usr/bin/swig -c++ -fvirtual -python -modern -keyword -w511 -
outdir  -DOMNITHREAD_POSIX=1 -I/usr/include -I/home/openbts/Desktop/
gnuradio/omnithread -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/
lib/runtime -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/
general -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/general
-I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/gengen -I/home/
openbts/Desktop/gnuradio/gnuradio-core/src/lib/gengen -I/home/openbts/
Desktop/gnuradio/gnuradio-core/src/lib/filter -I/home/openbts/Desktop/
gnuradio/gnuradio-core/src/lib/filter -I/home/openbts/Desktop/gnuradio/
gnuradio-core/src/lib/missing -I/home/openbts/Desktop/gnuradio/
gnuradio-core/src/lib/reed-solomon -I/home/openbts/Desktop/gnuradio/
gnuradio-core/src/lib/viterbi -I/home/openbts/Desktop/gnuradio/
gnuradio-core/src/lib/io -I/home/openbts/Desktop/gnuradio/gnuradio-
core/src/lib/g72x -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/
lib/swig -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/swig
-I/home/openbts/Desktop/gnuradio/gruel/src/include -I/home/openbts/
Desktop/gnuradio/gruel/src/include    -MMD -MF
gnuradio_swig_py_runtime.Td -module gnuradio_swig_py_runtime -o
gnuradio_swig_py_runtime.cc ./gnuradio.i ;\
  then if test linux-gnu = mingw32; \
       then sed 's,\\\\,/,g' <gnuradio_swig_py_runtime.Td
 >gnuradio_swig_py_runtime.d; rm -f gnuradio_swig_py_runtime.Td; \
       else mv -f gnuradio_swig_py_runtime.Td
gnuradio_swig_py_runtime.d; fi \
  else rm -f gnuradio_swig_py_runtime.Td; exit 1; fi
Unable to open file -DOMNITHREAD_POSIX=1/gnuradio_swig_py_runtime.py:
No such file or directory
make[5]: *** [gnuradio_swig_py_runtime.cc] Error 1
make[5]: Leaving directory `/home/openbts/Desktop/gnuradio/gnuradio-
core/src/lib/swig'

What's the problem? I have upgraded to swig version 1.3.38, the other
packages are the normal Ubuntu versions of it.

Thanks & Regards
  -Fabian-
Johnathan C. (Guest)
on 2009-02-03 19:41
(Received via mailing list)
On Tue, Feb 3, 2009 at 11:33 AM, Fabian U. 
<removed_email_address@domain.invalid>
wrote:

> I'm testing GNURadio under Ubuntu (8.10), because of problems with Gentoo
> ("Tuning problem - usrp_fft.py -> segmentation fault").
> The installation of GNURadio works with the package "gnuradio
> (3.0.4-2ubuntu2)".

The version of GNU Radio in the official Ubuntu repositories is quite
old.  We have a packaged version of 3.1.3 on gnuradio.org; follow the
instructions on the UbuntuInstall wiki page to update your software
sources and install.  However, it may also be the case that OpenBTS
only supports the latest trunk version of GNU Radio (I don't recall
immediately), so you're probably best of  either using svn to check
out the latest trunk, or downloading the 3.2rc0 release tarball.

Johnathan
Michael D. (Guest)
on 2009-02-03 19:55
(Received via mailing list)
On Feb 3, 2009, at 12:33 PM, Fabian U. wrote:
> if /usr/bin/swig -c++ -fvirtual -python -modern -keyword -w511 -
> outdir  -DOMNITHREAD_POSIX=1 -I/usr/include -
[snip]
> Unable to open file -DOMNITHREAD_POSIX=1/
> gnuradio_swig_py_runtime.py: No such file or directory
> make[5]: *** [gnuradio_swig_py_runtime.cc] Error 1
> make[5]: Leaving directory `/home/openbts/Desktop/gnuradio/gnuradio-
> core/src/lib/swig'
>
> What's the problem? I have upgraded to swig version 1.3.38, the
> other packages are the normal Ubuntu versions of it.

$(builddir) isn't being set (properly? not at all?) by autotools ...
the SWIG arguments (including "-outdir $(builddir)") are in the top-
level Makefile.common:66 , so if you look in gnuradio-core/src/lib/
swig/Makefile , you should find the line "builddir = ." if autotools
are working.

If you go back to SWIG 1.3.36 (or whatever the OS provides by
default), does compiling work?

If not, try editing Makefile.common and changing that particular $
(builddir) to "." (without the quotes, just the period). - MLD
Fabian U. (Guest)
on 2009-02-03 19:59
(Received via mailing list)
Yes, I test the the old Ubuntu version and this version works fine
(running usrp_fft.py).

Now I have the current svn revision 10378 (the current trunk). This
version fails with error
Unable to open file -DOMNITHREAD_POSIX=1/gnuradio_swig_py_runtime.py:
No such file or directory

And I  do need the latest trunk, because of OpenBTS.

-Fabian-

Am 03.02.2009 um 18:39 schrieb Johnathan C.:
Eric B. (Guest)
on 2009-02-03 20:04
(Received via mailing list)
On Tue, Feb 03, 2009 at 06:58:59PM +0100, Fabian U. wrote:
> Yes, I test the the old Ubuntu version and this version works fine
> (running usrp_fft.py).
>
> Now I have the current svn revision 10378 (the current trunk). This
> version fails with error
> Unable to open file -DOMNITHREAD_POSIX=1/gnuradio_swig_py_runtime.py: No
> such file or directory

Look at the line above.  Something is hosed; there's nothing in front
of /gnuradio_swig_py_runtime.py.  Does the path to the your source or
build directory contain any spaces?  If so rename the path so there are
no
spaces.

Eric
Fabian U. (Guest)
on 2009-02-03 20:19
(Received via mailing list)
Am 03.02.2009 um 18:54 schrieb Michael D.:

>> What's the problem? I have upgraded to swig version 1.3.38, the
>> other packages are the normal Ubuntu versions of it.
>
> $(builddir) isn't being set (properly? not at all?) by autotools ...
> the SWIG arguments (including "-outdir $(builddir)") are in the top-
> level Makefile.common:66 , so if you look in gnuradio-core/src/lib/
> swig/Makefile , you should find the line "builddir = ." if autotools
> are working.
In gnuradio-core/src/lib/swig/Makefile
there is no line
builddir = .
I only found these lines which could be interesting?
# swig flags
# -w511 turns off keyword argument warning
# "-outdir $(builddir)" writes all generated output files to
#   the local builddir (which should always be '.')
SWIG_PYTHON_FLAGS = -fvirtual -python -modern -keyword \
  -w511 -outdir $(builddir)


> If you go back to SWIG 1.3.36 (or whatever the OS provides by
> default), does compiling work?
No, I had 1.3.35 and the same error occurs.

> If not, try editing Makefile.common and changing that particular $
> (builddir) to "." (without the quotes, just the period). - MLD
In gnuradio/Makefile.common there is no line with "builddir"
There is only:
# swig flags
# -w511 turns off keyword argument warning
# "-outdir $(builddir)" writes all generated output files to
#   the local builddir (which should always be '.')
SWIG_PYTHON_FLAGS = -fvirtual -python -modern -keyword \
  -w511 -outdir $(builddir)

Regards -Fabian-
Michael D. (Guest)
on 2009-02-03 20:26
(Received via mailing list)
Hi Fabian -

For some reason, your computer's autotools are not providing $
(builddir) ... do you know what version they are?  Hence why you
couldn't find reference to it in the Makefile, and why the compile
errored out.

> SWIG_PYTHON_FLAGS = -fvirtual -python -modern -keyword \
>   -w511 -outdir $(builddir)

Try changing the above line in Makefile.common to:

SWIG_PYTHON_FLAGS = -fvirtual -python -modern -keyword \
  -w511 -outdir .

Then 'configure' again to rebuild all the Makefiles.  Then compiling
should work. - MLD
Fabian U. (Guest)
on 2009-02-03 20:29
(Received via mailing list)
Yes, there is no space character between "=1" and "/gnuradio_"
No, I don't have any spaces. It is a standard Ubuntu installation (/
home/openbts/Desktop/gnuradio).

Regards -Fabian-

Am 03.02.2009 um 18:58 schrieb Eric B.:
Fabian U. (Guest)
on 2009-02-03 22:32
(Received via mailing list)
Hello!

Thanks for your response.

Am 03.02.2009 um 19:26 schrieb Michael D.:

> Hi Fabian -
>
> For some reason, your computer's autotools are not providing $
> (builddir) ... do you know what version they are?  Hence why you
> couldn't find reference to it in the Makefile, and why the compile
> errored out.
I have  autotools version 20080123.1.


>> SWIG_PYTHON_FLAGS = -fvirtual -python -modern -keyword \
>>   -w511 -outdir $(builddir)
>
> Try changing the above line in Makefile.common to:
>
> SWIG_PYTHON_FLAGS = -fvirtual -python -modern -keyword \
>   -w511 -outdir .
I did the changes, run configure and make. Make returns many warnings,
make check fails, see below.

> Then 'configure' again to rebuild all the Makefiles.  Then compiling
> should work. - MLD


Here are the first warnings:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../../.. -
DOMNITHREAD_POSIX=1 -I/usr/include -I/home/openbts/Desktop/gnuradio/
omnithread -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/
runtime -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/general
-I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/general -I/home/
openbts/Desktop/gnuradio/gnuradio-core/src/lib/gengen -I/home/openbts/
Desktop/gnuradio/gnuradio-core/src/lib/gengen -I/home/openbts/Desktop/
gnuradio/gnuradio-core/src/lib/filter -I/home/openbts/Desktop/gnuradio/
gnuradio-core/src/lib/filter -I/home/openbts/Desktop/gnuradio/gnuradio-
core/src/lib/missing -I/home/openbts/Desktop/gnuradio/gnuradio-core/
src/lib/reed-solomon -I/home/openbts/Desktop/gnuradio/gnuradio-core/
src/lib/viterbi -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/
io -I/home/openbts/Desktop/gnuradio/gnuradio-core/src/lib/g72x -I/home/
openbts/Desktop/gnuradio/gnuradio-core/src/lib/swig -I/home/openbts/
Desktop/gnuradio/gnuradio-core/src/lib/swig -I/home/openbts/Desktop/
gnuradio/gruel/src/include -I/home/openbts/Desktop/gnuradio/gruel/src/
include -I/usr/include/python2.5 -I. -g -O1 -Wno-strict-aliasing -Wno-
parentheses -g -O2 -pthread -pthread -Wall -Woverloaded-virtual -MT
_gnuradio_swig_py_runtime_la-gnuradio_swig_py_runtime.lo -MD -MP -
MF .deps/_gnuradio_swig_py_runtime_la-gnuradio_swig_py_runtime.Tpo -c
gnuradio_swig_py_runtime.cc  -fPIC -DPIC -o .libs/
_gnuradio_swig_py_runtime_la-gnuradio_swig_py_runtime.o
gnuradio_swig_py_runtime.cc: In function ‘PyObject*
_wrap_new_gr_msg_queue_sptr(PyObject*, PyObject*)’:
gnuradio_swig_py_runtime.cc:14009: warning: ‘argv[0]’ may be used
uninitialized in this function
gnuradio_swig_py_runtime.cc: In function ‘PyObject*
_wrap_new_gr_buffer_sptr(PyObject*, PyObject*)’:
gnuradio_swig_py_runtime.cc:6429: warning: ‘argv[0]’ may be used
uninitialized in this function

---

Make check fails with following error:

make[4]: Entering directory `/home/openbts/Desktop/gnuradio/gr-usrp/src'
Traceback (most recent call last):
   File "./qa_usrp.py", line 24, in <module>
     import usrp_swig
   File "/home/openbts/Desktop/gnuradio/gr-usrp/src/usrp_swig.py",
line 72, in <module>
     import gnuradio.gr.gnuradio_swig_py_runtime
ImportError: No module named gnuradio_swig_py_runtime
FAIL: run_tests
===================
1 of 1 tests failed
===================
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/home/openbts/Desktop/gnuradio/gr-usrp/src'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/openbts/Desktop/gnuradio/gr-usrp/src'
make[2]: *** [check] Error 2
make[2]: Leaving directory `/home/openbts/Desktop/gnuradio/gr-usrp/src'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/openbts/Desktop/gnuradio/gr-usrp'
make: *** [check-recursive] Error 1
Michael D. (Guest)
on 2009-02-03 22:45
(Received via mailing list)
Hi Fabian - What's the OS / version / compiler / tools you're working
with for this?  The autotools are new enough they should have
generated $(builddir).  The warnings are fine; could be a stricter GCC.

Since you're working with the trunk, update it before trying anything
further ("svn up").  The error you showed could have come from using
revision 10371; the latest revision (10380) fixes that issue. - MLD
Fabian U. (Guest)
on 2009-02-03 22:58
(Received via mailing list)
Hi Michael,

Am 03.02.2009 um 21:32 schrieb Michael D.:

> Hi Fabian - What's the OS / version / compiler / tools you're
> working with for this?  The autotools are new enough they should
> have generated $(builddir).  The warnings are fine; could be a
> stricter GCC.
Ubuntu 8.10
autotools-dev 20080123.1
gcc 4:4.3.1-ubuntu2
make 3.81-5
automake 1.9.6+nogfdl-3ubuntu1
libtool 2.2.4-0ubuntu4
sdcc-nf 2.8.0-1
guile 1.8.5+1-3ubuntu1
ccache 2.4-15

What tools do you also wanna know?

> Since you're working with the trunk, update it before trying
> anything further ("svn up").  The error you showed could have come
> from using revision 10371; the latest revision (10380) fixes that
> issue. - MLD

I already build it with 10380 when the error in "make check" occurs.

I always do:
make uninstall
make distclean
svn update
./bootstrap
./configure
make
make check
make install

Regards -Fabian-
Michael D. (Guest)
on 2009-02-04 22:38
(Received via mailing list)
Hi Fabian - I just created a fresh VM using Ubuntu 8.10 and followed
the instructions on gnuradio.org for this distro.  I get the gcc
warnings, but otherwise everything works through "make check".  Hence
I'm guessing you have some stale files in your checkout (ones which
distclean does not know about, and aren't being overwritten properly
on make).  My advice now would be to create a fresh checkout of the
trunk, then, from that directory do you usual routine.  Mine is the
somewhat modified "neurotic vpath" build (it's what "make distcheck"
does FAPP):

sh bootstrap
mkdir build
chmod -R a-w .
chmod a+rwx build
cd build
../configure
make
make check
sudo make install

Now, when there's a big update you can do:

cd build
sudo make uninstall
cd ..
rm -rf build
chmod -R a+w .
svn up

and start anew, as guaranteed as possible to not end up with stale
files.  The above works well for me when I use it (which I don't
always remember to).  All built files are in a separate directory from
the source code, and any command trying to write into the source code
directories will fail hence making some issues easier to track down
(this is how I found out that SWIG 1.3.37 had a bug in where it was
writing output files).

Good luck! - MLD
Fabian U. (Guest)
on 2009-02-05 02:00
(Received via mailing list)
Thank you for your help.
I installed Ubuntu 8.10 the way described on the GNURadio website and
it works.
No idea why the last installation didn't work. The only difference
was, that I built it your way (but this should't be the problem).

Anyway, thank you very much. I see spectrums, oscillators, etc.

Regards -Fabian-

Am 04.02.2009 um 04:34 schrieb Michael D.:
muhammad j. (Guest)
on 2011-10-30 07:30
please help me
.
engrawais@ubuntu:~$ grc

(grc:2743): Gtk-WARNING **: Unable to locate theme engine in
module_path: "pixmap",

(grc:2743): Gtk-WARNING **: Unable to locate theme engine in
module_path: "pixmap",

(grc:2743): Gtk-WARNING **: Unable to locate theme engine in
module_path: "pixmap",

(grc:2743): Gtk-WARNING **: Unable to locate theme engine in
module_path: "pixmap",
<<< Welcome to GNU Radio Companion 3.2.2 >>>
Error: 'options'
>>> Failue
Traceback (most recent call last):
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/gui/MainWindow.py", line
174, in new_page
    flow_graph = self._platform.get_new_flow_graph()
  File "/usr/lib/python2.7/dist-packages/gnuradio/grc/base/Platform.py",
line 149, in get_new_flow_graph
    def get_new_flow_graph(self): return self.FlowGraph(self)
  File "<string>", line 4, in __init__
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/base/FlowGraph.py", line
37, in __init__
    self.import_data()
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/base/FlowGraph.py", line
192, in import_data
    self._options_block = self.get_parent().get_new_block(self,
'options')
  File "/usr/lib/python2.7/dist-packages/gnuradio/grc/base/Platform.py",
line 159, in get_new_block
    def get_new_block(self, flow_graph, key): return
self.Block(flow_graph, n=self._blocks_n[key])
  File "/usr/lib/python2.7/dist-packages/gnuradio/grc/base/odict.py",
line 34, in __getitem__
    return self._data[key]
KeyError: 'options'
Error: 'options'
>>> Failue
Traceback (most recent call last):
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/gui/MainWindow.py", line
174, in new_page
    flow_graph = self._platform.get_new_flow_graph()
  File "/usr/lib/python2.7/dist-packages/gnuradio/grc/base/Platform.py",
line 149, in get_new_flow_graph
    def get_new_flow_graph(self): return self.FlowGraph(self)
  File "<string>", line 4, in __init__
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/base/FlowGraph.py", line
37, in __init__
    self.import_data()
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/base/FlowGraph.py", line
192, in import_data
    self._options_block = self.get_parent().get_new_block(self,
'options')
  File "/usr/lib/python2.7/dist-packages/gnuradio/grc/base/Platform.py",
line 159, in get_new_block
    def get_new_block(self, flow_graph, key): return
self.Block(flow_graph, n=self._blocks_n[key])
  File "/usr/lib/python2.7/dist-packages/gnuradio/grc/base/odict.py",
line 34, in __getitem__
    return self._data[key]
KeyError: 'options'
Traceback (most recent call last):
  File "/usr/bin/grc", line 53, in <module>
    ActionHandler(args, Platform())
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/gui/ActionHandler.py",
line 70, in __init__
    self.handle_states(Actions.APPLICATION_INITIALIZE)
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/gui/ActionHandler.py",
line 332, in handle_states
    Actions.get_action_from_name(Actions.ELEMENT_DELETE).set_sensitive(bool(self.get_flow_graph().get_selected_elements()))
  File
"/usr/lib/python2.7/dist-packages/gnuradio/grc/gui/MainWindow.py", line
281, in get_flow_graph
    return self.get_page().get_flow_graph()
AttributeError: 'NoneType' object has no attribute 'get_flow_graph'
This topic is locked and can not be replied to.