Transpiler GCC version check

lotto

New member
Is GCC 8 strictly needed? Or does it only need any version more recent than 8?
If it's the latter I don't think 11l.py should check if there's GCC 8 installed, especially when current version of GCC (stable) is 10.2

Probably it should check if AT LEAST GCC 8 is installed.

Right now it's doing
Python:
if os.system('g++-8 --version > /dev/null') != 0:
  sys.exit(...)
os.system('g++-8 ...')
I'm not exactly good with GNU utilities so probably there's a better way to do it, but what about:

Python:
if os.system("g++ -dumpversion | awk '{print \"8\\n\"$1}' | sort -V | awk 'NR==1 && $1!=8{exit(1)}'") != 0:
  sys.exit(...)
os.system('g++ ...')
Basically it sorts with -V option the following 2 lines
Code:
8
$actual_gcc_version
and if after the sort the first line becomes $actual_gcc_version then it means that you don't have gcc 8 or later installed.
 

alextretyak

Administrator
Staff member
Probably it should check if AT LEAST GCC 8 is installed.
I agree.
(The current code was written for primary testing only, and it certainly needs to be improved.)

I have Ubuntu 18.04 installed [on Virtual Machine], and despite the fact that I have installed GCC-8, the g++ and gcc refers to the GCC 7.4.0, therefore g++-8 is used instead of g++.

I modified 11l.py, and now:
1. If g++ version is 8 or higher, g++ is used.
2. It tries g++-8, g++-9, g++-10, etc. in a loop, and use the first GCC version found.

[New 11l.py can be downloaded from here.]
 
Last edited:
Top