Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-04-25 03:48:47



Reply to topic  [ 10 posts ] 
Trying to build 1.28.0.0 on Linux doesn't detect gcc version 
Author Message

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
I'm building from source on openSUSE 15.2. 1.28.0.9 built just fine, 1.28.0.10 fails and complains that my gcc was too old (which it isnt):

[ 37s] ===============================================================================
[ 37s] -- The C compiler identification is GNU 7.5.0
[ 37s] -- The CXX compiler identification is GNU 7.5.0

[ 37s] -- Check for working C compiler: /usr/bin/cc
[ 37s] -- Check for working C compiler: /usr/bin/cc - works
[ 37s] -- Detecting C compiler ABI info
[ 37s] -- Detecting C compiler ABI info - done
[ 37s] -- Detecting C compile features
[ 37s] -- Detecting C compile features - done
[ 37s] -- Check for working CXX compiler: /usr/bin/g++
[ 37s] -- Check for working CXX compiler: /usr/bin/g++ - works
[ 37s] -- Detecting CXX compiler ABI info
[ 37s] -- Detecting CXX compiler ABI info - done
[ 37s] -- Detecting CXX compile features
[ 37s] -- Detecting CXX compile features - done
[ 37s] -- GCC version (dots removed): 7
[ 37s]
[ 37s] -- ========================================
[ 37s] -- Version of viewer is 1.28.0.10
[ 37s] -- ========================================
[ 37s] CMake Error at cmake/00-Common.cmake:85 (message):
[ 37s] Cannot compile any more with gcc below version 4.8, sorry...


any ideas?

Cheers
[LC]


2020-10-07 08:46:07
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Grrr... gcc and its silly version numbers... and the sillier "patched" numbers from various Linux distros...

What does 'g++ -dumpversion' report on your system ?
Normally, it should be "7.5.0" (without any leading spacing character) which would translate into "750" for "GCC version (dots removed)".


2020-10-07 09:02:19
Profile WWW

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
Code:
kirika:/root # gcc -dumpversion
7
kirika:/root # g++ -dumpversion
7
kirika:/root # gcc --version
gcc (SUSE Linux) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

kirika:/root # g++ --version
g++ (SUSE Linux) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



...that is crazy.


2020-10-07 09:19:46
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Lance Corrimal wrote:
that is crazy.
Indeed... :cry:


2020-10-07 09:31:09
Profile WWW

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
It appears that somewhere in gcc 6 or newer, a silly compilation option for that compiler was added: --with-gcc-major-version-only

When compiled with that option, -dumpversion only returns the major, and you must instead use the (non-standard and not recognized by gcc 5 and older) -dumpfullversion option to get the full version number !!!

So, for now, the workaround for you (and people in that case, but NOT for people using gcc 5 or older) is to replace "-dumpversion" with "-dumpfullversion" in line 64 of linden/indra/cmake/Variables.cmake...

I'll add more code to work around that brain-dead "feature" in next release...


2020-10-07 09:38:13
Profile WWW

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
i tried to pass -v7.5 to your buildlinux script, that didn't help.

Editing that cmake file sounds like another local patch for me, but that's ok.
I'll file a bugreport against gcc on openSUSE about that. Let's see what happens.


Last edited by Lance Corrimal on 2020-10-07 09:41:30, edited 1 time in total.



2020-10-07 09:38:57
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Lance Corrimal wrote:
i tried to pass -v7.5 to your buildlinux script, that didn't help.
It won't help the least (the issue it at the cmake files level). See the proper fix above.


2020-10-07 09:39:23
Profile WWW

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
yep, filing Variables.cmake did it.

I'll send you a link to the bugreport on the openSUSE bugtracker so you can watch the melee unfold... XD


2020-10-07 09:48:24
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Lance Corrimal wrote:
I'll send you a link to the bugreport on the openSUSE bugtracker so you can watch the melee unfold... XD
I won't loose my time on this. Already implemented a workaround in Variables.cmake. Plus, it's a gcc "feature", so it would have to be solved upstream. FYI, here is the full work-around (with juicy comment (c)2020 Henri Beauchamp):
Code:
   elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
      execute_process(
         COMMAND sh -c "${CMAKE_CXX_COMPILER} -dumpversion"
         OUTPUT_VARIABLE CXX_VERSION
      )
      # Let's actually get a numerical version of GCC's version
      STRING(REGEX REPLACE "([0-9]+)\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION})

      # When compiled with --with-gcc-major-version-only newer gcc versions
      # only report the major number with -dumpversion, and -dumpfullversion
      # (which is not understood by older gcc versions) must be used instead
      # to get the true version !!!  The guy who coded this (instead of
      # simply adding a -dumpmajorversion) should face death penalty for
      # utter (and lethal, natural-selection wise) stupidity !
      if (${CXX_VERSION} LESS 100)
         execute_process(
            COMMAND sh -c "${CMAKE_CXX_COMPILER} -dumpfullversion"
            OUTPUT_VARIABLE CXX_VERSION
         )
         STRING(REGEX REPLACE "([0-9]+)\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION})   
      endif (${CXX_VERSION} LESS 100)
      message(STATUS "GCC version (dots removed): ${CXX_VERSION}")


2020-10-07 09:53:27
Profile WWW

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
for your entertainment:

https://bugzilla.opensuse.org/show_bug.cgi?id=1177420


2020-10-07 10:09:07
Profile YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 145 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:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.