# 3.7 SWIG mess up

**URL:** <https://www.ruby-forum.com/t/3-7-swig-mess-up/235121>\
**Category:** GNU Radio\
**Created:** [May 31, 2013, 10:41pm UTC](https://www.ruby-forum.com/t/3-7-swig-mess-up/235121 "2013-05-31T22:41:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [May 31, 2013, 10:41pm UTC](https://www.ruby-forum.com/t/3-7-swig-mess-up/235121/1 "2013-05-31T22:41:45Z")

</div>

Trying to load anything in gnuradio compiled from master just result in  
:

Traceback (most recent call last):  
File “/opt/gnuradio-3.7/bin/gr\_modtool”, line 26, in   
from gnuradio.modtool import \*  
File  
“/opt/gnuradio-3.7/lib64/python2.7/site-packages/gnuradio/modtool/ **init**.py”,  
line 30, in   
from modtool\_newmod import ModToolNewModule  
File  
“/opt/gnuradio-3.7/lib64/python2.7/site-packages/gnuradio/modtool/modtool\_newmod.py”,  
line 27, in   
from gnuradio import gr  
File  
“/opt/gnuradio-3.7/lib64/python2.7/site-packages/gnuradio/gr/ **init**.py”,  
line 31, in   
from runtime\_swig import \*  
File  
“/opt/gnuradio-3.7/lib64/python2.7/site-packages/gnuradio/gr/runtime\_swig.py”,  
line 26, in   
\_runtime\_swig = swig\_import\_helper()  
File  
“/opt/gnuradio-3.7/lib64/python2.7/site-packages/gnuradio/gr/runtime\_swig.py”,  
line 22, in swig\_import\_helper  
\_mod = imp.load\_module(’\_runtime\_swig’, fp, pathname, description)  
ImportError: dynamic module does not define init function  
(init\_runtime\_swig)

I rebuilt it twice, each time starting from scratch and the last time  
without any build parallelism.

Cheers,

Sylvain

---

<div class="post-metadata">

**Author:** ![Sylvain\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Sylvain\_M](https://www.ruby-forum.com/u/Sylvain_M)\
**Post date:** [May 31, 2013, 10:48pm UTC](https://www.ruby-forum.com/t/3-7-swig-mess-up/235121/2 "2013-05-31T22:48:12Z")

</div>

On May 31, 2013, at 13:41, Sylvain M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Trying to load anything in gnuradio compiled from master just result in :
> 
> ImportError: dynamic module does not define init function (init\_runtime\_swig)
> 
> I rebuilt it twice, each time starting from scratch and the last time  
> without any build parallelism.

I have only seen this when using make -jN to build. Once it happens,  
you either need to do a make clean or to start with an entirely new  
build directory to ensure that the swig module in fact gets recompiled  
and reinstalled. (It sounds like you did this but it wasn’t clear.)

We do have some lingering parallel build issues with swig modules.

---

<div class="post-metadata">

**Author:** ![Sylvain\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Sylvain\_M](https://www.ruby-forum.com/u/Sylvain_M)\
**Post date:** [June 1, 2013, 12:58pm UTC](https://www.ruby-forum.com/t/3-7-swig-mess-up/235121/3 "2013-06-01T12:58:18Z")

</div>

Hi,

> It seems that CMake couldn’t decide between the two python version  
> installed (I’m on gentoo and it maintains two // python tree) and  
> decided to use the interpreter of one with the libraries and include  
> path from the other. Apparently CMake is not bothered one bit by the  
> fact “v2.7.3” != “v3.2.3” …
> 
> I have no idea whatsoever how to fix it though …

Just in case someone else faces the issue :

-DPythonLibs\_FIND\_VERSION:STRING=“2.7”  
-DPythonInterp\_FIND\_VERSION:STRING=“2.7”

Cheers,

```
Sylvain

```

---

<div class="post-metadata">

**Author:** ![Sylvain\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Sylvain\_M](https://www.ruby-forum.com/u/Sylvain_M)\
**Post date:** [May 31, 2013, 10:59pm UTC](https://www.ruby-forum.com/t/3-7-swig-mess-up/235121/4 "2013-05-31T22:59:18Z")

</div>

Hi,

> I have only seen this when using make -jN to build. Once it happens,  
> you either need to do a make clean or to start with an entirely new  
> build directory to ensure that the swig module in fact gets recompiled  
> and reinstalled. (It sounds like you did this but it wasn’t clear.)

Yes, as I said, I retried from scratch, new checkout, new builddir, I  
erased everything from previous build.

I traced it to this :

//Details about finding PythonInterp  
FIND\_PACKAGE\_MESSAGE\_DETAILS\_PythonInterp:INTERNAL=[/usr/bin/python][v2.7.3()]  
//Details about finding PythonLibs  
FIND\_PACKAGE\_MESSAGE\_DETAILS\_PythonLibs:INTERNAL=[/usr/lib64/libpython3.2.so][/usr/include/python3.2][v3.2.3()]

It seems that CMake couldn’t decide between the two python version  
installed (I’m on gentoo and it maintains two // python tree) and  
decided to use the interpreter of one with the libraries and include  
path from the other. Apparently CMake is not bothered one bit by the  
fact “v2.7.3” != “v3.2.3” …

I have no idea whatsoever how to fix it though …

Cheers,

```
Sylvain

```
