GMLC-TDC / HELICS

Hierarchical Engine for Large-scale Infrastructure Co-Simulation (HELICS)
https://docs.helics.org/en/latest/
BSD 3-Clause "New" or "Revised" License
126 stars 40 forks source link

helicsWebServer 3.5.2 won't build with GCC/12 #2658

Closed pdbj closed 5 months ago

pdbj commented 6 months ago

Describe the bug Building HELICS 3.5.2 fails, when the WebServer is enabled.

To Reproduce Configure with the web server Build with GCC/12.1.1

Environment (please complete the following information):

Additional context and information

Partial Error log:

/g/g17/barnes/Code/Helics/HELICS/src/helics/apps/helicsWebServer.cpp:508:35: error: ‘tcp_stream’ is not a member of ‘boost::beast’; did you mean ‘ostream’?
  508 |   websocket::stream<boost::beast::tcp_stream> ws;
      |                                   ^~~~~~~~~~
      |                                   ostream
/g/g17/barnes/Code/Helics/HELICS/src/helics/apps/helicsWebServer.cpp:508:45: error: template argument 1 is invalid
  508 |   websocket::stream<boost::beast::tcp_stream> ws;
      |                                             ^

/g/g17/barnes/Code/Helics/HELICS/src/helics/apps/helicsWebServer.cpp: In member function ‘void WebSocketsession::run()’:
/g/g17/barnes/Code/Helics/HELICS/src/helics/apps/helicsWebServer.cpp:523:30: error: ‘bind_front_handler’ is not a member of ‘beast’; did you mean ‘bind_handler’?
  523 |                       beast::bind_front_handler(&WebSocketsession::on_run, shared_from_this()));
      |                              ^~~~~~~~~~~~~~~~~~
      |                              bind_handler

/g/g17/barnes/Code/Helics/HELICS/src/helics/apps/helicsWebServer.cpp:530:34: error: ‘websocket::stream_base’ has not been declared
  530 |         ws.set_option(websocket::stream_base::timeout::suggested(beast::role_type::server));
      |                                  ^~~~~~~~~~~
/g/g17/barnes/Code/Helics/HELICS/src/helics/apps/helicsWebServer.cpp:530:73: error: ‘beast::role_type’ has not been declared
  530 |         ws.set_option(websocket::stream_base::timeout::suggested(beast::role_type::server));
      |                                                                         ^~~~~~~~~
/g/g17/barnes/Code/Helics/HELICS/src/helics/apps/helicsWebServer.cpp:791:12: error: ‘tcp_stream’ in namespace ‘beast’ does not name a type; did you mean ‘ostream’?
  791 |     beast::tcp_stream stream;
      |            ^~~~~~~~~~
      |            ostream

Very much not obvious to me why these fail.

phlptp commented 6 months ago

Can you double check which version of boost you are using? GCC 12 made a few changes to the headers, which is one possibility, the other is older versions of boost could potentially have the same issue.

pdbj commented 5 months ago

Thanks, that was the hint I needed. Mish mash of boost 1.80 and 1.67, due to multiple projects in my environment.

Closing as user error.