Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while installing Flang #109418

Closed
AkhilAkkapelli opened this issue Sep 20, 2024 · 23 comments
Closed

Error while installing Flang #109418

AkhilAkkapelli opened this issue Sep 20, 2024 · 23 comments
Labels
build-problem flang Flang issues not falling into any other category question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@AkhilAkkapelli
Copy link

AkhilAkkapelli commented Sep 20, 2024

I am getting the following error when trying to install flang in SUSE Linux Enterprise 15 SP 6.

I followed these instructions as per manual:

git clone https://github.com/llvm/llvm-project.git
rm -rf build
mkdir build
rm -rf install
mkdir install
ROOTDIR=`pwd`
INSTALLDIR=$ROOTDIR/install

cd build

cmake \
  -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
  -DCMAKE_CXX_STANDARD=17 \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  -DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" \
  -DFLANG_ENABLE_WERROR=ON \
  -DLLVM_ENABLE_ASSERTIONS=ON \
  -DLLVM_TARGETS_TO_BUILD=host \
  -DLLVM_LIT_ARGS=-v \
  -DLLVM_ENABLE_PROJECTS="clang;mlir;flang;openmp" \
  -DLLVM_ENABLE_RUNTIMES="compiler-rt" \
  ../llvm-project/llvm

ninja

I couldn't able to build completely:

akhil@AKHIL-IISC:~/fortran/compilers/flang/root/build> ninja
[0/126] Performing build step for 'builtins'
ninja: no work to do.
[1/126] No install step for 'builtins'
[3/126] Performing configure step for 'runtimes'
Not searching for unused variables given on the command line.
loading initial cache file /home/akhil/fortran/compilers/flang/root/build/projects/runtimes/tmp/runtimes-cache-Release.cmake
CMake Deprecation Warning at /home/akhil/fortran/compilers/flang/root/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0114 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)


CMake Deprecation Warning at /home/akhil/fortran/compilers/flang/root/llvm-project/cmake/Modules/CMakePolicy.cmake:11 (cmake_policy):
  The OLD behavior for policy CMP0116 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)


-- Building with -fPIC
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
CMake Deprecation Warning at /home/akhil/fortran/compilers/flang/root/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0114 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/CMakeLists.txt:12 (include)


CMake Deprecation Warning at /home/akhil/fortran/compilers/flang/root/llvm-project/cmake/Modules/CMakePolicy.cmake:11 (cmake_policy):
  The OLD behavior for policy CMP0116 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/CMakeLists.txt:12 (include)


-- Compiler-RT supported architectures: x86_64
-- Generated Sanitizer SUPPORTED_TOOLS list on "Linux" is "asan;lsan;hwasan;msan;tsan;ubsan"
-- sanitizer_common tests on "Linux" will run against "asan;lsan;hwasan;msan;tsan;ubsan"
-- check-shadowcallstack does nothing.
-- Configuring done (2.1s)
-- Generating done (0.2s)
-- Build files have been written to: /home/akhil/fortran/compilers/flang/root/build/runtimes/runtimes-bins
[4/126] Performing build step for 'runtimes'
[11/11] Linking CXX shared library /home/akhil/fortran/compilers/flang/root/build/lib/clang/20/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.so
[5/126] No install step for 'runtimes'
[8/126] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/preprocessor.cpp.o
FAILED: tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/preprocessor.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Parser -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Parser -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/preprocessor.cpp.o -MF tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/preprocessor.cpp.o.d -o tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/preprocessor.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Parser/preprocessor.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Parser/preprocessor.cpp: In member function ‘void Fortran::parser::Preprocessor::PrintMacros(llvm::raw_ostream&) const’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Parser/preprocessor.cpp:790:28: error: unused variable ‘_’ [-Werror=unused-variable]
   for (const auto &[name, _] : definitions_) {
                            ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[9/126] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackArrays.cpp.o
FAILED: tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackArrays.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Optimizer/Transforms -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackArrays.cpp.o -MF tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackArrays.cpp.o.d -o tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/StackArrays.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/StackArrays.cpp
In file included from /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include/llvm/Support/CFGUpdate.h:21:0,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include/llvm/Support/CFGDiff.h:20,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include/llvm/Support/GenericDomTree.h:32,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/mlir/include/mlir/IR/Dominance.h:23,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/mlir/include/mlir/Interfaces/MemorySlotInterfaces.h:12,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h:19,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/mlir/include/mlir/Dialect/LLVMIR/LLVMAttrs.h:17,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/flang/include/flang/Optimizer/Dialect/FIROps.h:19,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/flang/include/flang/Optimizer/Builder/FIRBuilder.h:20,
                 from /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/StackArrays.cpp:9:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/StackArrays.cpp: In member function ‘llvm::LogicalResult {anonymous}::StackArraysAnalysisWrapper::analyseFunction(mlir::Operation*)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/StackArrays.cpp:484:38: error: unused variable ‘_’ [-Werror=unused-variable]
   LLVM_DEBUG(for (auto [allocMemOp, _]
                                      ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/StackArrays.cpp:446:21: error: unused variable ‘inserted’ [-Werror=unused-variable]
   auto [it, inserted] = funcMaps.try_emplace(func);
                     ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/StackArrays.cpp: In member function ‘virtual void {anonymous}::StackArraysPass::runOnOperation()’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/StackArrays.cpp:784:19: error: unused variable ‘_’ [-Werror=unused-variable]
   for (auto [op, _] : *candidateOps)
                   ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[10/126] Building CXX object tools/flang/lib/Optimizer/Dialect/CMakeFiles/FIRDialect.dir/FIRType.cpp.o
FAILED: tools/flang/lib/Optimizer/Dialect/CMakeFiles/FIRDialect.dir/FIRType.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Optimizer/Dialect -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Dialect -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Optimizer/Dialect/CMakeFiles/FIRDialect.dir/FIRType.cpp.o -MF tools/flang/lib/Optimizer/Dialect/CMakeFiles/FIRDialect.dir/FIRType.cpp.o.d -o tools/flang/lib/Optimizer/Dialect/CMakeFiles/FIRDialect.dir/FIRType.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Dialect/FIRType.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Dialect/FIRType.cpp: In function ‘bool fir::isRecordWithAllocatableMember(mlir::Type)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Dialect/FIRType.cpp:388:28: error: unused variable ‘field’ [-Werror=unused-variable]
     for (auto [field, memTy] : recTy.getTypeList()) {
                            ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Dialect/FIRType.cpp: In function ‘bool fir::isRecordWithDescriptorMember(mlir::Type)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Dialect/FIRType.cpp:403:28: error: unused variable ‘field’ [-Werror=unused-variable]
     for (auto [field, memTy] : recTy.getTypeList()) {
                            ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[11/126] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/FIRBuilder.cpp.o
FAILED: tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/FIRBuilder.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Optimizer/Builder -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/FIRBuilder.cpp.o -MF tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/FIRBuilder.cpp.o.d -o tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/FIRBuilder.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/FIRBuilder.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/FIRBuilder.cpp: In function ‘bool recordTypeCanBeMemCopied(fir::RecordType)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/FIRBuilder.cpp:1379:26: error: unused variable ‘_’ [-Werror=unused-variable]
   for (auto [_, fieldType] : recordType.getTypeList()) {
                          ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/FIRBuilder.cpp: In function ‘mlir::Value fir::factory::genCPtrOrCFunptrValue(fir::FirOpBuilder&, mlir::Location, mlir::Value)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/FIRBuilder.cpp:1628:36: error: unused variable ‘addrFieldIndex’ [-Werror=unused-variable]
   auto [addrFieldIndex, addrFieldTy] =
                                    ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[12/126] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ArrayValueCopy.cpp.o
FAILED: tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ArrayValueCopy.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Optimizer/Transforms -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ArrayValueCopy.cpp.o -MF tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ArrayValueCopy.cpp.o.d -o tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/ArrayValueCopy.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp: In member function ‘virtual llvm::LogicalResult {anonymous}::ArrayUpdateConversion::matchAndRewrite(fir::ArrayUpdateOp, mlir::PatternRewriter&) const’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp:1264:27: error: unused variable ‘_’ [-Werror=unused-variable]
     auto [_, lhsLoadResult] = materializeAssignment(
                           ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[13/126] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/IntrinsicCall.cpp.o
FAILED: tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/IntrinsicCall.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Optimizer/Builder -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/IntrinsicCall.cpp.o -MF tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/IntrinsicCall.cpp.o.d -o tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/IntrinsicCall.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In member function ‘void fir::IntrinsicLibrary::genIeeeGetFlag(llvm::ArrayRef<fir::ExtendedValue>)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:4371:25: error: unused variable ‘ignore’ [-Werror=unused-variable]
   auto [fieldRef, ignore] = getFieldRef(builder, loc, flag);
                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In member function ‘void fir::IntrinsicLibrary::genIeeeGetHaltingMode(llvm::ArrayRef<fir::ExtendedValue>)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:4395:25: error: unused variable ‘ignore’ [-Werror=unused-variable]
   auto [fieldRef, ignore] = getFieldRef(builder, loc, flag);
                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In member function ‘void fir::IntrinsicLibrary::genIeeeSetRoundingMode(llvm::ArrayRef<fir::ExtendedValue>)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:4775:25: error: unused variable ‘ignore’ [-Werror=unused-variable]
   auto [fieldRef, ignore] = getFieldRef(builder, loc, fir::getBase(args[0]));
                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In member function ‘mlir::Value fir::IntrinsicLibrary::genIeeeValue(mlir::Type, llvm::ArrayRef<mlir::Value>)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:5011:24: error: unused variable ‘ignore’ [-Werror=unused-variable]
     auto [index, ignore] = getFieldRef(builder, loc, args[1]);
                        ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In instantiation of ‘mlir::Value fir::IntrinsicLibrary::genIeeeTypeCompare(mlir::Type, llvm::ArrayRef<mlir::Value>) [with mlir::arith::CmpIPredicate pred = (mlir::arith::CmpIPredicate)0]’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:679:1:   required from here
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:4038:25: error: unused variable ‘ignore’ [-Werror=unused-variable]
   auto [rightRef, ignore] = getFieldRef(builder, loc, args[1]);
                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In instantiation of ‘mlir::Value fir::IntrinsicLibrary::genIeeeTypeCompare(mlir::Type, llvm::ArrayRef<mlir::Value>) [with mlir::arith::CmpIPredicate pred = (mlir::arith::CmpIPredicate)1]’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:679:1:   required from here
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:4038:25: error: unused variable ‘ignore’ [-Werror=unused-variable]
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In instantiation of ‘void fir::IntrinsicLibrary::genIeeeSetFlagOrHaltingMode(llvm::ArrayRef<fir::ExtendedValue>) [with bool isFlag = true]’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:679:1:   required from here
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:4752:25: error: unused variable ‘ignore’ [-Werror=unused-variable]
   auto [fieldRef, ignore] = getFieldRef(builder, loc, getBase(args[0]));
                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: In instantiation of ‘void fir::IntrinsicLibrary::genIeeeSetFlagOrHaltingMode(llvm::ArrayRef<fir::ExtendedValue>) [with bool isFlag = false]’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:679:1:   required from here
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:4752:25: error: unused variable ‘ignore’ [-Werror=unused-variable]
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[14/126] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/type.cpp.o
FAILED: tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/type.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DHAS_QUADMATHLIB -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Evaluate -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Evaluate -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/type.cpp.o -MF tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/type.cpp.o.d -o tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/type.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Evaluate/type.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Evaluate/type.cpp: In function ‘bool Fortran::evaluate::AreTypeParamCompatible(const Fortran::semantics::DerivedTypeSpec&, const Fortran::semantics::DerivedTypeSpec&, bool)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Evaluate/type.cpp:440:33: error: unused variable ‘_’ [-Werror=unused-variable]
   for (const auto &[paramName, _] : y.parameters()) {
                                 ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[15/126] Building CXX object tools/flang/lib/Optimizer/CodeGen/CMakeFiles/FIRCodeGen.dir/CodeGen.cpp.o
FAILED: tools/flang/lib/Optimizer/CodeGen/CMakeFiles/FIRCodeGen.dir/CodeGen.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Optimizer/CodeGen -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/CodeGen -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Optimizer/CodeGen/CMakeFiles/FIRCodeGen.dir/CodeGen.cpp.o -MF tools/flang/lib/Optimizer/CodeGen/CMakeFiles/FIRCodeGen.dir/CodeGen.cpp.o.d -o tools/flang/lib/Optimizer/CodeGen/CMakeFiles/FIRCodeGen.dir/CodeGen.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/CodeGen/CodeGen.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/CodeGen/CodeGen.cpp: In member function ‘virtual llvm::LogicalResult EmboxOpConversion::matchAndRewrite(fir::EmboxOp, fir::FIROpConversion<fir::EmboxOp>::OpAdaptor, mlir::ConversionPatternRewriter&) const’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/CodeGen/CodeGen.cpp:1548:31: error: unused variable ‘eleSize’ [-Werror=unused-variable]
     auto [boxTy, dest, eleSize] = consDescriptorPrefix(
                               ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/CodeGen/CodeGen.cpp: In member function ‘virtual llvm::LogicalResult XReboxOpConversion::matchAndRewrite(fir::cg::XReboxOp, fir::FIROpConversion<fir::cg::XReboxOp>::OpAdaptor, mlir::ConversionPatternRewriter&) const’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Optimizer/CodeGen/CodeGen.cpp:1821:31: error: unused variable ‘eleSize’ [-Werror=unused-variable]
     auto [boxTy, dest, eleSize] =
                               ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[16/126] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/mod-file.cpp.o
FAILED: tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/mod-file.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Semantics -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/mod-file.cpp.o -MF tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/mod-file.cpp.o.d -o tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/mod-file.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/mod-file.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/mod-file.cpp: In function ‘void Fortran::semantics::HarvestSymbolsNeededFromOtherModules(Fortran::semantics::SourceOrderedSymbolSet&, const Fortran::semantics::Scope&)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/mod-file.cpp:285:30: error: unused variable ‘_’ [-Werror=unused-variable]
   for (const auto &[_, symbol] : scope) {
                              ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/mod-file.cpp: In member function ‘void Fortran::semantics::ModFileWriter::PrepareRenamings(const Fortran::semantics::Scope&)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/mod-file.cpp:293:36: error: unused variable ‘name’ [-Werror=unused-variable]
   for (const auto &[name, symbolRef] : scope) {
                                    ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[17/126] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-names-utils.cpp.o
FAILED: tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-names-utils.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Semantics -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-names-utils.cpp.o -MF tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-names-utils.cpp.o.d -o tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-names-utils.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/resolve-names-utils.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/resolve-names-utils.cpp: In function ‘void Fortran::semantics::MapSubprogramToNewSymbols(const Fortran::semantics::Symbol&, Fortran::semantics::Symbol&, Fortran::semantics::Scope&, Fortran::semantics::SymbolAndTypeMappings*)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/resolve-names-utils.cpp:904:21: error: unused variable ‘_’ [-Werror=unused-variable]
   for (auto &[_, ref] : newScope) {
                     ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[18/126] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/semantics.cpp.o
FAILED: tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/semantics.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Semantics -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/semantics.cpp.o -MF tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/semantics.cpp.o.d -o tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/semantics.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/semantics.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/semantics.cpp: In member function ‘Fortran::semantics::CommonBlockList Fortran::semantics::CommonBlockMap::GetCommonBlocks() const’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Semantics/semantics.cpp:306:35: error: unused variable ‘_’ [-Werror=unused-variable]
     for (const auto &[_, blockInfo] : commonBlocks_) {
                                   ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[19/126] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/Bridge.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/Bridge.cpp: In lambda function:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/Bridge.cpp:5515:31: error: unused variable ‘_’ [-Werror=unused-variable]
       for (const auto &[_, sym] : bdunit.symTab) {
                               ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[20/126] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/PFTBuilder.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/PFTBuilder.cpp: In member function ‘void {anonymous}::SymbolVisitor::visitSymbol(const Fortran::semantics::Symbol&)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/PFTBuilder.cpp:2052:37: error: unused variable ‘_’ [-Werror=unused-variable]
           for (const auto &[_, param] : derivedTypeSpec->parameters())
                                     ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[21/126] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp: In function ‘mlir::Value genReductionInitRegion(fir::FirOpBuilder&, mlir::Location, mlir::Type, mlir::acc::ReductionOperator)’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp:1097:24: error: unused variable ‘cleanup’ [-Werror=unused-variable]
     auto [temp, cleanup] = hlfir::createTempFromMold(loc, builder, source);
                        ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp: In instantiation of ‘void genPrivateLikeInitRegion(mlir::OpBuilder&, RecipeOp, mlir::Type, mlir::Location) [with RecipeOp = mlir::acc::PrivateRecipeOp]’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp:555:59:   required from here
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp:518:24: error: unused variable ‘cleanup’ [-Werror=unused-variable]
     auto [temp, cleanup] = hlfir::createTempFromMold(loc, firBuilder, source);
                        ^
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp: In instantiation of ‘void genPrivateLikeInitRegion(mlir::OpBuilder&, RecipeOp, mlir::Type, mlir::Location) [with RecipeOp = mlir::acc::FirstprivateRecipeOp]’:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp:694:64:   required from here
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/OpenACC.cpp:518:24: error: unused variable ‘cleanup’ [-Werror=unused-variable]
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
[22/126] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/ConvertExpr.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/ConvertExpr.cpp
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/ConvertExpr.cpp: In lambda function:
/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Lower/ConvertExpr.cpp:4623:33: error: unused variable ‘_’ [-Werror=unused-variable]
           auto [cc, isPresent, _] = this->genOptionalArrayFetch(expr);
                                 ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-copy’ [-Werror]
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.

How do I resolve this issue.

@github-actions github-actions bot added the flang Flang issues not falling into any other category label Sep 20, 2024
@tarunprabhu
Copy link
Contributor

Can you try compiling without -Werror?

@AkhilAkkapelli
Copy link
Author

AkhilAkkapelli commented Sep 20, 2024

I specified flags of cmake. What should i do now?

These are the instances of WERROR in CMakeCache.txt:

//Build Release candidates with -Werror.
BENCHMARK_ENABLE_WERROR:BOOL=OFF

//Build Release candidates with -Werror regardless of compiler
// issues.
BENCHMARK_FORCE_WERROR:BOOL=OFF

//Fail and stop building flang if a warning is triggered.
FLANG_ENABLE_WERROR:BOOL=ON

//Fail and stop if a warning is triggered.
LLVM_ENABLE_WERROR:BOOL=OFF

//Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR:INTERNAL=

//Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR:INTERNAL=
//Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION
C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION:INTERNAL=1
//Test C_SUPPORTS_WERROR_MISMATCHED_TAGS
C_SUPPORTS_WERROR_MISMATCHED_TAGS:INTERNAL=
//Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW:INTERNAL=

//Test HAS_WERROR_GLOBAL_CTORS
HAS_WERROR_GLOBAL_CTORS:INTERNAL=

//Test OPENMP_HAVE_WERROR_FLAG
OPENMP_HAVE_WERROR_FLAG:INTERNAL=1

Should I change the flags here. Also, if i do does it install flang without any errors.

@tarunprabhu
Copy link
Contributor

Try setting changing FLANG_ENABLE_WERROR to OFF. I don't know if that will fix your issue, but it is one thing you could try.

@AkhilAkkapelli
Copy link
Author

AkhilAkkapelli commented Sep 20, 2024

Now while building Iam getting errors in this way:

[42/402] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openmp-parsers.cpp.o
**FAILED:** tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openmp-parsers.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/lib/Parser -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Parser -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openmp-parsers.cpp.o -MF tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openmp-parsers.cpp.o.d -o tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openmp-parsers.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/lib/Parser/openmp-parsers.cpp
c++: **internal compiler error:** Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.opensuse.org/> for instructions.
[46/402] Building CXX object tools/flang/tools/bbc/CMakeFiles/bbc.dir/bbc.cpp.o
**FAILED**: tools/flang/tools/bbc/CMakeFiles/bbc.dir/bbc.cpp.o
/usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/tools/bbc -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/tools/bbc -I/home/akhil/fortran/compilers/flang/root/llvm-project/flang/include -I/home/akhil/fortran/compilers/flang/root/build/tools/flang/include -I/home/akhil/fortran/compilers/flang/root/build/include -I/home/akhil/fortran/compilers/flang/root/llvm-project/llvm/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/mlir/include -isystem /home/akhil/fortran/compilers/flang/root/build/tools/clang/include -isystem /home/akhil/fortran/compilers/flang/root/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG -std=c++1z  -fno-exceptions -funwind-tables -fno-rtti -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/tools/bbc/CMakeFiles/bbc.dir/bbc.cpp.o -MF tools/flang/tools/bbc/CMakeFiles/bbc.dir/bbc.cpp.o.d -o tools/flang/tools/bbc/CMakeFiles/bbc.dir/bbc.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/flang/tools/bbc/bbc.cpp
c++: **internal compiler error:** Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.opensuse.org/> for instructions.

@tarunprabhu
Copy link
Contributor

This seems to be triggering an error within your C++ compiler. Which one are you using?

@AkhilAkkapelli
Copy link
Author

akhil@AKHIL-IISC:~/fortran/compilers/flang/root/build> c++ --version
c++ (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.

@tarunprabhu
Copy link
Contributor

This suggests that GCC 7.5.0 should be able to compile flang. I have never tested with such old compilers. Perhaps someone else has done so. The easiest thing to do for now would be to try building flang with a newer compiler, if that is an option for you.

@AkhilAkkapelli
Copy link
Author

AkhilAkkapelli commented Sep 20, 2024

Which one would be better and How do i install that specific version. Does it mean I need to build again from start?

@tarunprabhu
Copy link
Contributor

I, personally, have never built flang with anything older than GCC 11.

How do i install that specific version

That depends on your OS. I can't help you with that.

Does it mean I need to build again from start?

Yes.

@AkhilAkkapelli
Copy link
Author

Here, they mentioned
The code has been compiled and tested with GCC versions from 7.2.0 to 9.3.0.

So Iam installing using this version(7.5.0)

@tarunprabhu
Copy link
Contributor

Yes, but I don't think we routinely test with GCC versions that are that old. It could be that the documentation is out of date, but I don't know for sure.

@tarunprabhu
Copy link
Contributor

What is the full cmake command that you are using to configure? And have you tried a fresh build after turning off -Werror?

@AkhilAkkapelli
Copy link
Author

AkhilAkkapelli commented Sep 20, 2024

I am using ninja command after i turned OFF FLANG_ENABLE_WERROR in CMakeCache.txt

@tarunprabhu
Copy link
Contributor

By "fresh build", I mean, "have you tried deleting the build directory and starting again including running cmake again"

@AkhilAkkapelli
Copy link
Author

I will try it now. Can i use gcc 13 for that?

@tarunprabhu
Copy link
Contributor

Can i use gcc 13 for that?

Sure.

@AkhilAkkapelli
Copy link
Author

AkhilAkkapelli commented Sep 20, 2024

I successfully built flangusing gcc 13. Now, when I am building compiler-rt as next step.

These are the commands i followed:

cd $ROOTDIR
rm -rf compiler-rt
mkdir compiler-rt
cd compiler-rt
CC=$INSTALLDIR/bin/clang \
CXX=$INSTALLDIR/bin/clang++ \
cmake \
  -G Ninja \
  ../llvm-project/compiler-rt \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
  -DCMAKE_CXX_STANDARD=11 \
  -DCMAKE_C_CFLAGS=-mlong-double-128 \
  -DCMAKE_CXX_CFLAGS=-mlong-double-128 \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  -DCOMPILER_RT_BUILD_ORC=OFF \
  -DCOMPILER_RT_BUILD_XRAY=OFF \
  -DCOMPILER_RT_BUILD_MEMPROF=OFF \
  -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
  -DCOMPILER_RT_BUILD_SANITIZERS=OFF \
  -DLLVM_CONFIG_PATH=$INSTALLDIR/bin/llvm-config

ninja

I am encountering following errors:

akhil@AKHIL-IISC:~/fortran/compilers/flang/root/compiler-rt> ninja
[1/365] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_flag_parser.cpp.o
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_flag_parser.cpp.o
/home/akhil/fortran/compilers/flang/root/install/bin/clang++ -DHAVE_RPC_XDR_H=1 -I/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/.. -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++11 -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -Wno-format -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_flag_parser.cpp.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_flag_parser.cpp.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_flag_parser.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp
In file included from /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp:13:
In file included from /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h:16:
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.h:462:3: error: statement not allowed in constexpr function
  462 |   RAW_CHECK(IsPowerOfTwo(boundary));
      |   ^
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:317:25: note: expanded from macro 'RAW_CHECK'
  317 | #define RAW_CHECK(expr) RAW_CHECK_MSG(expr, #expr "\n", )
      |                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:309:3: note: expanded from macro 'RAW_CHECK_MSG'
  309 |   do {                                         \
      |   ^
1 error generated.
[2/365] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libignore.cpp.o
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libignore.cpp.o
/home/akhil/fortran/compilers/flang/root/install/bin/clang++ -DHAVE_RPC_XDR_H=1 -I/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/.. -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++11 -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -Wno-format -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libignore.cpp.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libignore.cpp.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_libignore.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp
In file included from /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp:14:
In file included from /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h:20:
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.h:462:3: error: statement not allowed in constexpr function
  462 |   RAW_CHECK(IsPowerOfTwo(boundary));
      |   ^
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:317:25: note: expanded from macro 'RAW_CHECK'
  317 | #define RAW_CHECK(expr) RAW_CHECK_MSG(expr, #expr "\n", )
      |                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:309:3: note: expanded from macro 'RAW_CHECK_MSG'
  309 |   do {                                         \
      |   ^
1 error generated.

...

[22/365] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o
/home/akhil/fortran/compilers/flang/root/install/bin/clang++ -DHAVE_RPC_XDR_H=1 -I/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/.. -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++11 -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -Wno-format -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cpp.o -c /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
In file included from /home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:175:
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common.h:462:3: error: statement not allowed in constexpr function
  462 |   RAW_CHECK(IsPowerOfTwo(boundary));
      |   ^
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:317:25: note: expanded from macro 'RAW_CHECK'
  317 | #define RAW_CHECK(expr) RAW_CHECK_MSG(expr, #expr "\n", )
      |                         ^
/home/akhil/fortran/compilers/flang/root/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:309:3: note: expanded from macro 'RAW_CHECK_MSG'
  309 |   do {                                         \
      |   ^
1 error generated.
ninja: build stopped: subcommand failed.

How do I resolve this issue @tarunprabhu

@tarunprabhu
Copy link
Contributor

Those are from clang's sanitizers. I have no idea why they would be failing. Are you doing a clean build? What cmake options have you used?

@tarunprabhu
Copy link
Contributor

Are you building flang and compiler-rt separately out of tree? Do you need to build them separately?

@AkhilAkkapelli
Copy link
Author

I have updated my comment.

@tarunprabhu
Copy link
Contributor

Is there a reason you are building flang and compiler-rt separately? Have you tried building them together in-tree

@AkhilAkkapelli
Copy link
Author

AkhilAkkapelli commented Sep 21, 2024

I am following the steps from Building Flang In-Tree and encountered the error mentioned above. Since I don't require compiler-rt unless it affects Flang's front-end functionality, is it essential in my case?

@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Sep 23, 2024
@tarunprabhu
Copy link
Contributor

No, compiler-rt is not essential for flang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-problem flang Flang issues not falling into any other category question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

3 participants