Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-04-19 03:39:34



Reply to topic  [ 3 posts ] 
CMake CXX_VERSION detection 
Author Message

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
Recently I upgraded to Fedora 32, which ships with gcc 10.1.1.
Code:
gcc (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)
I compile my own viewer from the source(s) available, but with this version of gcc, all attempts failed. The problem was during linking for the media plugin, which caused the entire build to bailout with a cryptic failure.

I struggled for a while but then I recalled something about the build on newer gccs needing -D_GLIBCXX_USE_CXX11_ABI=0, and sure enough, looking at the output of my attempts, that option was missing. The option gets added, when appropriate, via the indra/cmake/00-Common.cmake (lines 185-9). Tracking back from that conditional, I discovered that my gcc version was not being calculated/derived correctly.

This lead me to indra/cmake/Variables.cmake (lines 37-52), specifically the REGEX REPLACE. It appears that all gcc versions, to date, have been of single-digit major, minor, and micro versions. With a version of 10.1.1, I believe this gets turned into 011 which is less than 499 required (from the 00-Common.cmake conditional) and the ABI option is not added.

I have temporarily changed my local Variables.cmake (line 55) to be:
Code:
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION})
The addition of the + after each character class of digits allows capturing 1 or more number matches. This small change has allowed me to successfully build the viewer with gcc 10.1.1. This was my simple solution, but another solution might be to limit the character classes with {1,2}, if that syntax is supported.


2020-06-07 01:39:50
Profile

Joined: 2009-03-17 18:42:51
Posts: 5546
Reply with quote
Good catch !

gcc v10 did not yet make its way to my systems, so I could not test building the viewer with it.

Fixed for next releases.


2020-06-07 08:31:22
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
Fixed for next releases.
Thanks Henri. It was 'fun' to track down and I'm glad it was such a simple thing.


2020-06-07 13:39:01
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 49 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.