macOS & GCC 9.2.0
As a follow-up to #20620 (closed), CMake 3.18.2 still does not build on macOS Catalina with GCC 9.2.0.
In the LexerParser
part, it raises the following error message:
[ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/LexerParser/cmDependsJavaParser.cxx.o
[ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/LexerParser/cmCommandArgumentParser.cxx.o
[ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/LexerParser/cmFortranLexer.cxx.o
[ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/LexerParser/cmExprParser.cxx.o
In file included from gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c
++/9.2.0/stdlib.h:36,
from Source/LexerParser/cmFortranLexer.cxx:232:
>> 1902 gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c++/9.2.0/cstdlib:132:1
1: error: '::aligned_alloc' has not been declared
132 | using ::aligned_alloc;
| ^~~~~~~~~~~~~
>> 1905 make[2]: *** [Source/CMakeFiles/CMakeLib.dir/LexerParser/cmFortranLexer.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c
++/9.2.0/stdlib.h:36,
from Source/LexerParser/cmExprLexer.cxx:232:
>> 1909 gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c++/9.2.0/cstdlib:132:1
1: error: '::aligned_alloc' has not been declared
132 | using ::aligned_alloc;
| ^~~~~~~~~~~~~
In file included from gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c
++/9.2.0/stdlib.h:36,
from Source/LexerParser/cmCommandArgumentLexer.cxx:232:
>> 1914 gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c++/9.2.0/cstdlib:132:1
1: error: '::aligned_alloc' has not been declared
132 | using ::aligned_alloc;
| ^~~~~~~~~~~~~
In file included from gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c
++/9.2.0/stdlib.h:36,
from Source/LexerParser/cmDependsJavaLexer.cxx:232:
>> 1919 gcc-9.2.0-ie4mp5d7u3ygeu3icgelktq437acyzw6/include/c++/9.2.0/cstdlib:132:1
1: error: '::aligned_alloc' has not been declared
132 | using ::aligned_alloc;
| ^~~~~~~~~~~~~
>> 1922 make[2]: *** [Source/CMakeFiles/CMakeLib.dir/LexerParser/cmExprLexer.cxx.o] Error 1
>> 1923 make[2]: *** [Source/CMakeFiles/CMakeLib.dir/LexerParser/cmCommandArgumentLexer.cxx.o] Error 1
>> 1924 make[2]: *** [Source/CMakeFiles/CMakeLib.dir/LexerParser/cmDependsJavaLexer.cxx.o] Error 1
>> 1925 make[1]: *** [Source/CMakeFiles/CMakeLib.dir/all] Error 2
>> 1926 make: *** [all] Error 2
Related SO: https://stackoverflow.com/questions/52777209/compiler-cant-find-aligned-alloc-function/52777686#52777686
We see this in Spack for a GCC 9.2.0 that was built with AppleClang 11.0.0. We get the same problem with HomeBrew's gcc@9.3.0.
Edited by Axel Huebl