GobySoft / goby

The Goby Underwater Autonomy Project
Other
26 stars 11 forks source link

Fixed building on RHEL/CentOS 8. #52

Open cgagner opened 4 years ago

cgagner commented 4 years ago

Fixed building on RHEL/CentOS 8. There were three main issues with compiling on RHEL/CentOS 8:

  1. boost::asio::io_service was deprecated in 1.66. The common/io_service.h header creates a typedefs io_context to io_service if the boost version is greater than or equal to 1.66.
  2. boost::asio::basic_stream_socket native() method deprecated in 1.47. The version of boost is checked when the native() is used and switches to native_handle() if the version is greater than 1.47.
  3. Using proj_api.h is deprecated. Added a define to src/CMakeLists.txt for ACCEPT_USE_OF_DEPRECATED_PROJ_API_H.

Tested on CentOS 7 and CentOS 8.

Fixes #51.

Additional Note:

tsaubergine commented 4 years ago

Thanks! This is conceptually very close to my implementation in Goby3:

https://github.com/GobySoft/goby3/commit/997168adfed8147d7ca933d05cb9dc7363f5e797

Could you cherry-pick that commit for the relevant parts (io_service)? I'd prefer that goby2 still cleanly merge into goby3.

I would also prefer that "#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H" be in the actual header, not set by CMake, so that downstream projects don't have to set it in their own build system.

See: https://github.com/GobySoft/goby3/commit/f2bf8e4432a7bd7ae6794713cbe020630ed531e3#diff-44d2cc23f56a2a4368a643e762156c8e

(this #define will also need to be added to https://github.com/GobySoft/goby/blob/2.1/src/moos/moos_geodesy.cpp)

Finally, since this is your first contribution to Goby, could you please sign the CLA by adding your name and email to https://github.com/GobySoft/goby/blob/2.1/AUTHORS and make that part of your PR?

Once you make these changes I'll merge this in. Thanks for your help!