Yate Community Forum

OpenLTE => YateBTS => Topic started by: spina on October 02, 2018, 05:30:18 PM

Title: Which c++ standard should we compile YateBTS with ?
Post by: spina on October 02, 2018, 05:30:18 PM
As you might already know, YateBTS trunk does not compile with recent versions of GCC, due to a few errors related to iostream manipulations.

These errors are easy to fix in yate-bts source code (see https://forum.yate.ro/index.php?topic=1966.0).

Though, I was confused why they were not an issue for you, I mean upstream. Which version of GCC do you use ? GCC 4.x, right ?

AFAIK, without otherwise specified:
By default, g++ is equivalent to g++ -std=gnu++14 since GCC 6, and g++ -std=gnu++98 for older releases.

And actually, if I set -std=gnu++98 in the appropriate Makefile, yate-bts compiles just fine.
My concern is that -std=gnu++98 and -std=gnu++14 may be somewhat different languages, and hence, depending on the C++ features and the GNU extensions the yate-bts source code actually use, and combine, building as -std=gnu++98 or -std=gnu++14 may not generate semantically identical object code.
Which makes me think that setting -std=gnu++98 might be a more consistent fix than (just) patching MSInfo.cpp and Sgsn.cpp to remove the compilation errors. Can someone confirm this ?

IMHO, if it's somewhat important to build the source code as 1998 ISO C++ with GNU extensions, it might be a good idea to enforce this through the Makefiles: -std=gnu++14 is the default for Ubuntu since Artful 17.10 (and thus for Bionic 18.04 LTS), for Debian since stretch, and obviously for Arch, which sum to a huge Linux users base. BTW, none of these users would be able to build YateBTS out of the box.   

The same question may also apply to C code (should we enforce -std=gnu99 or something else ?).
And may be also when building yate (server) itself: it compiles fine, but should we also enforce standards there ?

Thanks in advance for your answers.


Kind regards,
Title: Re: Which c++ standard should we compile YateBTS with ?
Post by: el_dorado on October 28, 2018, 10:45:15 AM
A very interesting finding! Does it work stable for you after you changed the standard, instead of patches?
Title: Re: Which c++ standard should we compile YateBTS with ?
Post by: goodboytower on November 19, 2018, 05:21:54 PM
Will this patch function with Yate 5,x? I'm working with the BladeRF and was told there are specific versions of Yate, YBTS and BladeRF firmware/FPGA that "play well" together, do you know what versions of BladeRF are compatible with Yate 6.x?