Skip to content

Commit 21f68b8

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into bump-cb
2 parents 38389f5 + 8b4629c commit 21f68b8

File tree

15 files changed

+183
-45
lines changed

15 files changed

+183
-45
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -286,20 +286,9 @@ jobs:
286286

287287
- name: Install utilities
288288
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
289-
# TODO replace utility installation with a single CMake target
290289
run: |
291-
cmake --build $GITHUB_WORKSPACE/build --target utils/FileCheck/install
292-
cmake --build $GITHUB_WORKSPACE/build --target utils/count/install
293-
cmake --build $GITHUB_WORKSPACE/build --target utils/not/install
294-
cmake --build $GITHUB_WORKSPACE/build --target utils/lit/install
295-
cmake --build $GITHUB_WORKSPACE/build --target utils/llvm-lit/install
296-
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-size
297-
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-cov
298-
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-profdata
299-
cmake --build $GITHUB_WORKSPACE/build --target install-compiler-rt
300-
# This is required to perform the DeviceConfigFile consistency test, see
301-
# sycl/test-e2e/Basic/device_config_file_consistency.cpp.
302-
cmake --install $GITHUB_WORKSPACE/build --component DeviceConfigFile
290+
cmake --build $GITHUB_WORKSPACE/build --target install-sycl-test-utilities
291+
303292
- name: Additional Install for "--shared-libs" build
304293
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && contains(inputs.build_configure_extra_args, '--shared-libs') }}
305294
run: |

.github/workflows/sycl-ur-perf-benchmarking.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ jobs:
160160
uses: ./.github/workflows/sycl-linux-run-tests.yml
161161
secrets: inherit
162162
with:
163-
name: "Benchmarks (${{ matrix.runner }}, ${{ matrix.backend }}, preset: ${{ matrix.preset }})"
163+
name: "Benchmarks (${{ matrix.runner }}, ${{ matrix.backend }}, preset: ${{ inputs.preset }})"
164164
runner: ${{ matrix.runner }}
165165
image: ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest
166166
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
@@ -234,7 +234,7 @@ jobs:
234234
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest"
235235
cc: clang
236236
cxx: clang++
237-
changes: ${{ needs.detect_changes.outputs.filters }}
237+
changes: '[]'
238238
toolchain_artifact: sycl_linux_default
239239

240240
# TODO: When we have stable BMG runner(s), consider moving this job to that runner.
@@ -255,7 +255,7 @@ jobs:
255255
benchmark_dry_run: true
256256
benchmark_exit_on_failure: true
257257
repo_ref: ${{ github.sha }}
258-
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
259-
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
260-
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}
258+
toolchain_artifact: ${{ needs.build_pr.outputs.toolchain_artifact }}
259+
toolchain_artifact_filename: ${{ needs.build_pr.outputs.toolchain_artifact_filename }}
260+
toolchain_decompress_command: ${{ needs.build_pr.outputs.toolchain_decompress_command }}
261261
# END benchmark framework builds and runs on PRs path

.github/workflows/sycl-windows-build.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,9 @@ jobs:
221221
- name: Install utilities
222222
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
223223
shell: bash
224-
# TODO replace utility installation with a single CMake target
225224
run: |
226-
cmake --build build --target utils/FileCheck/install
227-
cmake --build build --target utils/count/install
228-
cmake --build build --target utils/not/install
229-
cmake --build build --target utils/lit/install
230-
cmake --build build --target utils/llvm-lit/install
231-
cmake --build build --target install-llvm-size
232-
cmake --build build --target install-llvm-cov
233-
cmake --build build --target install-llvm-profdata
234-
cmake --build build --target install-compiler-rt
225+
cmake --build $GITHUB_WORKSPACE/build --target install-sycl-test-utilities
226+
235227
- name: Pack toolchain
236228
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
237229
shell: bash

devops/containers/release_build.Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ RUN dnf -y install https://repo.radeon.com/amdgpu-install/6.4.1/rhel/8.10/amdgpu
2020
dnf -y install rocm && \
2121
dnf clean all && rm -rf /var/cache/dnf
2222

23+
# Build zstd static library from sources
24+
COPY scripts/build_zstd.sh /build_zstd.sh
25+
RUN /build_zstd.sh
26+
2327
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
2428

2529
USER sycl

devops/containers/ubuntu2404_base.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ RUN /install.sh
1717
# This causes linking errors when building SYCL runtime.
1818
# Bug: https://github.com/intel/llvm/issues/15935
1919
# Workaround: build zstd from sources with -fPIC flag.
20-
COPY scripts/build_zstd_1_5_6_ub24.sh /build_zstd_1_5_6_ub24.sh
21-
RUN /build_zstd_1_5_6_ub24.sh
20+
COPY scripts/build_zstd.sh /build_zstd.sh
21+
RUN /build_zstd.sh
2222

2323
COPY scripts/create-sycl-user.sh /user-setup.sh
2424
RUN /user-setup.sh

devops/containers/ubuntu2404_build.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RUN /install.sh
1212
# This causes linking errors when building SYCL runtime.
1313
# Bug: https://github.com/intel/llvm/issues/15935
1414
# Workaround: build zstd from sources with -fPIC flag.
15-
COPY scripts/build_zstd_1_5_6_ub24.sh /build_zstd_1_5_6_ub24.sh
16-
RUN /build_zstd_1_5_6_ub24.sh
15+
COPY scripts/build_zstd.sh /build_zstd.sh
16+
RUN /build_zstd.sh
1717

1818
SHELL ["/bin/bash", "-ec"]
1919

devops/scripts/build_zstd.sh

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/bin/bash
2+
3+
# Script to build and install zstd on Ubuntu 24, with -fPIC flag.
4+
# The default installation of zstd on Ubuntu 24 does not have -fPIC flag
5+
# enabled, which is required for building DPC++ in shared libraries mode.
6+
7+
# OR on Rocky Linux 8.10 (used for nightly release builds). There is no static
8+
# library (libzstd.a) in available packages, therefore it is necessary to build
9+
# it from source.
10+
11+
# Function to check OS
12+
check_os() {
13+
local expected_name="$1"
14+
local expected_version="$2"
15+
. /etc/os-release
16+
if [[ "$NAME" == "$expected_name" && "$VERSION_ID" == "$expected_version" ]]; then
17+
return 0
18+
else
19+
return 1
20+
fi
21+
}
22+
23+
# Function to install packages with or without sudo
24+
install_packages() {
25+
if [ "$USE_SUDO" = true ]; then
26+
sudo apt-get update
27+
sudo apt-get install -y build-essential wget
28+
else
29+
apt-get update
30+
apt-get install -y build-essential wget
31+
fi
32+
}
33+
34+
# Function to uninstall libzstd-dev if installed
35+
uninstall_libzstd_dev() {
36+
if dpkg -l | grep -q libzstd-dev; then
37+
if [ "$USE_SUDO" = true ]; then
38+
sudo apt-get remove -y libzstd-dev
39+
else
40+
apt-get remove -y libzstd-dev
41+
fi
42+
fi
43+
}
44+
45+
# Function to build a shared library by linking zstd static lib.
46+
# This is used to verify that zstd is built correctly, with -fPIC flag.
47+
build_test_program() {
48+
cat <<EOF > test_zstd.c
49+
#include <zstd.h>
50+
int main() {
51+
ZSTD_CCtx* cctx = ZSTD_createCCtx();
52+
ZSTD_freeCCtx(cctx);
53+
return 0;
54+
}
55+
EOF
56+
57+
# Try to use zstd's static library with -fPIC
58+
gcc test_zstd.c -lzstd -fPIC -shared
59+
if [ $? -ne 0 ]; then
60+
echo "zstd installation verification failed."
61+
else
62+
echo "zstd installation verification passed."
63+
fi
64+
65+
# There won't be a.out file if verification failed.
66+
rm test_zstd.c a.out || true
67+
}
68+
69+
# Check the OS
70+
if ! check_os "Ubuntu" "24.04" && ! check_os "Rocky Linux" "8.10"; then
71+
echo "Warning: This script has only been tested with Ubuntu 24.04 and Rocky Linux 8.10."
72+
fi
73+
74+
# Set USE_SUDO to true or false based on your preference
75+
USE_SUDO=true
76+
77+
# Install necessary build tools & uninstall libzstd-dev package if installed
78+
if check_os "Ubuntu" "24.04"; then
79+
install_packages
80+
uninstall_libzstd_dev
81+
fi
82+
83+
# Define the version and URL for zstd
84+
ZSTD_VERSION="1.5.7"
85+
ZSTD_URL="https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz"
86+
87+
# Create a directory for the source code
88+
mkdir -p zstd_build
89+
cd zstd_build
90+
91+
# Download and extract zstd source code
92+
wget $ZSTD_URL
93+
tar -xzf zstd-$ZSTD_VERSION.tar.gz
94+
cd zstd-$ZSTD_VERSION
95+
96+
# Build zstd with -fPIC flag.
97+
CFLAGS="-fPIC" CXXFLAGS="-fPIC" make
98+
if [ $? -ne 0 ]; then
99+
echo "Error: make failed."
100+
exit 1
101+
fi
102+
103+
# Install zstd.
104+
if [ "$USE_SUDO" = true ]; then
105+
sudo make install
106+
else
107+
make install
108+
fi
109+
if [ $? -ne 0 ]; then
110+
echo "Error: make install failed."
111+
exit 1
112+
fi
113+
114+
# Verify zstd installation.
115+
build_test_program
116+
117+
# Clean up
118+
rm -rf zstd_build

devops/scripts/build_zstd_1_5_6_ub24.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
# The actual version of this script is build_zstd.sh.
4+
# This one is needed for jenkins precommit to pass, since jenkins still uses the
5+
# old name. Will be removed when Jenkins is updated.
6+
37
# Script to build and install zstd 1.5.6 on Ubuntu 24, with -fPIC flag.
48
# The default installation of zstd on Ubuntu 24 does not have -fPIC flag
59
# enabled, which is required for building DPC++ in shared libraries mode.

libc/include/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,9 @@ add_header_macro(
621621
sys/time.h
622622
DEPENDS
623623
.llvm_libc_common_h
624-
.llvm-libc-types.struct_timeval
625624
.llvm-libc-macros.sys_time_macros
625+
.llvm-libc-types.struct_itimerval
626+
.llvm-libc-types.struct_timeval
626627
)
627628

628629
add_header_macro(

libc/include/stdio.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,26 @@ functions:
197197
- type: FILE *
198198
- type: long
199199
- type: int
200+
- name: fseeko
201+
standards:
202+
- POSIX
203+
return_type: int
204+
arguments:
205+
- type: FILE *
206+
- type: off_t
207+
- type: int
200208
- name: ftell
201209
standards:
202210
- stdc
203211
return_type: long
204212
arguments:
205213
- type: FILE *
214+
- name: ftello
215+
standards:
216+
- POSIX
217+
return_type: off_t
218+
arguments:
219+
- type: FILE *
206220
- name: funlockfile
207221
standards:
208222
- POSIX

0 commit comments

Comments
 (0)