encryptogroup / MOTION

An efficient, user-friendly, modular, and extensible framework for mixed-protocol secure multi-party computation with two or more parties
MIT License
85 stars 40 forks source link

Fix: remove -ansi compile flag #37

Closed robinhundt closed 1 year ago

robinhundt commented 1 year ago

MOTION suddenly stopped compiling for me after a system update with very weird errors such as

error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

This was especially confusing, as I confirmed that g++ is called with std=gnu++20. After much head scratching I noticed that g++ is also called with the -ansi flag, which In C++ mode, it is equivalent to -std=c++98. (man g++).

My best guess is, that an update of cmake lead to the std= and -ansi options being emitted in a different order. For me, -ansi is emitted after std=, which seems to override it (godbolt example). If the order is reversed, it works (godbolt example).

This PR removes the -ansi flag as it does nothing at best, and causes the build to fail at worst.