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

Fix google benchmarks interaction with CXXFLAGS with -fsycl #149

Closed
wants to merge 1 commit into from

Conversation

hjabird
Copy link
Contributor

@hjabird hjabird commented Aug 12, 2024

  • The Google Benchmark code does not work if CMAKE_CXX_FLAGS include -fsycl due to conflicting C++ version requirements.
  • This removes the external CXX flags for the Google Benchmark library build.
  • Also update Google Benchmark version tag.

Checklist

Tick if relevant:

  • [N/A] New files have a copyright
  • [N/A] New headers have an include guards
  • [N/A] API is documented with Doxygen
  • New functionalities are tested
  • [N/A] Tests pass locally
  • [N/A] Files are clang-formatted

…gle benchmark version

* The Google Benchmark code does not work if CMAKE_CXX_FLAGS include -fsycl due to conflicting
  C++ version requirements.
* This removes the external CXX flags for the Google Benchmark library build.
* Also update Google Benchmark version tag.
@Rbiessy
Copy link
Collaborator

Rbiessy commented Aug 16, 2024

Can you clarify which error do you get without this fix?

@hjabird
Copy link
Contributor Author

hjabird commented Aug 16, 2024

You get the error:

/opt/intel/oneapi/compiler/2024.1/bin/icpx -DBENCHMARK_STATIC_DEFINE -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -I/builds/hugh.bird/sycl-fft/build/_deps/googlebenchmark-src/include -I/builds/hugh.bird/sycl-fft/build/_deps/googlebenchmark-src/src -Ofast -ferror-limit=5 -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030  -Wall  -Wextra  -Wshadow  -Wfloat-equal  -Wsuggest-override  -pedantic  -pedantic-errors  -Wshorten-64-to-32  -fstrict-aliasing  -Wno-deprecated-declarations  -Wstrict-aliasing  -Wthread-safety -O3 -DNDEBUG -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -pthread -MD -MT _deps/googlebenchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o -MF _deps/googlebenchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o.d -o _deps/googlebenchmark-build/src/CMakeFiles/benchmark.dir/benchmark.cc.o -c /builds/hugh.bird/sycl-fft/build/_deps/googlebenchmark-src/src/benchmark.cc
In file included from /builds/hugh.bird/sycl-fft/build/_deps/googlebenchmark-src/src/benchmark.cc:17:
In file included from /builds/hugh.bird/sycl-fft/build/_deps/googlebenchmark-src/src/benchmark_api_internal.h:4:
In file included from /opt/intel/oneapi/compiler/2024.1/bin/compiler/../../include/sycl/stl_wrappers/cmath:32:
/opt/intel/oneapi/compiler/2024.1/bin/compiler/../../include/sycl/detail/defines_elementary.hpp:81:15: error: static assertion failed due to requirement '201103L >= 201703L': DPCPP does not support C++ version earlier than C++17.
   81 | static_assert(__cplusplus >= 201703L,
      |               ^~~~~~~~~~~~~~~~~~~~~~
<built-in>:829:21: note: expanded from macro '__cplusplus'
  829 | #define __cplusplus 201103L

when adding extra cmake flags, eg:

export CXXFLAGS="-Ofast -ferror-limit=5 -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030"

@Rbiessy
Copy link
Collaborator

Rbiessy commented Aug 16, 2024

I don't understand why are we facing this issue now? This used to build fine. Is this a global issue with DPC++ and Google Benchmark?
I can see their CMake checks the compiler ID for some flags so maybe we could create a PR in Google Benchmark if needed?

@hjabird
Copy link
Contributor Author

hjabird commented Aug 16, 2024

After some discussion this probably isn't the best path forward. In the short-term, we have a work-around for where this is a problem for us. If this becomes a problem in another context, other alternatives can be explored, eg. PORTFFT_SYCL_FLAGS or something.

@hjabird hjabird closed this Aug 16, 2024
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

Successfully merging this pull request may close these issues.

3 participants