Howto example error

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

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

On Thu, May 22, 2014 at 2:25 PM, Pengyu Z. [email protected]
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.

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs