altillimity / AltiWx

Yet another automated SDR-based station software
35 stars 11 forks source link

multiple errors while building #3

Closed etamtlosz closed 3 years ago

etamtlosz commented 3 years ago

I'm trying to install AltiWx in a debian container running proxmox. The container has allocated 16GB of RAM and 4 cores and 16GB of SSD hard drive.

I've followed the steps from "Raspbian / Debian installation guide". I get the following errors while trying to build AltiWx. Everything else ran OK.

root@altiwx:~/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/build# make -j4
[ 12%] Built target SamplePlugin
[ 16%] Building CXX object CMakeFiles/AltiWx.dir/src/dsp/dsp.cpp.o
[ 20%] Building CXX object CMakeFiles/AltiWx.dir/src/logger/logger.cpp.o
[ 24%] Building CXX object CMakeFiles/AltiWx.dir/src/main.cpp.o
[ 28%] Building CXX object CMakeFiles/AltiWx.dir/src/orbit/doppler_correction.cpp.o
[ 32%] Building CXX object CMakeFiles/AltiWx.dir/src/orbit/orbit_predictor.cpp.o
In file included from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.cpp:1:
/root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.h:10:21: error: expected identifier before numeric constant
 #define BUFFER_SIZE 8192
                     ^~~~
/root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.h:10:21: error: expected '}' before numeric constant
In file included from /usr/include/spdlog/fmt/fmt.h:21,
                 from /usr/include/spdlog/common.h:28,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/logger/logger.h:3,
                 from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.cpp:2:
/usr/include/spdlog/fmt/bundled/format.h:2817:8: note: to match this '{'
   enum {BUFFER_SIZE = std::numeric_limits<unsigned long long>::digits10 + 3};
        ^
In file included from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.cpp:1:
/root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.h:10:21: error: expected unqualified-id before numeric constant
 #define BUFFER_SIZE 8192
                     ^~~~
In file included from /usr/include/spdlog/fmt/fmt.h:21,
                 from /usr/include/spdlog/common.h:28,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/logger/logger.h:3,
                 from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.cpp:2:
/usr/include/spdlog/fmt/bundled/format.h:2818:35: error: non-member 'buffer_' cannot be declared 'mutable'
   mutable char buffer_[BUFFER_SIZE];
                                   ^
/usr/include/spdlog/fmt/bundled/format.h:2853:2: error: expected unqualified-id before 'public'
  public:
  ^~~~~~
/usr/include/spdlog/fmt/bundled/format.h:2855:3: error: 'explicit' outside class declaration
   explicit format_int(long value) { format_signed(value); }
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h:2856:3: error: 'explicit' outside class declaration
   explicit format_int(long long value) { format_signed(value); }
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h:2857:3: error: 'explicit' outside class declaration
   explicit format_int(unsigned value) : str_(format_decimal(value)) {}
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h: In function 'int fmt::v5::format_int(unsigned int)':
/usr/include/spdlog/fmt/bundled/format.h:2857:41: error: only constructors take member initializers
   explicit format_int(unsigned value) : str_(format_decimal(value)) {}
                                         ^~~~
/usr/include/spdlog/fmt/bundled/format.h: At global scope:
/usr/include/spdlog/fmt/bundled/format.h:2858:3: error: 'explicit' outside class declaration
   explicit format_int(unsigned long value) : str_(format_decimal(value)) {}
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h: In function 'int fmt::v5::format_int(long unsigned int)':
/usr/include/spdlog/fmt/bundled/format.h:2858:46: error: only constructors take member initializers
   explicit format_int(unsigned long value) : str_(format_decimal(value)) {}
                                              ^~~~
/usr/include/spdlog/fmt/bundled/format.h: At global scope:
/usr/include/spdlog/fmt/bundled/format.h:2859:3: error: 'explicit' outside class declaration
   explicit format_int(unsigned long long value) : str_(format_decimal(value)) {}
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h: In function 'int fmt::v5::format_int(long long unsigned int)':
/usr/include/spdlog/fmt/bundled/format.h:2859:51: error: only constructors take member initializers
   explicit format_int(unsigned long long value) : str_(format_decimal(value)) {}
                                                   ^~~~
/usr/include/spdlog/fmt/bundled/format.h: At global scope:
/usr/include/spdlog/fmt/bundled/format.h:2862:22: error: non-member function 'std::size_t fmt::v5::size()' cannot have cv-qualifier
   std::size_t size() const {
                      ^~~~~
/usr/include/spdlog/fmt/bundled/format.h:2870:22: error: non-member function 'const char* fmt::v5::data()' cannot have cv-qualifier
   const char *data() const { return str_; }
                      ^~~~~
/usr/include/spdlog/fmt/bundled/format.h:2876:23: error: non-member function 'const char* fmt::v5::c_str()' cannot have cv-qualifier
   const char *c_str() const {
                       ^~~~~
/usr/include/spdlog/fmt/bundled/format.h:2886:21: error: non-member function 'std::__cxx11::string fmt::v5::str()' cannot have cv-qualifier
   std::string str() const { return std::string(str_, size()); }
                     ^~~~~
In file included from /usr/include/spdlog/fmt/fmt.h:20,
                 from /usr/include/spdlog/common.h:28,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/logger/logger.h:3,
                 from /root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/dsp/dsp.cpp:2:
/usr/include/spdlog/fmt/bundled/format.h:3511:1: error: expected declaration before '}' token
 FMT_END_NAMESPACE
 ^~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/AltiWx.dir/build.make:89: CMakeFiles/AltiWx.dir/src/dsp/dsp.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/main.cpp: In function 'int main(int, char**)':
/root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/main.cpp:18:14: warning: unused parameter 'argc' [-Wunused-parameter]
 int main(int argc, char *argv[])
          ~~~~^~~~
/root/libpredict/build/libdsp/build/yaml-cpp/build/AltiWx/src/main.cpp:18:26: warning: unused parameter 'argv' [-Wunused-parameter]
 int main(int argc, char *argv[])
                    ~~~~~~^~~~~~
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/AltiWx.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Aang23 commented 3 years ago

Weird... What Debian / gcc version are you using?

I have seen some issues with Debian's libfmt / spdlog in the past, building spdlog from source could potentially be a fix, judging by what I see here.

etamtlosz commented 3 years ago

I've created my Debian container using this official proxmox image "debian-10-standard_10.7-1_amd64.tar.gz", using gcc (Debian 8.3.0-6) 8.3.0.

I gave up on the container install and switched to virtual machine (still running on proxmox), compiled spdlog from here -> https://github.com/gabime/spdlog

I'm getting a similar error:

altiwx@altiwx:~/AltiWx/build$ make -j4
Scanning dependencies of target NoaaDSB
Scanning dependencies of target SamplePlugin
Scanning dependencies of target AltiWx
[  3%] Building CXX object plugins/noaa-dsb/CMakeFiles/NoaaDSB.dir/src/deframer.cpp.o
[  9%] Building CXX object plugins/sample/CMakeFiles/SamplePlugin.dir/src/main.cpp.o
[  9%] Building CXX object plugins/sample/CMakeFiles/SamplePlugin.dir/src/modem_useless.cpp.o
[ 12%] Building CXX object CMakeFiles/AltiWx.dir/src/api/altiwx.cpp.o
/home/altiwx/AltiWx/plugins/noaa-dsb/src/deframer.cpp: In member function ‘std::vector<std::array<unsigned char, 104> > DSBDeframer::work(uint8_t*, size_t)’:
/home/altiwx/AltiWx/plugins/noaa-dsb/src/deframer.cpp:61:39: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
     for (int byteInBuf = 0; byteInBuf < size; byteInBuf++)
                             ~~~~~~~~~~^~~~~~
[ 16%] Building CXX object plugins/noaa-dsb/CMakeFiles/NoaaDSB.dir/src/main.cpp.o
[ 19%] Building CXX object CMakeFiles/AltiWx.dir/src/config/config.cpp.o
/home/altiwx/AltiWx/plugins/sample/src/modem_useless.cpp: In member function ‘virtual void ModemUseless::work(std::complex<float>*, int)’:
/home/altiwx/AltiWx/plugins/sample/src/modem_useless.cpp:12:46: warning: unused parameter ‘buffer’ [-Wunused-parameter]
 void ModemUseless::work(std::complex<float> *buffer, int length)
                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/altiwx/AltiWx/plugins/sample/src/modem_useless.cpp:12:58: warning: unused parameter ‘length’ [-Wunused-parameter]
 void ModemUseless::work(std::complex<float> *buffer, int length)
                                                      ~~~~^~~~~~
[ 22%] Building CXX object CMakeFiles/AltiWx.dir/src/dsp/dsp.cpp.o
/home/altiwx/AltiWx/plugins/sample/src/main.cpp: In lambda function:
/home/altiwx/AltiWx/plugins/sample/src/main.cpp:24:120: warning: unused parameter ‘evt’ [-Wunused-parameter]
         altiwx::eventBus->register_handler<altiwx::events::StartedEvent>([&logger](const altiwx::events::StartedEvent &evt) {
                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/home/altiwx/AltiWx/plugins/sample/src/main.cpp: In member function ‘virtual void Sample::init(std::shared_ptr<spdlog::logger>&)’:
/home/altiwx/AltiWx/plugins/sample/src/main.cpp:26:10: warning: ignoring return value of ‘dp::handler_registration dp::event_bus::register_handler(EventHandler&&) [with EventType = altiwx::events::StartedEvent; EventHandler = Sample::init(std::shared_ptr<spdlog::logger>&)::<lambda(const altiwx::events::Start                     edEvent&)>]’, declared with attribute nodiscard [-Wunused-result]
         });
          ^
In file included from /home/altiwx/AltiWx/src/api/altiwx/altiwx.h:2,
                 from /home/altiwx/AltiWx/src/api/altiwx/plugin.h:2,
                 from /home/altiwx/AltiWx/plugins/sample/src/main.cpp:1:
/home/altiwx/AltiWx/src/api/eventbus/event_bus.hpp:24:44: note: declared here
         [[nodiscard]] handler_registration register_handler(EventHandler &&handler)
                                            ^~~~~~~~~~~~~~~~
/home/altiwx/AltiWx/plugins/sample/src/main.cpp:32:10: warning: ignoring return value of ‘dp::handler_registration dp::event_bus::register_handler(EventHandler&&) [with EventType = altiwx::events::RegisterModemsEvent; EventHandler = Sample::init(std::shared_ptr<spdlog::logger>&)::<lambda(const altiwx::events                     ::RegisterModemsEvent&)>]’, declared with attribute nodiscard [-Wunused-result]
         });
          ^
In file included from /home/altiwx/AltiWx/src/api/altiwx/altiwx.h:2,
                 from /home/altiwx/AltiWx/src/api/altiwx/plugin.h:2,
                 from /home/altiwx/AltiWx/plugins/sample/src/main.cpp:1:
/home/altiwx/AltiWx/src/api/eventbus/event_bus.hpp:24:44: note: declared here
         [[nodiscard]] handler_registration register_handler(EventHandler &&handler)
                                            ^~~~~~~~~~~~~~~~
/home/altiwx/AltiWx/plugins/noaa-dsb/src/main.cpp: In lambda function:
/home/altiwx/AltiWx/plugins/noaa-dsb/src/main.cpp:24:120: warning: unused parameter ‘evt’ [-Wunused-parameter]
         altiwx::eventBus->register_handler<altiwx::events::StartedEvent>([&logger](const altiwx::events::StartedEvent &evt) {
                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/home/altiwx/AltiWx/plugins/noaa-dsb/src/main.cpp: In member function ‘virtual void NoaaDSB::init(std::shared_ptr<spdlog::logger>&)’:
/home/altiwx/AltiWx/plugins/noaa-dsb/src/main.cpp:26:10: warning: ignoring return value of ‘dp::handler_registration dp::event_bus::register_handler(EventHandler&&) [with EventType = altiwx::events::StartedEvent; EventHandler = NoaaDSB::init(std::shared_ptr<spdlog::logger>&)::<lambda(const altiwx::events::St                     artedEvent&)>]’, declared with attribute nodiscard [-Wunused-result]
         });
          ^
In file included from /home/altiwx/AltiWx/src/api/altiwx/altiwx.h:2,
                 from /home/altiwx/AltiWx/src/api/altiwx/plugin.h:2,
                 from /home/altiwx/AltiWx/plugins/noaa-dsb/src/main.cpp:1:
/home/altiwx/AltiWx/src/api/eventbus/event_bus.hpp:24:44: note: declared here
         [[nodiscard]] handler_registration register_handler(EventHandler &&handler)
                                            ^~~~~~~~~~~~~~~~
/home/altiwx/AltiWx/plugins/noaa-dsb/src/main.cpp:32:10: warning: ignoring return value of ‘dp::handler_registration dp::event_bus::register_handler(EventHandler&&) [with EventType = altiwx::events::RegisterModemsEvent; EventHandler = NoaaDSB::init(std::shared_ptr<spdlog::logger>&)::<lambda(const altiwx::eve                     nts::RegisterModemsEvent&)>]’, declared with attribute nodiscard [-Wunused-result]
         });
          ^
In file included from /home/altiwx/AltiWx/src/api/altiwx/altiwx.h:2,
                 from /home/altiwx/AltiWx/src/api/altiwx/plugin.h:2,
                 from /home/altiwx/AltiWx/plugins/noaa-dsb/src/main.cpp:1:
/home/altiwx/AltiWx/src/api/eventbus/event_bus.hpp:24:44: note: declared here
         [[nodiscard]] handler_registration register_handler(EventHandler &&handler)
                                            ^~~~~~~~~~~~~~~~
In file included from /home/altiwx/AltiWx/src/dsp/dsp.cpp:1:
/home/altiwx/AltiWx/src/dsp/dsp.h:10:21: error: expected identifier before numeric constant
 #define BUFFER_SIZE 8192
                     ^~~~
/home/altiwx/AltiWx/src/dsp/dsp.h:10:21: error: expected ‘}’ before numeric constant
In file included from /usr/include/spdlog/fmt/fmt.h:21,
                 from /usr/include/spdlog/common.h:28,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /home/altiwx/AltiWx/src/logger/logger.h:3,
                 from /home/altiwx/AltiWx/src/dsp/dsp.cpp:2:
/usr/include/spdlog/fmt/bundled/format.h:2817:8: note: to match this ‘{’
   enum {BUFFER_SIZE = std::numeric_limits<unsigned long long>::digits10 + 3};
        ^
In file included from /home/altiwx/AltiWx/src/dsp/dsp.cpp:1:
/home/altiwx/AltiWx/src/dsp/dsp.h:10:21: error: expected unqualified-id before numeric constant
 #define BUFFER_SIZE 8192
                     ^~~~
In file included from /usr/include/spdlog/fmt/fmt.h:21,
                 from /usr/include/spdlog/common.h:28,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /home/altiwx/AltiWx/src/logger/logger.h:3,
                 from /home/altiwx/AltiWx/src/dsp/dsp.cpp:2:
/usr/include/spdlog/fmt/bundled/format.h:2818:35: error: non-member ‘buffer_’ cannot be declared ‘mutable’
   mutable char buffer_[BUFFER_SIZE];
                                   ^
/usr/include/spdlog/fmt/bundled/format.h:2853:2: error: expected unqualified-id before ‘public’
  public:
  ^~~~~~
/usr/include/spdlog/fmt/bundled/format.h:2855:3: error: ‘explicit’ outside class declaration
   explicit format_int(long value) { format_signed(value); }
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h:2856:3: error: ‘explicit’ outside class declaration
   explicit format_int(long long value) { format_signed(value); }
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h:2857:3: error: ‘explicit’ outside class declaration
   explicit format_int(unsigned value) : str_(format_decimal(value)) {}
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h: In function ‘int fmt::v5::format_int(unsigned int)’:
/usr/include/spdlog/fmt/bundled/format.h:2857:41: error: only constructors take member initializers
   explicit format_int(unsigned value) : str_(format_decimal(value)) {}
                                         ^~~~
/usr/include/spdlog/fmt/bundled/format.h: At global scope:
/usr/include/spdlog/fmt/bundled/format.h:2858:3: error: ‘explicit’ outside class declaration
   explicit format_int(unsigned long value) : str_(format_decimal(value)) {}
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h: In function ‘int fmt::v5::format_int(long unsigned int)’:
/usr/include/spdlog/fmt/bundled/format.h:2858:46: error: only constructors take member initializers
   explicit format_int(unsigned long value) : str_(format_decimal(value)) {}
                                              ^~~~
/usr/include/spdlog/fmt/bundled/format.h: At global scope:
/usr/include/spdlog/fmt/bundled/format.h:2859:3: error: ‘explicit’ outside class declaration
   explicit format_int(unsigned long long value) : str_(format_decimal(value)) {}
   ^~~~~~~~
/usr/include/spdlog/fmt/bundled/format.h: In function ‘int fmt::v5::format_int(long long unsigned int)’:
/usr/include/spdlog/fmt/bundled/format.h:2859:51: error: only constructors take member initializers
   explicit format_int(unsigned long long value) : str_(format_decimal(value)) {}
                                                   ^~~~
/usr/include/spdlog/fmt/bundled/format.h: At global scope:
/usr/include/spdlog/fmt/bundled/format.h:2862:22: error: non-member function ‘std::size_t fmt::v5::size()’ cannot have cv-qualifier
   std::size_t size() const {
                      ^~~~~
/usr/include/spdlog/fmt/bundled/format.h:2870:22: error: non-member function ‘const char* fmt::v5::data()’ cannot have cv-qualifier
   const char *data() const { return str_; }
                      ^~~~~
/usr/include/spdlog/fmt/bundled/format.h:2876:23: error: non-member function ‘const char* fmt::v5::c_str()’ cannot have cv-qualifier
   const char *c_str() const {
                       ^~~~~
/usr/include/spdlog/fmt/bundled/format.h:2886:21: error: non-member function ‘std::__cxx11::string fmt::v5::str()’ cannot have cv-qualifier
   std::string str() const { return std::string(str_, size()); }
                     ^~~~~
In file included from /usr/include/spdlog/fmt/fmt.h:20,
                 from /usr/include/spdlog/common.h:28,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /home/altiwx/AltiWx/src/logger/logger.h:3,
                 from /home/altiwx/AltiWx/src/dsp/dsp.cpp:2:
/usr/include/spdlog/fmt/bundled/format.h:3511:1: error: expected declaration before ‘}’ token
 FMT_END_NAMESPACE
 ^~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/AltiWx.dir/build.make:89: CMakeFiles/AltiWx.dir/src/dsp/dsp.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 25%] Building CXX object plugins/noaa-dsb/CMakeFiles/NoaaDSB.dir/src/manchester.cpp.o
[ 29%] Building CXX object plugins/noaa-dsb/CMakeFiles/NoaaDSB.dir/src/modem_dsb.cpp.o
[ 32%] Building CXX object plugins/noaa-dsb/CMakeFiles/NoaaDSB.dir/src/repack_bits_byte.cpp.o
/home/altiwx/AltiWx/plugins/noaa-dsb/src/repack_bits_byte.cpp: In member function ‘size_t RepackBitsByte::work(uint8_t*, size_t, uint8_t*)’:
/home/altiwx/AltiWx/plugins/noaa-dsb/src/repack_bits_byte.cpp:7:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
     for (int ii = 0; ii < length; ii++)
                      ~~~^~~~~~~~
[ 35%] Linking CXX shared library libSamplePlugin.so
[ 35%] Built target SamplePlugin
[ 38%] Linking CXX shared library libNoaaDSB.so
[ 38%] Built target NoaaDSB
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/AltiWx.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

fmt version

altiwx@altiwx:~/AltiWx/build$ fmt --version
fmt (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Ross Paterson.
Aang23 commented 3 years ago

I tried to build AltiWx in the exact same scenario, a Debian 10 VM running on my Proxmox instance (even if this definitely has nothing to do with the VM itself).

Turns out the issue is that older FMT versions utilizes a BUFFER_SIZE macro as well, messing up with AltiWx's, so I renamed it and now everything works with the instructions in the README. Thanks for reporting!

https://github.com/altillimity/AltiWx/commit/9ce5bd25b2d0c90fa7aee2079b03205a37a9fea7 https://github.com/altillimity/AltiWx/commit/b1294f19d10c832a51881e0bd7fe46ea9c64c6d6