EVerest / everest-core

Apache License 2.0
90 stars 68 forks source link

Everest-core Compilation Failure with EvseManager.hpp #660

Open qtivijay opened 4 months ago

qtivijay commented 4 months ago

Describe the bug

Trying to compile Everest-core using below steps cd {EVerest Workspace Directory}/everest-core mkdir build cd build cmake .. make install

make install is failing with below error

Error : 76%] Building CXX object modules/CMakeFiles/EvseManager.dir/EvseManager/EvseManager.cpp.o In file included from /home/gvijay/everest-dev-environment/everest-core/modules/EvseManager/EvseManager.cpp:3: /home/gvijay/everest-dev-environment/everest-core/modules/EvseManager/EvseManager.hpp: In constructor ‘module::EvseManager::EvseManager(const ModuleInfo&, Everest::MqttProvider&, Everest::TelemetryProvider&, std::unique_ptr, std::unique_ptr, std::unique_ptr, std::unique_ptr, std::unique_ptr, std::vector<std::unique_ptr >, std::vector<std::unique_ptr >, std::vector<std::unique_ptr >, std::vector<std::unique_ptr >, std::vector<std::unique_ptr >, std::vector<std::unique_ptr >, std::vector<std::unique_ptr >, std::vector<std::unique_ptr >, module::Conf&)’: /home/gvijay/everest-dev-environment/everest-core/modules/EvseManager/EvseManager.hpp:126:22: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ 126 | config(config){}; | ^ In file included from /usr/include/c++/9/future:42, from /home/gvijay/everest-dev-environment/everest-framework/include/framework/everest.hpp:7, from /home/gvijay/everest-dev-environment/everest-framework/include/framework/ModuleAdapter.hpp:6, from /home/gvijay/everest-dev-environment/everest-core/build/generated/modules/EvseManager/ld-ev.hpp:11, from /home/gvijay/everest-dev-environment/everest-core/modules/EvseManager/EvseManager.hpp:11, from /home/gvijay/everest-dev-environment/everest-core/modules/EvseManager/EvseManager.cpp:3: /usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’ 198 | atomic() noexcept = default; | ^~ make[2]: [modules/CMakeFiles/EvseManager.dir/build.make:70: modules/CMakeFiles/EvseManager.dir/EvseManager/EvseManager.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:5116: modules/CMakeFiles/EvseManager.dir/all] Error 2 make: *** [Makefile:152: all] Error 2

EVerest Domain

Other

Affected EVerest Module

everest-core

To Reproduce

No response

Anything else?

No response

hikinggrass commented 3 months ago

Which compiler (and version) are you using?

qtivijay commented 3 months ago

Which compiler (and version) are you using? CMAKE_CXX_COMPILER '/usr/bin/c++' 'GNU' '9.4.0'

barsnick commented 3 months ago

It's probably the issue described here: https://stackoverflow.com/questions/64393225/why-cant-a-stdatomic-of-a-stdchrono-time-point-member-variable-be-default-c with g++-8 and g++-9 - presumably a bug in the compiler or libstdc++.

According to that, this variable needs to be initialized: https://github.com/EVerest/everest-core/blob/43cccb62dd2f1f93b41efd9e757d913f0767bac0/modules/EvseManager/EvseManager.hpp#L192 (Untested.)

Can we clone the CI to also compile with Ubuntu 20? The docs do say "Tested with Ubuntu 20.04 and 22.04.".