# Howto example error

**URL:** <https://www.ruby-forum.com/t/howto-example-error/229945>\
**Category:** GNU Radio\
**Created:** [May 22, 2014, 11:27pm UTC](https://www.ruby-forum.com/t/howto-example-error/229945 "2014-05-22T23:27:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [May 22, 2014, 11:27pm UTC](https://www.ruby-forum.com/t/howto-example-error/229945/1 "2014-05-22T23:27:39Z")

</div>

Hi,

I’m playing with the howto example as shown by the following link on a  
Macbook Pro machine.

[http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules](http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules)

I can go until $make. When I run $make test, an error pops up and shows

$ make test  
Running tests…  
Test project /Users/pzhang/tmp/gr-howto/build  
Start 1: test\_howto  
1/2 Test #1: test\_howto … Passed 0.02 sec  
Start 2: qa\_square\_ff  
2/2 Test #2: qa\_square\_ff …\*\*\*Failed 0.55 sec

50% tests passed, 1 tests failed out of 2

Total Test time (real) = 0.59 sec

The following tests FAILED:  
2 - qa\_square\_ff (Failed)  
Errors while running CTest  
make: \*\*\* [test] Error 8

I tried $ctest -V, the error message shows

$ ctest -V  
UpdateCTestConfiguration from  
:/Users/pzhang/tmp/gr-howto/build/DartConfiguration.tcl  
UpdateCTestConfiguration from  
:/Users/pzhang/tmp/gr-howto/build/DartConfiguration.tcl  
Test project /Users/pzhang/tmp/gr-howto/build  
Constructing a list of tests  
Done constructing a list of tests  
Checking test dependency graph…  
Checking test dependency graph end  
test 1  
Start 1: test\_howto

1: Test command: /bin/sh  
“/Users/pzhang/tmp/gr-howto/build/lib/test\_howto\_test.sh”  
1: Test timeout computed to be: 9.99988e+06  
1:  
1:  
1/2 Test #1: test\_howto … Passed 0.02 sec  
test 2  
Start 2: qa\_square\_ff

2: Test command: /bin/sh  
“/Users/pzhang/tmp/gr-howto/build/python/qa\_square\_ff\_test.sh”  
2: Test timeout computed to be: 9.99988e+06  
2: Fatal Python error: PyThreadState\_Get: no current thread  
2: /Users/pzhang/tmp/gr-howto/build/python/qa\_square\_ff\_test.sh: line 7:  
36036 Abort trap: 6  
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2  
/Users/pzhang/tmp/gr-howto/python/qa\_square\_ff.py  
2/2 Test #2: qa\_square\_ff …\*\*\*Failed 0.52 sec

50% tests passed, 1 tests failed out of 2

Total Test time (real) = 0.56 sec

The following tests FAILED:  
2 - qa\_square\_ff (Failed)  
Errors while running CTest

It seems that the following command does not execute correctly.

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2  
/Users/pzhang/tmp/gr-howto/python/qa\_square\_ff.py

Therefore I enter this command in the terminal and an error shows

$/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2  
/Users/pzhang/tmp/gr-howto/python/qa\_square\_ff.py  
Traceback (most recent call last):  
File “/Users/pzhang/tmp/gr-howto/python/qa\_square\_ff.py”, line 24, in  
  
import howto\_swig as howto  
ImportError: No module named howto\_swig

I suppose howto\_swig should be added to the python path by gr\_modtool.  
Any  
idea how could I get over this problem? Thanks.

Pengyu

---

<div class="post-metadata">

**Author:** ![Pengyu\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e79b87/32.png) [@Pengyu\_Z](https://www.ruby-forum.com/u/Pengyu_Z)\
**Post date:** [May 23, 2014, 12:08am UTC](https://www.ruby-forum.com/t/howto-example-error/229945/2 "2014-05-23T00:08:52Z")

</div>

On Thu, May 22, 2014 at 2:25 PM, Pengyu Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Any idea how could I get over this problem?

Looking through my howto files, I have that import line commented out  
but  
then again I was playing around with python only things.

---

<div class="post-metadata">

**Author:** ![Pengyu\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e79b87/32.png) [@Pengyu\_Z](https://www.ruby-forum.com/u/Pengyu_Z)\
**Post date:** [May 23, 2014, 3:27am UTC](https://www.ruby-forum.com/t/howto-example-error/229945/3 "2014-05-23T03:27:20Z")

</div>

Hi Pengyu - The way testing works right now under OSX (assuming you’re  
using OSX and MacPorts, yes?), you have to specify -all- of the  
dependency paths correctly before calling GR\_ADD\_TEST. The “test\_howto”  
is probably a C++ compiled executable, which CMake will know how to link  
correctly because of dependencies already specified; it does not  
currently call GR\_ADD\_TEST. But “qa\_square\_ff” is probably a Python  
script, which means that the PYTHONPATH and DYLD\_LIBRARY\_PATH must be  
set in a shell script in order to find the correct files (python script  
and the just built swig-ified library).

Inside your “gr-howto/build” directory, if you do  
{{{  
find . -name “\*.sh”  
}}}  
it should list at least 1 script. If you look through those found,  
you’ll figure out which one is called for “qa\_square\_ff”  
(“gr-howto/build/python/qa\_square\_ff\_test.sh”). You’ll see PYTHONPATH  
and DYLD\_LIBRARY\_PATH being set to something, but probably not quite  
what you want.

What you do to correct this is, just before the call to GR\_ADD\_TEST in  
gr-howto/python/CMakeLists.txt, you set “GR\_TEST\_LIBRARY\_DIRS” to the  
top-level’s “lib” build directory, and GR\_TEST\_PYTHON\_DIRS to the  
top-level’s “python/howto” directory. When you re-run cmake, find the  
shell script and the correct PYTHONPATH and DYLD\_LIBRARY\_PATH should now  
be set. With these paths correct, “make test” should now function.

I hope this helps. Feel free to ping me off-list and I’ll work you  
through this in greater detail. - MLD

ps\> I’m currently working on fixing this issue to work with much greater  
robustness than the current model … but it’s just a “work in progress”  
branch right now & won’t be integrated until probably mid-summer.
