Skip to content

[SYCL] Fix build in clean environment #4782

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

Merged
merged 3 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion devops/containers/ubuntu2004_base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

USER root

RUN apt update && apt install -yqq \
build-essential \
cmake \
ninja-build \
ccache \
git \
python3
python3 \
python3-distutils \
python-is-python3

RUN adduser --disabled-password --gecos '' sycl

COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh

ENTRYPOINT ["/docker_entrypoint.sh"]
8 changes: 8 additions & 0 deletions devops/scripts/docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if [ -d "$GITHUB_WORKSPACE" ]; then
chown -R sycl:sycl $GITHUB_WORKSPACE
su sycl
fi

exec "$@"
8 changes: 6 additions & 2 deletions xptifw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ option(XPTI_ENABLE_TBB "Enable TBB in the framework" OFF)

option(XPTI_ENABLE_WERROR OFF)

option(XPTI_BUILD_SAMPLES OFF)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that samples build failed due to -Werror option. Shouldn't we just disable it or there other issues as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like -Werror to still be enabled. It sometimes catches bugs. that would've go under radar otherwise. But samples are not installed or tested, so I just excluded them from general builds.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like -Werror to still be enabled. It sometimes catches bugs. that would've go under radar otherwise. But samples are not installed or tested, so I just excluded them from general builds.

I'm suggesting disabling this option only for samples producing warnings. Excluding them from build can lead to the broken build.

Anyway I don't think XPTI samples are critical, so I'm okay to leave this solution if disabling -Werror for these samples is not easy to implement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway I don't think XPTI samples are critical, so I'm okay to leave this solution if disabling -Werror for these samples is not easy to implement.

My intention is to eventually fix warnings properly and enable this option back under --ci-defaults, so that it is built regularly. But for now I just want to unblock my work on #4773


if (XPTI_ENABLE_WERROR)
if(MSVC)
set(CMAKE_CXX_FLAGS "/WX ${CMAKE_CXX_FLAGS}")
Expand Down Expand Up @@ -53,8 +55,10 @@ add_subdirectory(src)
add_custom_target(check-xptifw)

add_subdirectory(unit_test)
add_subdirectory(samples/basic_collector)
add_subdirectory(samples/syclpi_collector)
if (XPTI_BUILD_SAMPLES)
add_subdirectory(samples/basic_collector)
add_subdirectory(samples/syclpi_collector)
endif()

# The tests in basic_test are written using TBB, so these tests are enabled
# only if TBB has been enabled.
Expand Down