Cool VL Viewer forum
http://sldev.free.fr/forum/

Building in Linux with gcc 6.1.1
http://sldev.free.fr/forum/viewtopic.php?f=6&t=1659
Page 1 of 1

Author:  ZaneZimer [ 2016-09-10 16:34:34 ]
Post subject:  Building in Linux with gcc 6.1.1

I have recently upgraded to Fedora 24 (kernel-PAE-4.7.2-201.fc24.i686) which upgraded my gcc as well. While on 22 (my previous platform), I could build successfully.

In the new environment, I need to use the --ignore-warnings (as they are treated as errors) to get the build going. That part is fine as the build script has a provision to ignore them. The build fails about half of the way through with:
Code:
collect2: error: ld returned 1 exit status
The best I can tell this can be attributed to things like:
Code:
undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
I believe Boost was upgrade during this time as well to 1.60, which may or may not be related. Googling has revealed that perhaps the linker cannot locate boost-regex but it is unclear, to me, how in the buildscript setup to specify its location.

Any suggestions on getting this going for my new environment would be much appreciated.

Author:  Henri Beauchamp [ 2016-09-10 17:13:51 ]
Post subject:  Re: Building in Linux with gcc 6.1.1

The answer to your question is given in linden/doc/LinuxBuildHowto.txt:

Quote:
Also, since gcc v5.0 changed its C++ ABI, in order to link (compilation would
be OK) the viewer, you would need to recompile all the pre-built libaries which
rely on C++ (boost libraries, notably, but also jsoncpp and colladadom), using
a v5.0+ g++ compiler...

I.e. gcc v5+ cannot build the viewer unless you rebuild the pre-compiled libraries as well.

Please use gcc v4.6 to 4.9, or clang v3.8 or 3.9 (but the latter must also have been built against gcc's v4 libstdc++).

Author:  ZaneZimer [ 2016-09-10 19:46:27 ]
Post subject:  Re: Building in Linux with gcc 6.1.1

Hmm...I'll have to do some digging then. 4.9 is no longer available for 24. I'm not all that savvy with compiling things on Linux and unsure where I would go from here. I still have a build from 2 releases ago that works for now.

Author:  Henri Beauchamp [ 2016-09-10 20:18:29 ]
Post subject:  Re: Building in Linux with gcc 6.1.1

ZaneZimer wrote:
Hmm...I'll have to do some digging then. 4.9 is no longer available for 24. I'm not all that savvy with compiling things on Linux and unsure where I would go from here. I still have a build from 2 releases ago that works for now.
Not sure why you need to compile the viewer yourself on a recent Linux distribution (the provided viewer binaries should work just fine on any modern 64 bits Linux distro).
A gcc package from a from earlier version of your installation might work, with some tweaking... You could also setup a virtual machine in VirtualBox with an earlier version of your distribution to compile the viewer in it.
There are also "contrib" packages sometimes, for distributions (Mandrake/Mandriva forks have such package collections), in which you may find older gcc versions that can live along your system gcc.

Author:  ZaneZimer [ 2016-09-12 03:13:17 ]
Post subject:  Re: Building in Linux with gcc 6.1.1

Well I've been lazy and have stayed on 32 bit Fedora for a long while now. I have not taken the time to determine all of the custom configurations I have made such that I can start fresh with a 64 bit. Up until now, a 32 bit distro has been fine but it is getting harder to get by as the months/years progress. I would much prefer using the binaries you provide, Henri, but I have not made the transition to a 64 bit distro yet.

Author:  Henri Beauchamp [ 2016-09-12 09:24:37 ]
Post subject:  Re: Building in Linux with gcc 6.1.1

There *might* be a way to convince gcc 5/6 not to break things, by adding -D_GLIBCXX_USE_CXX11_ABI=0 to the gcc command line.

Please, try the following: in linden/indra/cmake/00-Common.cmake, around line 168, change the code:
Code:
add_definitions(-DLL_LINUX=1 -D_REENTRANT)

To read:
Code:
  add_definitions(-DLL_LINUX=1 -D_REENTRANT)
  if (${CXX_VERSION} GREATER 499)
    add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
  endif (${CXX_VERSION} GREATER 499)


Then try and compile the viewer. Let me know if this works for you and if it does, I'll add it to next releases...

Author:  ZaneZimer [ 2016-09-12 14:21:11 ]
Post subject:  Re: Building in Linux with gcc 6.1.1

I appreciate you looking for alternatives, Henri. Adding that section of code to the common cmake worked like a charm. The build completed successfully and my brief test of the viewer shows it still works well on my rig. As a side note, the build seems to be more efficient with gcc/g++ 6, as my system temp/fan usage didn't rise as much as it usually does during the process. Thanks again for coming up with a way forward for my set up.

Author:  Henri Beauchamp [ 2016-09-12 17:04:13 ]
Post subject:  Re: Building in Linux with gcc 6.1.1

ZaneZimer wrote:
Adding that section of code to the common cmake worked like a charm. The build completed successfully and my brief test of the viewer shows it still works well on my rig.
That's good news for me as well: it means that I'll not have to worry about recompiling all the pre-built libraries myself in the future, when all major distros (including the ones I use) will move to gcc 5/6...

Quote:
As a side note, the build seems to be more efficient with gcc/g++ 6, as my system temp/fan usage didn't rise as much as it usually does during the process.
Well, they improved gcc's build time, I think. Not sure however the optimizer makes a better job and produces faster code than gcc 4.6.4 (by far my favorite compiler so far)...

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/