# CMake build problem

**URL:** <https://www.ruby-forum.com/t/cmake-build-problem/219280>\
**Category:** GNU Radio\
**Created:** [April 26, 2012, 1:32pm UTC](https://www.ruby-forum.com/t/cmake-build-problem/219280 "2012-04-26T13:32:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [April 26, 2012, 1:32pm UTC](https://www.ruby-forum.com/t/cmake-build-problem/219280/1 "2012-04-26T13:32:24Z")

</div>

Hi,

I’m running debian unstable on a AMD64 platform and am running into a  
problem which starts right at the top of the build process for a newly  
checkout gnuradio version from git.

Below is output from running cmake:

[snip]  
– Performing Test HAVE\_WARN\_ALL  
– Performing Test HAVE\_WARN\_ALL - Success  
– Performing Test HAVE\_WARN\_NO\_UNINITIALIZED  
– Performing Test HAVE\_WARN\_NO\_UNINITIALIZED - Success  
– Found PythonLibs:  
optimized;/usr/lib/python3.2/config/libpython3.2.so;debug;/usr/lib/python3.2/config/libpython3.2.so  
(found version “2.7.3rc2”)  
– Found SWIG: /usr/bin/swig2.0 (found version “2.0.4”)  
[snip]

So it found that /usr/bin/python is version 2.7.3rc2, but it decides  
to use version 3.2 to link against. This makes the build process  
rather sad later on! (Lots of link failures)

To get around this I changed in CMakeLists.txt

find\_package(PythonLibs)

to be

find\_package(PythonLibs 2.7.3)

But obviously that’ll only work for people running 2.7.3! (I’ve not  
played with cmake before now, so there might be a simple way to fix  
it)

I’m running cmake version 2.8.7.

However the build process goes further this time, but now breaks with:

[49%] Built target \_runtime\_swig\_doc\_tag  
[49%] Generating doxygen xml for runtime\_swig\_doc docs  
[49%] Generating runtime\_swig\_doc.i  
[49%] Generating doxygen xml for general\_swig\_doc docs  
[49%] Generating general\_swig\_doc.i  
[49%] Generating doxygen xml for gengen\_swig\_doc docs  
[49%] Generating gengen\_swig\_doc.i  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing error with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i.  
giving up.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing error with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i.  
giving up.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing error with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i.  
giving up.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing problem with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
retrying.  
XML parsing error with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i.  
giving up.  
XML parsing error with file  
/home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i.  
giving up.  
Traceback (most recent call last):  
File “/home/matt/gnuradio/docs/doxygen/swig\_doc.py”, line 294, in  
  
make\_swig\_interface\_file(di, swigdocfilename,  
custom\_output=custom\_output)  
File “/home/matt/gnuradio/docs/doxygen/swig\_doc.py”, line 222, in  
make\_swig\_interface\_file  
make\_func = di.get\_member(make\_name(block.name()), DoxyFunction)  
File “/home/matt/gnuradio/docs/doxygen/doxyxml/base.py”, line 157, in  
get\_member  
raise member()  
doxyxml.base.Duplicate  
make[2]: \*\*\* [gnuradio-core/src/lib/swig/gengen\_swig\_doc.i] Error 1  
make[1]: \*\*\*  
[gnuradio-core/src/lib/swig/CMakeFiles/\_gnuradio\_core\_filter.dir/all]  
Error 2  
make: \*\*\* [all] Error 2

Which I don’t know where to start to fix! However I can tell you that  
the file its looking for, /home/…/swig/gengen\_swig\_doc.i doesn’t  
exist, but I don’t know what should have created it.

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 26, 2012, 7:49pm UTC](https://www.ruby-forum.com/t/cmake-build-problem/219280/2 "2012-04-26T19:49:43Z")

</div>

On Thu, Apr 26, 2012 at 7:30 AM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> – Performing Test HAVE\_WARN\_ALL
> 
> it)
> 
> I’m running cmake version 2.8.7.

Yes, GNU Radio does not work with Python 3, yet. We will have to make  
sure it checks that the Python version is less than 3.

> XML parsing problem with file  
> /home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
> retrying.  
> XML parsing problem with file  
> /home/matt/gnuradio/20120426/gnuradio-core/src/lib/swig/gengen\_swig\_doc.i,  
> retrying.  
> File “/home/matt/gnuradio/docs/doxygen/swig\_doc.py”, line 294, in
> 
> Which I don’t know where to start to fix! However I can tell you that  
> the file its looking for, /home/…/swig/gengen\_swig\_doc.i doesn’t  
> exist, but I don’t know what should have created it.
> 
> Thanks,
> 
> Matt

I’m assuming you are running a parallel make? Try just running “make”  
with no options and see if that works. This looks like a bug that  
we’ve had for a while that only shows up on occasion and when running  
large parallel makes. It generally goes away when you run make again.  
We thought we had squashed this one, but it seems to becoming more of  
a problem again.

In the future, you can try something like “make -j8 -k”. That will  
finish everything it can, even if there are errors with the doc  
generation. You can then run “make” after that to capture the rest of  
it.

Tom

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 26, 2012, 8:51pm UTC](https://www.ruby-forum.com/t/cmake-build-problem/219280/3 "2012-04-26T20:51:11Z")

</div>

Tom R. writes:

> On Thu, Apr 26, 2012 at 7:30 AM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hi,
> > 
> > I’m running debian unstable on a AMD64 platform and am running into  
> > a  
> > problem which starts right at the top of the build process for a  
> > newly  
> > checkout gnuradio version from git.
> > 
> > Below is output from running cmake:
> > 
> > [snip]  
> > – Performing Test HAVE\_WARN\_ALL  
> > – Performing Test HAVE\_WARN\_ALL - Success  
> > – Performing Test HAVE\_WARN\_NO\_UNINITIALIZED  
> > – Performing Test HAVE\_WARN\_NO\_UNINITIALIZED - Success  
> > – Found PythonLibs:  
> > optimized;/usr/lib/python3.2/config/libpython3.2.so;debug;/usr/lib/python3.2/config/libpython3.2.so  
> > (found version “2.7.3rc2”)  
> > – Found SWIG: /usr/bin/swig2.0 (found version “2.0.4”)  
> > [snip]
> > 
> > So it found that /usr/bin/python is version 2.7.3rc2, but it  
> > decides  
> > to use version 3.2 to link against. This makes the build process  
> > rather sad later on! (Lots of link failures)
> > 
> > To get around this I changed in CMakeLists.txt
> > 
> > find\_package(PythonLibs)
> > 
> > to be
> > 
> > find\_package(PythonLibs 2.7.3)
> > 
> > But obviously that’ll only work for people running 2.7.3! (I’ve not  
> > played with cmake before now, so there might be a simple way to fix  
> > it)
> > 
> > I’m running cmake version 2.8.7.
> 
> Yes, GNU Radio does not work with Python 3, yet. We will have to make  
> sure it checks that the Python version is less than 3.

Getting it to try and link with the default version of python on the  
system would also be good.

> > However the build process goes further this time, but now breaks  
> > with:
> > 
> > [49%] Built target \_runtime\_swig\_doc\_tag  
> > [49%] Generating doxygen xml for runtime\_swig\_doc docs  
> > [49%] Generating runtime\_swig\_doc.i  
> > [49%] Generating doxygen xml for general\_swig\_doc docs  
> > [49%] Generating general\_swig\_doc.i  
> > [49%] Generating doxygen xml for gengen\_swig\_doc docs  
> > [49%] Generating gengen\_swig\_doc.i

[snip]

> > raise member()  
> > doxyxml.base.Duplicate  
> > make[2]: \*\*\* [gnuradio-core/src/lib/swig/gengen\_swig\_doc.i] Error 1  
> > make[1]: \*\*\*  
> > [gnuradio-core/src/lib/swig/CMakeFiles/\_gnuradio\_core\_filter.dir/all]  
> > Error 2  
> > make: \*\*\* [all] Error 2
> > 
> > Which I don’t know where to start to fix! However I can tell you  
> > that  
> > the file its looking for, /home/…/swig/gengen\_swig\_doc.i  
> > doesn’t  
> > exist, but I don’t know what should have created it.
> > 
> > Thanks,
> > 
> > Matt
> 
> I’m assuming you are running a parallel make? Try just running “make”  
> with no options and see if that works. This looks like a bug that  
> we’ve had for a while that only shows up on occasion and when running  
> large parallel makes. It generally goes away when you run make again.  
> We thought we had squashed this one, but it seems to becoming more of  
> a problem again.
> 
> In the future, you can try something like “make -j8 -k”. That will  
> finish everything it can, even if there are errors with the doc  
> generation. You can then run “make” after that to capture the rest of  
> it.
> 
> Tom

Yes, I’d been doing a make -j. Rerunning with just ‘make’ doesn’t  
appear to work - it fell over agaon in the same place. So I created a  
new build directory, ran cmake in the new directory and then make  
(with no -j) and it still fails with the above error for  
gengen\_swig\_doc.i

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 26, 2012, 9:24pm UTC](https://www.ruby-forum.com/t/cmake-build-problem/219280/4 "2012-04-26T21:24:02Z")

</div>

Can you try setting the PYTHON\_\* variables to the desired setting?

Here is a screenshot of said variables: [http://i.imgur.com/kr99Q.jpg](http://i.imgur.com/kr99Q.jpg)

-josh

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 26, 2012, 9:48pm UTC](https://www.ruby-forum.com/t/cmake-build-problem/219280/5 "2012-04-26T21:48:46Z")

</div>

If I set the CMakeList.txt back to how it used to be and in a new  
directory re-run cmake, then I get:

py\_exe /usr/bin/python  
py\_inc /usr/include/python2.7  
py\_lib /usr/lib/python3.2/config/libpython3.2.so

(Which is an interesting mix!)

If I now change the py\_lib variable to be  
/u/l/python2.7/c/libpython2.7.so (/usr/bin/python is a sym link to  
python2.7) and re-generate the make files, it  
compiles the same way that my modified CMakelist.txt file (i.e. it  
fails when it gets to gengen\_swig\_doc.i) so it certainly gets around  
the python problem.

Thanks,

Matt

Josh B. writes:

> Can you try setting the PYTHON\_\* variables to the desired setting?
> 
> Here is a screenshot of said variables: [http://i.imgur.com/kr99Q.jpg](http://i.imgur.com/kr99Q.jpg)
> 
> -josh
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 13, 2013, 7:13pm UTC](https://www.ruby-forum.com/t/cmake-build-problem/219280/6 "2013-06-13T19:13:21Z")

</div>

I know that it’s over a year since last post; but I would like to add  
new solution to the python3.2 issue.

As previous post suggested to edit CMakeLists.txt, such solution did not  
work for me.

Instead edit ~/gnuradio/build/CMakeCache.txt

change all references of python3.2 to python2.7 (even if you have  
python 2.7.3 installed)

then run make again. (I did not use -j option)

(for future: as time goes, your version of python (2.7,3.2) might be  
different, thus adjust accordingly)
