Skip to content

Commit e7dc80e

Browse files
committed
Re-applied all changes but preferred gcc version
1 parent 931edf6 commit e7dc80e

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

T/Torch/build_tarballs.jl

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ atomic_patch -p1 ../patches/pytorch-aten-qnnpack-cmake-windows.patch
3434
cmake_extra_args=""
3535
include_paths=""
3636
37+
if [[ $bb_full_target == *cxx11* ]]; then
38+
cmake_extra_args+="-DGLIBCXX_USE_CXX11_ABI=1 "
39+
fi
40+
3741
if [[ $target == i686-linux-gnu*
3842
|| $target == x86_64-linux-gnu*
3943
|| $target == x86_64-apple-darwin*
@@ -52,19 +56,22 @@ elif [[ $bb_full_target == armv6l-linux-gnu* ]]; then
5256
cmake_extra_args+="-DBLAS=OpenBLAS "
5357
fi
5458
55-
if [[ $target == x86_64* ]]; then
59+
if [[ $target == x86_64* ]]; then # Restricting PYTORCH_QNNPACK to x86_64: Adapted from https://salsa.debian.org/deeplearning-team/pytorch/-/blob/master/debian/rules
5660
cmake_extra_args+="-DUSE_PYTORCH_QNNPACK=ON "
5761
else
5862
cmake_extra_args+="-DUSE_PYTORCH_QNNPACK=OFF "
5963
fi
6064
61-
if [[ $target == aarch64-linux-gnu* || $target == *-w64-mingw32* || $target == *-freebsd* ]]; then
65+
if [[ $target == aarch64-linux-gnu* # Disabled use of breakpad on aarch64-linux-gnu: Fails to build embedded breakpad library.
66+
|| $target == *-w64-mingw32* # Disabling breakpad enables configure on Windows - in combination with pytorch-aten-qnnpack-cmake-windows.patch
67+
|| $target == *-freebsd*
68+
]]; then
6269
cmake_extra_args+="-DUSE_BREAKPAD=OFF "
6370
else
6471
cmake_extra_args+="-DUSE_BREAKPAD=ON "
6572
fi
6673
67-
if [[ $target == *-linux-musl*
74+
if [[ $target == *-linux-musl* # Disabled use of TensorPipe on linux-musl: Fails to build embedded TensorPipe library.
6875
|| $target == *-w64-mingw32* # TensorPipe cannot be used on Windows
6976
]]; then
7077
cmake_extra_args+="-DUSE_TENSORPIPE=OFF "
@@ -81,9 +88,9 @@ if [[ $target != arm-* && $target == *-linux-musl* ]]; then
8188
cmake_extra_args+="-DUSE_SYSTEM_GLOO=ON "
8289
fi
8390
84-
if [[ $target == aarch64-linux-* # A compiler with AVX512 support is required for FBGEM
85-
|| $target == arm-linux-* # A compiler with AVX512 support is required for FBGEM
86-
|| $target == i686-linux-* # x64 operating system is required for FBGEMM
91+
if [[ $target == aarch64-* # A compiler with AVX512 support is required for FBGEM
92+
|| $target == arm-* # A compiler with AVX512 support is required for FBGEM
93+
|| $target == i686-* # x64 operating system is required for FBGEMM
8794
|| $target == x86_64-w64-mingw32*
8895
]]; then
8996
cmake_extra_args+="-DUSE_FBGEMM=OFF -DUSE_FAKELOWP=OFF "
@@ -103,7 +110,7 @@ if [[ $bb_full_target == *cuda* ]]; then
103110
apk del cmake
104111
apk add 'cmake<3.17' --repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main
105112
export PATH=$PATH:$cuda_full_path/bin
106-
export CUDACXX="ccache nvcc"
113+
export CUDACXX=$cuda_full_path/bin/nvcc
107114
export CUDAHOSTCXX=$CXX
108115
mkdir $WORKSPACE/tmpdir
109116
export TMPDIR=$WORKSPACE/tmpdir
@@ -193,8 +200,9 @@ install_license ../LICENSE
193200
platforms = supported_platforms()
194201
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl"), platforms) # musl fails due to conflicting declaration of C function ‘void __assert_fail(const char*, const char*, int, const char*) - between /opt/x86_64-linux-musl/x86_64-linux-musl/include/c++/8.1.0/cassert:44 and /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/include/assert.h
195202
filter!(!Sys.iswindows, platforms) # ONNX does not support cross-compiling for w64-mingw32 on linux
203+
filter!(p -> arch(p) != "armv6l", platforms) # armv6l is not supported by XNNPACK
204+
filter!(p -> arch(p) != "armv7l", platforms) # armv7l is not supported by XNNPACK
196205
filter!(p -> arch(p) != "powerpc64le", platforms) # PowerPC64LE is not supported by XNNPACK
197-
filter!(p -> !(Sys.isapple(p) && arch(p) == "aarch64"), platforms) # aarch64-apple not supported by CPUInfo_jll v0.0.20200612 referenced by XNNPACK_jll v0.0.20200323
198206
filter!(!Sys.isfreebsd, platforms) # Build fails: Clang v12 crashes compiling aten/src/ATen/native/cpu/MaxUnpoolKernel.cpp.
199207

200208
mkl_platforms = [
@@ -225,6 +233,12 @@ for p in cuda_platforms
225233
push!(platforms, p)
226234
end
227235

236+
platforms = expand_cxxstring_abis(platforms)
237+
mkl_platforms = expand_cxxstring_abis(mkl_platforms)
238+
blis_platforms = expand_cxxstring_abis(blis_platforms)
239+
openblas_platforms = expand_cxxstring_abis(openblas_platforms)
240+
cuda_platforms = expand_cxxstring_abis(cuda_platforms)
241+
228242
# The products that we will ensure are always built
229243
products = [
230244
LibraryProduct(["libtorch", "torch"], :libtorch),
@@ -235,17 +249,17 @@ products = [
235249
dependencies = [
236250
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
237251
Dependency("blis_jll"; platforms = blis_platforms),
238-
Dependency("CPUInfo_jll"),
239-
Dependency("CUDNN_jll"; platforms = cuda_platforms),
240-
Dependency("Gloo_jll"; platforms = filter(p -> nbits(p) == 64, platforms)),
252+
Dependency("CPUInfo_jll"; compat = "0.0.20201217"),
253+
Dependency("CUDNN_jll", v"8.2.4"; compat = "8", platforms = cuda_platforms),
254+
Dependency("Gloo_jll"; compat = "0.0.20210521", platforms = filter(p -> nbits(p) == 64, platforms)),
241255
Dependency("LAPACK_jll"; platforms = openblas_platforms),
242256
Dependency("MKL_jll"; platforms = mkl_platforms),
243257
BuildDependency("MKL_Headers_jll"; platforms = mkl_platforms),
244258
Dependency("OpenBLAS_jll"; platforms = openblas_platforms),
245-
Dependency("PThreadPool_jll"),
246-
Dependency("SLEEF_jll"),
259+
Dependency("PThreadPool_jll"; compat = "0.0.20210414"),
260+
Dependency("SLEEF_jll", v"3.5.2"; compat = "3"),
247261
# Dependency("TensorRT_jll"; platforms = cuda_platforms), # Building with TensorRT is not supported: https://github.com/pytorch/pytorch/issues/60228
248-
Dependency("XNNPACK_jll", v"0.0.20200323"),
262+
Dependency("XNNPACK_jll"; compat = "0.0.20210622"),
249263
BuildDependency(PackageSpec("protoc_jll", Base.UUID("c7845625-083e-5bbe-8504-b32d602b7110"), v"3.13.0")),
250264
HostBuildDependency(PackageSpec("protoc_jll", Base.UUID("c7845625-083e-5bbe-8504-b32d602b7110"), v"3.13.0")),
251265
]

0 commit comments

Comments
 (0)