Closed garyd203 closed 5 years ago
Oh wow, thanks for the update – gcc and g++ used to be in the development
group, which gets installed on the base build system: https://github.com/lambci/docker-lambda/blob/master/base/build/Dockerfile#L18
I'll need to look into what's changed here – probably installing g++ 7.2 is the right answer
Have added gcc72-g++ to the build images – let me know if that fixes the issue!
my two cents - we installed gcc72-g++ but then it doesn't run on lambda, since some c++ library is missing. we reverted to same fix as above, alternatives --set gcc /usr/bin/gcc48
and update-alternatives --set cpp /usr/bin/cpp48
@shlomimatichin ah, I thought you said in https://github.com/lambci/docker-lambda/issues/183 that it fixed the issue
Can you give some more details as to what the error was? It would be nicer to enable gcc 7.2 if possible just because there's a bunch of software that won't compile on 4.8 anymore
@shlomimatichin I'm just compiling Node.js with g++ 7.2 on docker-lambda right now and it seems to be compiling fine – was it a library specific to your cython extension that might have been the issue?
FWIW, the reproduction from @garyd203 works now:
docker run --rm -it lambci/lambda:build-python3.6 pip install marisa-trie
fetched the exact error:
Unable to import module 'amenity.insightengine.backend.lambda_insightengine': /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /var/task/amenity/insightengine/runtime/extendeddoc.cpython-36m-x86_64-linux-gnu.so)
i called it in too soon - just as it compiled. once i tried running it on lambda, i think the libstdc++ installed on amazonlinux image used by lambda does not support the ABI generated by new gcc. maybe there are flags to require older ABI?
Ugh. I see. You might be right – that sounds very likely.
Ok, I'll add the alternatives --set
calls to the build image too – will update you when they've built
Ok, this should be fixed, for real this time 😸
Summary We have run into a problem compiling C++ files in the currently version of the
lambci/lambda:build-python3.6
docker image. This is caused by an inconsistency in the configured versions ofgcc
andg++
.There are 2 installed versions of
gcc
, where both v4.8.5 and v7.2 are installed but v7.2 is used. There is only 1 installed version ofg++
, which is v4.8.5. This means if you try to compile a C++ file using thegcc
command then you get an error along the lines ofReproduce
docker run --rm -it lambci/lambda:build-python3.6 pip install marisa-trie
Solution I'm not sure whether we should be using v7.2 or v4.8.5.
As a simple workaround, we are forcing the use of gcc v4.8.5 in our build script via:
alternatives --set gcc /usr/bin/gcc48