Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further errors on macOS: error: 'auto' not allowed in function prototype (and other errors) #28

Open
barracuda156 opened this issue Jan 6, 2023 · 3 comments

Comments

@barracuda156
Copy link

barracuda156 commented Jan 6, 2023

So we have updated the port to 1.7.1, however the build still fails on some versions of macOS.
There seem to be two distinct cases: 10.14–10.15 (compilation errors) and <10.10 (failure to clone ut-src repo).

Error on 10.15:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:192:26: error: 'auto' not allowed in function prototype
inline bool approx(const auto& x, const auto near, const double epsilon = 1.0e-8) {
                         ^~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:192:41: error: 'auto' not allowed in function prototype
inline bool approx(const auto& x, const auto near, const double epsilon = 1.0e-8) {
                                        ^~~~
2 errors generated.
make[2]: *** [unit_tests/CMakeFiles/ascent_test.dir/src/main.cpp.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/build'
make[1]: *** [unit_tests/CMakeFiles/ascent_test.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/build'
make: *** [all] Error 2

https://build.macports.org/builders/ports-10.15_x86_64-builder/builds/125684/steps/install-port/logs/stdio

Error on 10.14:

In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:188:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/build/_deps/ut-src/include/boost/ut.hpp:77:20: error: expected '{'
    namespace boost::inline ext::ut::inline v1_1_8 {
                   ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/build/_deps/ut-src/include/boost/ut.hpp:77:22: error: expected unqualified-id
    namespace boost::inline ext::ut::inline v1_1_8 {
                     ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:190:17: error: use of undeclared identifier 'boost'
using namespace boost::ut;
                ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:192:26: error: 'auto' not allowed in function prototype
inline bool approx(const auto& x, const auto near, const double epsilon = 1.0e-8) {
                         ^~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:192:41: error: 'auto' not allowed in function prototype
inline bool approx(const auto& x, const auto near, const double epsilon = 1.0e-8) {
                                        ^~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:196:1: error: unknown type name 'suite'
suite airy_system = []
^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:198:14: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "airy_rk4"_test = [] {
             ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:200:7: error: use of undeclared identifier 'boost'
      boost::ut::
      ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:205:14: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "airy_rk2"_test = [] {
             ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:211:18: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "airy_dopri45"_test = [] {
                 ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:218:1: error: unknown type name 'suite'
suite airy_modular = []
^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:220:22: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "airy_modular_rk4"_test = [] {
                     ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:226:22: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "airy_modular_rk2"_test = [] {
                     ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:232:24: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "airy_modular_pc233"_test = [] {
                       ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:239:1: error: unknown type name 'suite'
suite exponential = []
^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:241:13: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "exp_rk4"_test = [] {
            ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:246:13: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "exp_rk2"_test = [] {
            ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:251:17: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "exp_dopri45"_test = [] {
                ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_ascent/ascent/work/Ascent-0.7.1/unit_tests/src/main.cpp:256:15: error: no matching literal operator for call to 'operator""_test' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template
   "exp_pc233"_test = [] {
              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Error on 10.9:

[ 11%] Creating directories for 'ut-populate'
[ 22%] Performing download step (git clone) for 'ut-populate'
Cloning into 'ut-src'...
fatal: unable to access 'https://github.com/boost-ext/ut.git/': SSL certificate problem: Invalid certificate chain
Cloning into 'ut-src'...
fatal: unable to access 'https://github.com/boost-ext/ut.git/': SSL certificate problem: Invalid certificate chain
Cloning into 'ut-src'...
fatal: unable to access 'https://github.com/boost-ext/ut.git/': SSL certificate problem: Invalid certificate chain
-- Had to git clone more than once: 3 times.
CMake Error at ut-subbuild/ut-populate-prefix/tmp/ut-populate-gitclone.cmake:39 (message):
  Failed to clone repository: 'https://github.com/boost-ext/ut.git'


make[2]: *** [ut-populate-prefix/src/ut-populate-stamp/ut-populate-download] Error 1
make[1]: *** [CMakeFiles/ut-populate.dir/all] Error 2
make: *** [all] Error 2

Log: https://build.macports.org/builders/ports-10.9_x86_64-builder/builds/214658/steps/install-port/logs/stdio

Error on 10.7:

[ 22%] Performing download step (git clone) for 'ut-populate'
Cloning into 'ut-src'...
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/boost-ext/ut.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
Cloning into 'ut-src'...
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/boost-ext/ut.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
Cloning into 'ut-src'...
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/boost-ext/ut.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
-- Had to git clone more than once: 3 times.
CMake Error at ut-subbuild/ut-populate-prefix/tmp/ut-populate-gitclone.cmake:39 (message):
  Failed to clone repository: 'https://github.com/boost-ext/ut.git'


make[2]: *** [ut-populate-prefix/src/ut-populate-stamp/ut-populate-download] Error 1
make[1]: *** [CMakeFiles/ut-populate.dir/all] Error 2
make: *** [all] Error 2

Log: https://build.macports.org/builders/ports-10.7_x86_64-builder/builds/128390/steps/install-port/logs/stdio

General info on port health: https://ports.macports.org/port/ascent/details

@stephenberry @mwalcott3 Will these be possible to fix?

@mwalcott3
Copy link
Collaborator

To my knowledge 10.15 and earlier versions of macOS have reached end of life https://endoflife.date/macos so I'm not sure how important it is to support them.

10.15 could probably be fixed pretty easily if those are the only errors but it's likely Ascent will start using more modern c++ features in the future which will not be supported by older versions of macOS. Currently, most of this is concentrated in the test targets since the testing framework was recently changed over to boost::ut which uses some fairly modern c++20 features so I'm not entirely surprised the builds are failing. For the ones failing with certificate issues turning TLS_VERIFY or CMAKE_TLS_VERIFY off may help but those are even more unlikely to build anyways.

You could just disable the test targets by turning off BUILD_TESTING when calling cmake as a workaround.

@barracuda156
Copy link
Author

To my knowledge 10.15 and earlier versions of macOS have reached end of life https://endoflife.date/macos so I'm not sure how important it is to support them.

In Macports we support everything from 10.4.11 :)
Yes, those OS are actively used, even though user base may not be large.

10.15 could probably be fixed pretty easily if those are the only errors but it's likely Ascent will start using more modern c++ features in the future which will not be supported by older versions of macOS.

I have built ascent on 10.6.8 for ppc and all tests pass macports/macports-ports#17096 (comment)
C++17 is fully supported with GCC and C++20 is likely supported (if not fully yet, it will be). The latest GCC builds fine on every macOS starting from 10.5.8 (including ppc and ppc64).
On Intel systems MacPorts uses Clangs as default, and clang-14 builds on every Intel macOS starting at least from 10.6.8.
I do not see any problem here for any of archs, in principle.

Currently, most of this is concentrated in the test targets since the testing framework was recently changed over to boost::ut which uses some fairly modern c++20 features so I'm not entirely surprised the builds are failing.

I could try forcing a newer Clang to be used on those systems. (GCC is unlikely to be allowed for Intel as the default.)

For the ones failing with certificate issues turning TLS_VERIFY or CMAKE_TLS_VERIFY off may help but those are even more unlikely to build anyways.

Given 10.6.8 builds fine, all newer should build too.
I will try TLS_VERIFY. In fact, maybe I can switch to using Macports curl instead of system one, which is too old. My own Macports is built with its own curl, perhaps that is why it works fine for me on 10.6.8.

@mwalcott3
Copy link
Collaborator

mwalcott3 commented Jan 6, 2023

Yeah, when using ascent the biggest limitation is going to primarily be the compiler being used since there isn't really any architecture or platform-specific code in the base lib. If you can use a newer compiler like clang-14 it should be fine then. The build I clicked on was using AppleClang 11 which has spotty C++20 support. The compilation errors I saw were related to c++20 features like Abbreviated function templates or nested inline namespaces.

As a side note the ascent lib doesn't need to compile anything though since it's just a header-only lib. The tests and examples are the only things getting compiled and both can be disabled through CMake and are disabled by default if ascent isn't the primary CMake project. Additionally, the tests are the only things trying to pull in external dependencies. So if you are uninterested in running the tests you can just turn them off and just build the install target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants