Forum: GNU Radio problem building gr-howto-write-a-block-cmake

Posted by Achilleas Anastasopoulos (Guest)
on 2012-02-16 17:50
(Received via mailing list)
OK, I am having a problem building the howto module with CMake.

Here is the output of all the steps:


[anastas@jefe build]$ cmake ../
-- The CXX compiler identification is GNU
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Build type not specified: defaulting to release.
-- Boost version: 1.46.0
-- checking for module 'gruel'
--   found gruel, version 3.5.2git
-- Found GRUEL: /usr/local/lib64/libgruel.so
-- checking for module 'gnuradio-core'
--   found gnuradio-core, version 3.5.2git
-- Found GNURADIO_CORE: /usr/local/lib64/libgnuradio-core.so
-- Boost version: 1.46.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Found SWIG: /usr/bin/swig (found version "2.0.4")
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES)
-- Found PythonInterp: /usr/bin/python2.7
-- Found Doxygen: /usr/bin/doxygen
-- Configuring done
-- Generating done
-- Build files have been written to:
/n/harrisville/x/anastas/gnuradio_trunk/gr-howto-write-a-block-cmake/build


Then



[anastas@jefe build]$ make
[ 12%] Building CXX object
lib/CMakeFiles/gnuradio-howto.dir/howto_square_ff.cc.o
[ 25%] Building CXX object
lib/CMakeFiles/gnuradio-howto.dir/howto_square2_ff.cc.o
[ 37%] Building CXX object
lib/CMakeFiles/gnuradio-howto.dir/howto_demod_filterbank_ccvc.cc.o
Linking CXX shared library libgnuradio-howto.so
[ 37%] Built target gnuradio-howto
[ 50%] Building CXX object
lib/CMakeFiles/qa_howto_square2_ff.dir/qa_howto_square2_ff.cc.o
Linking CXX executable qa_howto_square2_ff
[ 50%] Built target qa_howto_square2_ff
[ 62%] Building CXX object
lib/CMakeFiles/qa_howto_square_ff.dir/qa_howto_square_ff.cc.o
Linking CXX executable qa_howto_square_ff
[ 62%] Built target qa_howto_square_ff
[ 62%] Generating __init__.pyc
[ 62%] Generating __init__.pyo
[ 87%] Built target pygen_python_6b399
[ 87%] Shebangin howto_square.py
[100%] Built target pygen_apps_19307


Then


[anastas@jefe build]$ sudo make install
Built target gnuradio-howto
Built target qa_howto_square2_ff
Built target qa_howto_square_ff
Built target pygen_python_6b399
Built target pygen_apps_19307
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/include/howto/howto_api.h
-- Installing: /usr/local/include/howto/howto_square_ff.h
-- Installing: /usr/local/include/howto/howto_square2_ff.h
-- Installing: /usr/local/lib64/libgnuradio-howto.so
-- Removed runtime path from "/usr/local/lib64/libgnuradio-howto.so"
-- Installing: 
/usr/local/lib64/python2.7/site-packages/howto/__init__.py
-- Installing: 
/usr/local/lib64/python2.7/site-packages/howto/__init__.pyc
-- Installing: 
/usr/local/lib64/python2.7/site-packages/howto/__init__.pyo
-- Installing: /usr/local/share/gnuradio/grc/blocks/howto_square_ff.xml
-- Installing: /usr/local/share/gnuradio/grc/blocks/howto_square2_ff.xml
-- Installing: /usr/local/bin/howto_square.py


Now in python I try:

[anastas@jefe build]$ python
Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import howto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib64/python2.7/site-packages/howto/__init__.py",
line 45, in <module>
    from howto_swig import *
ImportError: No module named howto_swig


The module howto_swig is missing....
Any thoughts?

thanks
Achilleas
Posted by Achilleas Anastasopoulos (Guest)
on 2012-02-16 17:58
(Received via mailing list)
BTW, I forgot to say that I am building from the latest master branch
and I have already built/installed the latest gnuradio from
the master branch.

Achilleas

On Thu, Feb 16, 2012 at 11:49 AM, Achilleas Anastasopoulos
Posted by Martin Braun (Guest)
on 2012-02-16 17:59
(Received via mailing list)
On Thu, Feb 16, 2012 at 11:49:10AM -0500, Achilleas Anastasopoulos 
wrote:
> >>> import howto
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/lib64/python2.7/site-packages/howto/__init__.py",
> line 45, in <module>
>     from howto_swig import *
> ImportError: No module named howto_swig
>

Hi Achilleas,

stupid question, but did you try 'sudo ldconfig'?

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association
Posted by Tom Rondeau (Guest)
on 2012-02-16 21:54
(Received via mailing list)
On Thu, Feb 16, 2012 at 11:57 AM, Achilleas Anastasopoulos <
anastas@umich.edu> wrote:

> > Here is the output of all the steps:
> > -- checking for module 'gruel'
> > -- Found PythonInterp: /usr/bin/python2.7
> >
> > [ 50%] Building CXX object
> > [ 87%] Shebangin howto_square.py
> > Built target pygen_python_6b399
> /usr/local/lib64/python2.7/site-packages/howto/__init__.pyc
> > Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16)
> >
> > The module howto_swig is missing....
> > Any thoughts?
> >
> > thanks
> > Achilleas
>

Achilleas,
Something definitely looks off on your installation. Here's what I get 
when
I do a make install:

howto  $ sudo make install
[sudo] password for trondeau:
[ 10%] Built target gnuradio-howto
[ 15%] Built target qa_howto_square2_ff
[ 20%] Built target qa_howto_square_ff
[ 25%] Built target _howto_swig_doc_tag
[ 30%] Built target _howto_swig_swig_tag
[ 55%] Built target _howto_swig
[ 85%] Built target pygen_swig_abbee
[ 95%] Built target pygen_python_8d1a5
[100%] Built target pygen_apps_3fd98
Install the project...
-- Install configuration: "Release"
-- Installing: /opt/gr/include/howto/howto_api.h
-- Installing: /opt/gr/include/howto/howto_square_ff.h
-- Installing: /opt/gr/include/howto/howto_square2_ff.h
-- Installing: /opt/gr/lib/libgnuradio-howto.so
-- Removed runtime path from "/opt/gr/lib/libgnuradio-howto.so"
-- Installing: /opt/gr/lib/python2.6/dist-packages/howto/_howto_swig.so
-- Removed runtime path from
"/opt/gr/lib/python2.6/dist-packages/howto/_howto_swig.so"
-- Installing: /opt/gr/lib/python2.6/dist-packages/howto/howto_swig.py
-- Installing: /opt/gr/lib/python2.6/dist-packages/howto/howto_swig.pyc
-- Installing: /opt/gr/lib/python2.6/dist-packages/howto/howto_swig.pyo
-- Installing: /opt/gr/include/howto/swig/howto_swig.i
-- Installing: /opt/gr/include/howto/swig/howto_swig_doc.i
-- Installing: /opt/gr/lib/python2.6/dist-packages/howto/__init__.py
-- Installing: /opt/gr/lib/python2.6/dist-packages/howto/__init__.pyc
-- Installing: /opt/gr/lib/python2.6/dist-packages/howto/__init__.pyo
-- Installing: /opt/gr/share/gnuradio/grc/blocks/howto_square_ff.xml
-- Installing: /opt/gr/share/gnuradio/grc/blocks/howto_square2_ff.xml
-- Installing: /opt/gr/bin/howto_square.py



Yours never hits the "Built target _howto_swig_doc_tag" or any other
_howto_swig line. It then shows that these are not installing, either.

I just did it on my machine with no problem. Can you just blow away your
build directory and try again?

Thanks,
Tom
Posted by Achilleas Anastasopoulos (Guest)
on 2012-02-16 22:04
(Received via mailing list)
yes i did that and get the same problem (the swig-related files are not 
built).

BTW, how can using git rm the entire directory gr-howto-cmake
and download it from the trunk?

thanks
Achilleas
Posted by Achilleas Anastasopoulos (Guest)
on 2012-02-16 22:28
(Received via mailing list)
I also noticed the following in the cmake ../

-- Found SWIG: /usr/bin/swig (found version "2.0.4")
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES)
-- Found PythonInterp: /usr/bin/python2.7


what is the significance of not founding the PythonLibs?
when i build gnuradio it says that it found them....


-- Configuring python-support support...
--   Dependency PYTHONLIBS_FOUND = TRUE
--   Dependency SWIG_FOUND = TRUE
--   Dependency SWIG_VERSION_CHECK = TRUE
--   Enabling python-support support.
--   Override with -DENABLE_PYTHON=ON/OFF




Achilleas



On Thu, Feb 16, 2012 at 4:03 PM, Achilleas Anastasopoulos
Posted by Achilleas Anastasopoulos (Guest)
on 2012-02-17 01:07
(Received via mailing list)
Tom,

Can you also email me the result of a fresh cmake ../
on the gr-howto-write-a-block-cmake/build
directory (after removing the  CMakeCache.txt file)

thanks
Achilleas

On Thu, Feb 16, 2012 at 4:27 PM, Achilleas Anastasopoulos
Posted by Tom Rondeau (Guest)
on 2012-02-18 21:41
(Received via mailing list)
On Thu, Feb 16, 2012 at 4:27 PM, Achilleas Anastasopoulos 
<anastas@umich.edu
> wrote:

>
> Achilleas
Achilleas,
This is good information. I've gotten various reports on trouble with 
the
use of SWIG 2.0.4 (specifically the .4 version). I didn't think it had
become a default installation, but it seems like it is. I'll 
specifically
take a look at it now, though.

In the meantime, is there a way you can install Swig 1.3.x and use that,
instead? I wonder if that might solve you problem.

Tom



 On Thu, Feb 16, 2012 at 4:03 PM, Achilleas Anastasopoulos
Posted by Josh Blum (Guest)
on 2012-02-18 22:33
(Received via mailing list)
On 02/16/2012 01:27 PM, Achilleas Anastasopoulos wrote:
>
I think the main build system is a little smarter about setting
PYTHON_EXECUTABLE before calling into the pythonlibs module. Try this
little diff for the gr-howto: http://pastebin.com/18ytGnkE

-Josh
Posted by Achilleas Anastasopoulos (Guest)
on 2012-02-19 01:26
(Received via mailing list)
I installed swig 1.3.40 and i have the same problem!!!!!!!!!!!!!!!!!

is there any other way i can check if the required PyhtonLibs
are indeed available in my system?
The fact that gnuradio trunk builds without a problem makes me go 
crazy...

thanks
Achilleas
Posted by Josh Blum (Guest)
on 2012-02-19 01:34
(Received via mailing list)
On 02/18/2012 04:25 PM, Achilleas Anastasopoulos wrote:
> I installed swig 1.3.40 and i have the same problem!!!!!!!!!!!!!!!!!
>
> is there any other way i can check if the required PyhtonLibs
> are indeed available in my system?
> The fact that gnuradio trunk builds without a problem makes me go crazy...
>

Its not a swig problem, swig 2.0.4 is fine. Did you try my patch?
http://pastebin.com/18ytGnkE
Posted by adarsh j. (adarsh_j)
on 2012-11-18 11:15
Hi

I am facing few similar problems and i need help in this regard.
I was able to install HOWTO block in gnuradio properly by closely
following the instructions given on the following page using gr-modtool

"http://gnuradio.org/redmine/projects/gnuradio/wiki...

all test passed successfully and two block (1) square_ff (2) square2_ff
came in gnuradio-companion GUI too and i used them without any problem 
by
importing howto.

But the main thing is that same procedure i followed for
gr_bin_statistics_f too and after installation it came in GRC in some
other block named "howto" (notice small letters) , not in "HOWTO" where
were the square block. But as soon as i drag them to GRC window 
everything
becomes blank in that window.
and also when i try to use this function in spectrum sense python file 
as
howto.gr_bin_statistic_f it gives following error.

stats = howto.gr_bin_statistics_f(self.fft_size, self.msgq,
AttributeError: 'module' object has no attribute 'gr_bin_statistics_f'

Kindly help me to fix this issue.

Thanks

Regards,
adarsh
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.