|
From: | wjohnson |
Subject: | Re: [Discuss-gnuradio] Linking to an external library in an OOT c++ module? |
Date: | Wed, 26 Jul 2017 21:49:27 -0400 |
Hi Luca, Thanks so much for the reply. My issue turned out to have nothing to do with cmake or loading external libraries, but reviewing your gr-dab module was greatly helpful in that I was able to compare what I was doing against a known working example, so thank you for that. This led me to leave that red herring alone and identify the real problem. It turns out that my issue was instead related to the Python Global Interpreter Lock (GIL). I was able to get matplotlib working by modifying the initialization code for the python interpreter from: Py_Initialize(); .... to: Py_Initialize(); PyGILState_STATE d_gstate; d_gstate = PyGILState_Ensure(); .... perform python work .. PyGILState_Release(d_gstate); .... Presumably, this would be required when calling any python function from within an OOT C++ module. I don't understand the possible risks associated with this solution well enough to feel comfortable using it in production, but as this is only used in a debug environment for me, it seems to work well enough. If anyone is interested in why, see: and and Thanks again. On Wed, 2017-07-26 at 23:34 +0200, Moritz Luca Schmid wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |