SoapySDR icon indicating copy to clipboard operation
SoapySDR copied to clipboard

[low-priority] Swig compile failure

Open xloem opened this issue 3 years ago • 5 comments

after cmake .. on git master today:

[ 94%] Swig compile /home/user/src/SoapySDR/build/python/SoapySDR.i for python
/home/user/src/SoapySDR/build/python/SoapySDR.i:38: Error: Syntax error in input(1).

I tried some old tags. The error is not present for me in 0.7.0, and was introduced before 0.8.0 . I have swig 2.0.10 .

xloem avatar May 16 '21 20:05 xloem

Looks related to the %pythonbegin %{ ... %} section. Perhaps its a swig 3.0 thing. I can add a version check but im not 100% sure thats the reason. Do you have a version of swig3.0 in the package manager to try, for example ubuntu is apt-get install swig3.0

guruofquality avatar May 16 '21 20:05 guruofquality

FYI pythonbegin was added in Version 2.0.11 (15 Sep 2013) http://swig.org/Release/CHANGES

guruofquality avatar May 16 '21 21:05 guruofquality

To be honest, I remember Ubuntu 14.04 already shipping swig 2.0.11, and everything after that shipped swig 3.0 or later at will. Any system that's more antiquated than that is probably not worth porting new software to.

What I did, see, though, is that for some distro upgrades, they left a swig2 binary installed while installing a swig3 – is it possible you're not actually using the SWIG you intend to use?

marcusmueller avatar Jun 08 '21 22:06 marcusmueller

Thanks for so much thought you've both put into this quite minor issue.

https://github.com/pothosware/SoapySDR/blob/4d46096c49071bb18e135036e9383d51ed2cd5fd/python3/CMakeLists.txt#L10

I'm guessing that find_package(SWIG 2.0.11) and also in the python2 subfolder, would prevent it recurring, and clarify the situation instead.

I'm not at the system for now, but I think it had ended up being reasonable to just build swig from source for me.

xloem avatar Jun 08 '21 23:06 xloem

One alternative to the version check would be to add swig ifdefs around the pythonbegin section using SWIG_VERSION http://www.swig.org/Doc4.0/Preprocessor.html

guruofquality avatar Jun 09 '21 14:06 guruofquality

it is humorous that for a year and a half three of us chose to discuss and postpone this rather than simply patching a one line fix. ncorgan figured this out.

xloem avatar Nov 24 '22 02:11 xloem