'How to fix error that occurred while building CXX object src/CMakeFiles/VC4CC.dir/Compiler.cpp.o on Rasbberry Pi?

I've followed these instructions. I've cloned grom git VC4CLStdLib, VC4C and VC4CL. VC4CLStdLib installed sucsessfuly. Then I do the cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DEBUG=OFF -DBUILD_DEB_PACKAGE=OFF . command for VC4C and get the following output

-- VC4CL standard library headers found: /usr/include/vc4cl-stdlib/VC4CLStdLib.h
-- Enabling multi-threaded optimizations
-- CLang compiler found: /usr/bin/clang
-- Using enhanced OpenCL features of Clang 3.9+!
-- Clang opt found: /usr/bin/opt
-- LLVM-link found: /usr/bin/llvm-link
-- Compiling LLVM library front-end with LLVM in version 11.0.1 located in '/usr/lib/llvm-11/lib'
-- found clang-format: /usr/bin/clang-format
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/work/VC4C

But when I run make I get the following output:

[ 15%] Building CXX object src/CMakeFiles/VC4CC.dir/Compiler.cpp.o
<command-line>: warning: "_GNU_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
In file included from /home/pi/work/VC4C/lib/vc4asm/src/expr.h:12,
                 from /home/pi/work/VC4C/lib/vc4asm/src/Validator.h:11,
                 from /home/pi/work/VC4C/src/Compiler.cpp:32:
/home/pi/work/VC4C/lib/vc4asm/src/utils.h: In function ‘T* binary_search(T (&)[N], const char*)’:
/home/pi/work/VC4C/lib/vc4asm/src/utils.h:156:46: warning: use of old-style cast to ‘const char*’ [-Wold-style-cast]
  156 |   int cmp = strcmp(key, (const char*)(arr + m));
      |                                              ^
In file included from /home/pi/work/VC4C/lib/vc4asm/src/utils.h:185,
                 from /home/pi/work/VC4C/lib/vc4asm/src/expr.h:12,
                 from /home/pi/work/VC4C/lib/vc4asm/src/Validator.h:11,
                 from /home/pi/work/VC4C/src/Compiler.cpp:32:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h: In member function ‘constexpr msgsrc msgID::Source() const’:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h:52:74: warning: use of old-style cast to ‘enum msgsrc’ [-Wold-style-cast]
   52 |  constexpr msgsrc   Source() const noexcept   { return (msgsrc)(Value>>24); }
      |                                                                          ^
      |                                                        -------------------
      |                                                        static_cast<msgsrc> ((Value>>24))
/home/pi/work/VC4C/lib/vc4asm/src/Message.h: In member function ‘constexpr uint8_t msgID::Major() const’:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h:53:75: warning: use of old-style cast to ‘uint8_t’ {aka ‘unsigned char’} [-Wold-style-cast]
   53 |  constexpr uint8_t  Major() const noexcept    { return (uint8_t)(Value>>16); }
      |                                                                           ^
      |                                                        --------------------
      |                                                        static_cast<uint8_t> ((Value>>16))
/home/pi/work/VC4C/lib/vc4asm/src/Message.h: In member function ‘constexpr uint8_t msgID::Minor() const’:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h:54:74: warning: use of old-style cast to ‘uint8_t’ {aka ‘unsigned char’} [-Wold-style-cast]
   54 |  constexpr uint8_t  Minor() const noexcept    { return (uint8_t)(Value>>8); }
      |                                                                          ^
      |                                                        -------------------
      |                                                        static_cast<uint8_t> ((Value>>8))
/home/pi/work/VC4C/lib/vc4asm/src/Message.h: In member function ‘constexpr severity msgID::Severity() const’:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h:55:66: warning: use of old-style cast to ‘enum severity’ [-Wold-style-cast]
   55 |  constexpr severity Severity() const noexcept { return (severity)Value; }
      |                                                                  ^~~~~
      |                                                        ---------------
      |                                                        static_cast<severity> (Value)
/home/pi/work/VC4C/lib/vc4asm/src/Message.h: At global scope:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h:92:22: warning: ‘virtual const char* Message::what() const’ can be marked override [-Wsuggest-override]
   92 |  virtual const char* what() const noexcept;
      |                      ^~~~
/home/pi/work/VC4C/lib/vc4asm/src/utils.MSG.h: In member function ‘const msgTemplateBase*<unnamed struct>::begin() const’:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h:131:101: warning: use of old-style cast to ‘const struct msgTemplateBase*’ [-Wold-style-cast]
  131 |  const           msgTemplateBase* begin() const noexcept           { return (const msgTemplateBase*)this; } \
      |                                                                                                     ^~~~
/home/pi/work/VC4C/lib/vc4asm/src/utils.MSG.h:37:2: note: in expansion of macro ‘MAKE_MSGTEMPLATE_CONTAINER’
   37 |  MAKE_MSGTEMPLATE_CONTAINER
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pi/work/VC4C/lib/vc4asm/src/Validator.h:11,
                 from /home/pi/work/VC4C/src/Compiler.cpp:32:
/home/pi/work/VC4C/lib/vc4asm/src/expr.h: In member function ‘rPUp::operator bool_only() const’:
/home/pi/work/VC4C/lib/vc4asm/src/expr.h:55:56: warning: use of old-style cast to ‘bool_only’ {aka ‘struct unspecified_type*’} [-Wold-style-cast]
   55 |  operator    bool_only()   const { return (bool_only)!!Mode; }
      |                                                        ^~~~
      |                                           -----------------
      |                                           reinterpret_cast<bool_only> (!!Mode)
/home/pi/work/VC4C/lib/vc4asm/src/expr.h: In member function ‘rPUp::pum rPUp::requestType() const’:
/home/pi/work/VC4C/lib/vc4asm/src/expr.h:57:60: warning: use of old-style cast to ‘enum rPUp::pum’ [-Wold-style-cast]
   57 |  pum         requestType() const { return (pum)(Mode & 0xc0); }
      |                                                            ^
      |                                           -----
      |                                           static_cast<pum> ()
/home/pi/work/VC4C/lib/vc4asm/src/expr.h: In member function ‘Inst::pack rPUp::asPack() const’:
/home/pi/work/VC4C/lib/vc4asm/src/expr.h:60:67: warning: use of old-style cast to ‘enum Inst::pack’ [-Wold-style-cast]
   60 |  Inst::pack  asPack()      const { return (Inst::pack)(Mode & 0x3f); }
      |                                                                   ^
      |                                           ------------
      |                                           static_cast<Inst::pack> ()
/home/pi/work/VC4C/lib/vc4asm/src/expr.h: In member function ‘Inst::unpack rPUp::asUnPack() const’:
/home/pi/work/VC4C/lib/vc4asm/src/expr.h:63:69: warning: use of old-style cast to ‘enum Inst::unpack’ [-Wold-style-cast]
   63 |  Inst::unpack asUnPack()   const { return (Inst::unpack)(Mode & 0x37); }
      |                                                                     ^
      |                                           -
      |                                           static_cast< -
      |                                                        > (           )
In file included from /home/pi/work/VC4C/lib/vc4asm/src/utils.h:185,
                 from /home/pi/work/VC4C/lib/vc4asm/src/expr.h:12,
                 from /home/pi/work/VC4C/lib/vc4asm/src/Validator.h:11,
                 from /home/pi/work/VC4C/src/Compiler.cpp:32:
/home/pi/work/VC4C/lib/vc4asm/src/Validator.MSG.h: In member function ‘const msgTemplateBase* ValidatorMSG::begin() const’:
/home/pi/work/VC4C/lib/vc4asm/src/Message.h:131:101: warning: use of old-style cast to ‘const struct msgTemplateBase*’ [-Wold-style-cast]
  131 |  const           msgTemplateBase* begin() const noexcept           { return (const msgTemplateBase*)this; } \
      |                                                                                                     ^~~~
/home/pi/work/VC4C/lib/vc4asm/src/Validator.MSG.h:54:2: note: in expansion of macro ‘MAKE_MSGTEMPLATE_CONTAINER’
   54 |  MAKE_MSGTEMPLATE_CONTAINER
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pi/work/VC4C/src/Compiler.cpp:32:
/home/pi/work/VC4C/lib/vc4asm/src/Validator.h: At global scope:
/home/pi/work/VC4C/lib/vc4asm/src/Validator.h:55:18: warning: ‘virtual std::string Validator::Message::toString() const’ can be marked override [-Wsuggest-override]
   55 |   virtual string toString() const noexcept;
      |                  ^~~~~~~~
/home/pi/work/VC4C/src/Compiler.cpp:179:49: error: ‘logging::LOGGER’ should have been declared inside ‘logging’
  179 | std::unique_ptr<logging::Logger> logging::LOGGER(new logging::ColoredLogger(std::wcout, logging::Level::WARNING));
      |                                                 ^
/home/pi/work/VC4C/src/Compiler.cpp: In function ‘void vc4c::setLogger(std::wostream&, bool, vc4c::LogLevel)’:
/home/pi/work/VC4C/src/Compiler.cpp:184:18: error: ‘LOGGER’ is not a member of ‘logging’; did you mean ‘logging::LOGGER’?
  184 |         logging::LOGGER.reset(new logging::ColoredLogger(outputStream, static_cast<logging::Level>(level)));
      |                  ^~~~~~
/home/pi/work/VC4C/src/Compiler.cpp:179:34: note: ‘logging::LOGGER’ declared here
  179 | std::unique_ptr<logging::Logger> logging::LOGGER(new logging::ColoredLogger(std::wcout, logging::Level::WARNING));
      |                                  ^~~~~~~
/home/pi/work/VC4C/src/Compiler.cpp:186:18: error: ‘LOGGER’ is not a member of ‘logging’; did you mean ‘logging::LOGGER’?
  186 |         logging::LOGGER.reset(new logging::StreamLogger(outputStream, static_cast<logging::Level>(level)));
      |                  ^~~~~~
/home/pi/work/VC4C/src/Compiler.cpp:179:34: note: ‘logging::LOGGER’ declared here
  179 | std::unique_ptr<logging::Logger> logging::LOGGER(new logging::ColoredLogger(std::wcout, logging::Level::WARNING));
      |                                  ^~~~~~~
In file included from /home/pi/work/VC4C/src/Values.h:10,
                 from /home/pi/work/VC4C/src/Locals.h:10,
                 from /home/pi/work/VC4C/src/BasicBlock.h:13,
                 from /home/pi/work/VC4C/src/Method.h:10,
                 from /home/pi/work/VC4C/src/Module.h:10,
                 from /home/pi/work/VC4C/src/Parser.h:10,
                 from /home/pi/work/VC4C/src/Compiler.cpp:10:
/home/pi/work/VC4C/src/Bitfield.h: In instantiation of ‘constexpr T vc4c::Bitfield<UnderlyingType>::getEntry(uint8_t, UnderlyingType) const [with T = vc4c::Signaling; UnderlyingType = long long unsigned int; uint8_t = unsigned char]’:
/home/pi/work/VC4C/src/asm/Instruction.h:55:13:   required from here
/home/pi/work/VC4C/src/Bitfield.h:74:69: warning: conversion from ‘long long unsigned int’ to ‘unsigned char’ may change value [-Wconversion]
   74 |             return static_cast<T>(static_cast<UnderlyingType>(mask) & getValue(pos));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/VC4CC.dir/build.make:121: src/CMakeFiles/VC4CC.dir/Compiler.cpp.o] Ошибка 1
make[1]: *** [CMakeFiles/Makefile2:607: src/CMakeFiles/VC4CC.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

How do I fix this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source