hashdist / hashstack

Collection of software profiles for HashDist
https://hashdist.github.io/
51 stars 60 forks source link

CentOS 6.7 Build with Newer GCC Version #959

Open frenchwr opened 8 years ago

frenchwr commented 8 years ago

I am trying to build FEniCS by following the instructions at this page: http://fenicsproject.org/download/installation_using_hashdist.html

I am on a CentOS 6.7 system - the system compiler is GCC 4.4.7.

When I attempt a standard build with curl -s http://fenicsproject.org/fenics-install.sh | bash (as suggested here: http://fenicsproject.org/download/#automatic-installation-from-source-all-platforms-and-versions-toolsimage-hspace) the build makes it all the way to dolfin and then it bombs out because GCC 4.4.7 does not offer C++11 support.

I then tried a newer version of GCC (4.6.1) and the build failed at CMAKE. The problem with CMAKE is that at the linking stage I cannot add -L/path/to/libstdc++.so.6 so instead the linker points at the system (4.4.7) version of the library and fails with a /usr/lib64/libstdc++.so.6: versionGLIBCXX_3.4.15' not found` error.

I've tried passing in LDFLAGS (or LINKFLAGS) in the parameters section of my fenics.yaml file but the FEniCS build system appears to clobber my LDFLAGS so my paths to the correct library do not get passed on to the linker. Here is the relevant section of my fenics.yaml file:

extends:
- file: linux.yaml

parameters:
  PROLOGUE: export CC=/usr/local/gcc/4.6.1/bin/gcc; export CXX=/usr/local/gcc/4.6.1/bin/g++; export CPP=/usr/local/gcc/4.6.1/bin/cpp; export LDFLAGS="-L/usr/local/gcc/4.6.1/lib64 -L/usr/local/gcc/4.6.1/lib";

Any tips on how to get this to build? Thanks.

frenchwr commented 8 years ago

Ping - anyone have advice on this?

cmaurini commented 8 years ago

You need at least gcc 4.9 for fenics, because of C++11

frenchwr commented 8 years ago

You need at least gcc 4.9 for fenics, because of C++11

Okay. I suppose the dolfin build would have failed again had I made it that far.

However, I've also tested with GCC 4.9.3 and hit the same problem with LDFLAGS and the CMAKE build failing. The issue is that I cannot find a mechanism for overriding the -L/usr/lib64 flag that is inserted at the linking stage and causes the GLIBC mismatch. Basically this should cause any CentOS 6 build to fail if someone wants to use a recent enough version of GCC (since it must be installed in a custom location and therefore one must somehow point to the correct libstdc++.so.6 at build time).