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

Unable to compile Catch2 version 3.x.x using Intel 2019 compiler #2551

Closed
kbthomp1 opened this issue Oct 18, 2022 · 2 comments · Fixed by #2766
Closed

Unable to compile Catch2 version 3.x.x using Intel 2019 compiler #2551

kbthomp1 opened this issue Oct 18, 2022 · 2 comments · Fixed by #2766

Comments

@kbthomp1
Copy link

Describe the bug

Compiling Catch devel, 3.1.0, and 3.1.0 using the intel 2019 compiler:

$ icpc --version
icpc (ICC) 19.0.5.281 20190815
Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

yields the following error:

/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/catch_optimizer.hpp(66): error: expression preceding parentheses of apparent call must have (pointer-to-) function type
              CATCH_FORWARD(fn) (CATCH_FORWARD(args)...);
              ^
          detected during:
            instantiation of "void Catch::Benchmark::Chronometer::measure(Fun &&, std::true_type) [with Fun=lambda [](int)->void]" at line 57 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/catch_chronometer.hpp"
            instantiation of "void Catch::Benchmark::Chronometer::measure(Fun &&, std::false_type) [with Fun=const Catch::Benchmark::Detail::BenchmarkFunction::do_nothing &]" at line 46 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/catch_chronometer.hpp"
            instantiation of "void Catch::Benchmark::Chronometer::measure(Fun &&) [with Fun=const Catch::Benchmark::Detail::BenchmarkFunction::do_nothing &]" at line 62 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/detail/catch_benchmark_function.hpp"
            instantiation of "void Catch::Benchmark::Detail::BenchmarkFunction::model<Fun>::call(Catch::Benchmark::Chronometer, std::false_type) const [with Fun=Catch::Benchmark::Detail::BenchmarkFunction::do_nothing]" at line 56 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/detail/catch_benchmark_function.hpp"
            instantiation of "void Catch::Benchmark::Detail::BenchmarkFunction::model<Fun>::call(Catch::Benchmark::Chronometer) const [with Fun=Catch::Benchmark::Detail::BenchmarkFunction::do_nothing]" at line 48 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/detail/catch_benchmark_function.hpp"
            implicit generation of "Catch::Benchmark::Detail::BenchmarkFunction::model<Fun>::~model() [with Fun=Catch::Benchmark::Detail::BenchmarkFunction::do_nothing]" at line 48 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/detail/catch_benchmark_function.hpp"
            instantiation of class "Catch::Benchmark::Detail::BenchmarkFunction::model<Fun> [with Fun=Catch::Benchmark::Detail::BenchmarkFunction::do_nothing]" at line 48 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/detail/catch_benchmark_function.hpp"
            instantiation of "Catch::Benchmark::Detail::BenchmarkFunction::model<Fun>::model(Fun &&) [with Fun=Catch::Benchmark::Detail::BenchmarkFunction::do_nothing]" at line 75 of "/hpnobackup2/kbthomp1/Catch2/src/catch2/../catch2/benchmark/detail/catch_benchmark_function.hpp"

compilation aborted for /hpnobackup2/kbthomp1/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.cpp (code 2)

Expected behavior
Using the default cmake configuration, the Catch2 library can be built using LLVM 14.0, gcc 6.2.0/8.3.0, and intel oneAPI version 2021.3.0 20210609, but fails to compile with the intel 19.0.5.281 20190815 compiler listed above.

Reproduction steps
Configured without extra arguments to cmake, i.e.:

cd Catch2
mkdir build
cmake ..
make

Platform information:

  • OS: Centos 7
  • Compiler+version: Intel compiler version 19.0.5.281 20190815
  • Catch version: v3.1.1
@horenmar
Copy link
Member

I am willing to merge a PR with reasonable workaround, but otherwise my advice is to use a better compiler.

@VictorEijkhout
Copy link

Same problem on Intel 19.1.0.20200306

And "use a better compiler" is easier said then done if you're on a 10 thousand node supercomputer where you support dozens of packages: upgrading a compiler is a multi-week undertaking that is not undertaken lightly. Intel 19.1.1 was until very recently the most stable Intel compiler. I understand that it's not part of your CI workflow?

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

Successfully merging a pull request may close this issue.

3 participants