From b94829b08e34b35775c4eed6eb29ce3fcbf23fab Mon Sep 17 00:00:00 2001 From: William Moses Date: Sat, 18 Oct 2025 07:41:24 +0800 Subject: [PATCH 01/15] Reactant 0.0.253 --- R/Reactant/build_tarballs.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 876a670f215..8f3df81c5e5 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,8 +6,8 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "d4ce6a0911ce7607146bd7213eb780969c1d8156" -version = v"0.0.251" +reactant_commit = "3bd7508e7b3141397dd945c3a7600e151c566df1" +version = v"0.0.253" sources = [ GitSource(repo, reactant_commit), @@ -170,6 +170,7 @@ if [[ "${target}" == *-mingw* ]]; then sed -i 's/noincompatible_enable_cc_toolchain_resolution/incompatible_enable_cc_toolchain_resolution/' .bazelrc BAZEL_BUILD_FLAGS+=(--compiler=mingw-gcc) BAZEL_BUILD_FLAGS+=(--copt=-D_USE_MATH_DEFINES) + BAZEL_BUILD_FLAGS+=(--copt=-DPTHREADPOOL_USE_PTHREADS=1) BAZEL_BUILD_FLAGS+=(--copt=-DWIN32_LEAN_AND_MEAN) BAZEL_BUILD_FLAGS+=(--copt=-DNOGDI) # BAZEL_BUILD_FLAGS+=(--compiler=clang) From 2a3fab3c258fca4dc4f97bfbe01536f3d9d6c40d Mon Sep 17 00:00:00 2001 From: William Moses Date: Sat, 18 Oct 2025 07:48:31 +0800 Subject: [PATCH 02/15] Update build_tarballs.jl --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 8f3df81c5e5..97ecc68740f 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "3bd7508e7b3141397dd945c3a7600e151c566df1" +reactant_commit = "463697d0ea87461bd570e5186f36f9f5ffe668cc" version = v"0.0.253" sources = [ From e4e2ad907850787d6f7730231bcc82ca82c8d0bf Mon Sep 17 00:00:00 2001 From: William Moses Date: Sat, 18 Oct 2025 08:09:15 +0800 Subject: [PATCH 03/15] Update build_tarballs.jl --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 97ecc68740f..0bcf0980872 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -7,7 +7,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" reactant_commit = "463697d0ea87461bd570e5186f36f9f5ffe668cc" -version = v"0.0.253" +version = v"0.0.252" sources = [ GitSource(repo, reactant_commit), From 1d97525749cc812e1d421d0a8d0f191040c4a070 Mon Sep 17 00:00:00 2001 From: William Moses Date: Sat, 18 Oct 2025 08:16:49 +0800 Subject: [PATCH 04/15] Update Reactant commit hash in build_tarballs.jl --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 0bcf0980872..f3460754277 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "463697d0ea87461bd570e5186f36f9f5ffe668cc" +reactant_commit = "f8d0f06473e4c49461ccd528dc3d39301e00e968" version = v"0.0.252" sources = [ From cfc9035c55b251823d58f6e355a078c66b094031 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 05:20:01 -0500 Subject: [PATCH 05/15] fix --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index f3460754277..d6a47d05d68 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "f8d0f06473e4c49461ccd528dc3d39301e00e968" +reactant_commit = "8c4c161d5b33231a0de676daffc95176c02f4380" version = v"0.0.252" sources = [ From 17b18a0834ff95a7c5b3badb95100ed81cf9bb2c Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 05:26:59 -0500 Subject: [PATCH 06/15] f --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index d6a47d05d68..b33f5a864f0 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "8c4c161d5b33231a0de676daffc95176c02f4380" +reactant_commit = "c42311edb254d34c8257be7265edec7773c29f2f" version = v"0.0.252" sources = [ From d5f3328b9141dc1cde48763ffe5dffc36834ca96 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 06:13:39 -0500 Subject: [PATCH 07/15] bump --- R/Reactant/build_tarballs.jl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index b33f5a864f0..899783cb983 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -43,9 +43,14 @@ if [[ "${target}" == *-apple-darwin* ]]; then # Compiling LLVM components within XLA requires macOS SDK 10.14 # and then we use `std::reinterpret_pointer_cast` in ReactantExtra # which requires macOS SDK 11.3. + # Install a newer SDK which supports C++20 + pushd $WORKSPACE/srcdir/MacOSX12.*.sdk rm -rf /opt/${target}/${target}/sys-root/System - rm -rf /opt/${target}/${target}/sys-root/usr/include/libxml2 - tar --extract --file=${WORKSPACE}/srcdir/MacOSX11.3.sdk.tar.xz --directory="/opt/${target}/${target}/sys-root/." --strip-components=1 MacOSX11.3.sdk/System MacOSX11.3.sdk/usr + rm -rf /opt/${target}/${target}/sys-root/usr/* + cp -ra usr/* "/opt/${target}/${target}/sys-root/usr/." + cp -ra System "/opt/${target}/${target}/sys-root/." + popd + export MACOSX_DEPLOYMENT_TARGET=12.3 fi mkdir -p .local/bin @@ -156,7 +161,6 @@ if [[ "${target}" == *-darwin* ]]; then # `using_clang` comes from Enzyme-JAX, to handle clang-specific options. BAZEL_BUILD_FLAGS+=(--define=using_clang=true) BAZEL_BUILD_FLAGS+=(--define HAVE_LINK_H=0) - export MACOSX_DEPLOYMENT_TARGET=11.3 BAZEL_BUILD_FLAGS+=(--macos_minimum_os=${MACOSX_DEPLOYMENT_TARGET}) BAZEL_BUILD_FLAGS+=(--action_env=MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}) BAZEL_BUILD_FLAGS+=(--host_action_env=MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}) @@ -507,8 +511,8 @@ for gpu in ("none", "cuda"), mode in ("opt", "dbg"), cuda_version in ("none", "1 platform_sources = BinaryBuilder.AbstractSource[sources...] if Sys.isapple(platform) push!(platform_sources, - FileSource("https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz", - "cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4")) + ArchiveSource("https://github.com/realjf/MacOSX-SDKs/releases/download/v0.0.1/MacOSX12.3.sdk.tar.xz", + "a511c1cf1ebfe6fe3b8ec005374b9c05e89ac28b3d4eb468873f59800c02b030")) end if arch(platform) == "aarch64" && gpu == "cuda" From 1f63addffc431d4d05e2d2eaa4ec67d8fb9b47dd Mon Sep 17 00:00:00 2001 From: William Moses Date: Sat, 18 Oct 2025 20:24:02 +0900 Subject: [PATCH 08/15] Update Reactant commit hash to latest version --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 899783cb983..dde0c7ef7ce 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "c42311edb254d34c8257be7265edec7773c29f2f" +reactant_commit = "4cd6ebc094fe833a557bd0d1b804b30e83968a08" version = v"0.0.252" sources = [ From 895f0699658e5f58858288ef0155a4fe935b52ea Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 10:49:06 -0500 Subject: [PATCH 09/15] bump more --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index dde0c7ef7ce..2f2a3739295 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "4cd6ebc094fe833a557bd0d1b804b30e83968a08" +reactant_commit = "bb959ff7c66ffe33e4c8fa69269e7521ee7197ca" version = v"0.0.252" sources = [ From 9bed29e4bc93f567b13b8667177d5b2713df4372 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 11:14:28 -0500 Subject: [PATCH 10/15] fix --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 2f2a3739295..1105f4e72ba 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "bb959ff7c66ffe33e4c8fa69269e7521ee7197ca" +reactant_commit = "0803c28d67a39a245f3d469d68cd11e3a7d0836c" version = v"0.0.252" sources = [ From ed29bafd1fbcd19b18dbb82a3944b6642e2b27b5 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 15:12:44 -0500 Subject: [PATCH 11/15] fix --- R/Reactant/build_tarballs.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 1105f4e72ba..195efa4427c 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -285,6 +285,8 @@ sed -i -e "s/BB_TARGET/${bb_target}/g" \ -e "s/GCC_VERSION/${GCC_VERSION}/g" \ -e "s/BAZEL_CPU/${BAZEL_CPU}/g" \ BUILD + +unset CC export HERMETIC_PYTHON_VERSION=3.12 @@ -326,9 +328,9 @@ if [[ "${target}" == *-darwin* ]]; then cc @bazel-bin/libReactantExtra.so-2.params elif [[ "${target}" == *mingw32* ]]; then - $BAZEL ${BAZEL_FLAGS[@]} build --repo_env=CC ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so || echo stage1 + $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so || echo stage1 sed -i.bak1 -e "s/PTHREADPOOL_WEAK//g" /workspace/bazel_root/*/external/pthreadpool/src/portable-api.c - $BAZEL ${BAZEL_FLAGS[@]} build --repo_env=CC ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so || echo stage2 + $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so || echo stage2 sed -i.bak1 -e "/start-lib/d" \ -e "/end-lib/d" \ bazel-bin/libReactantExtra.so-2.params @@ -350,7 +352,7 @@ echo "-luuid" >> bazel-bin/libReactantExtra.so-2.params clang @bazel-bin/libReactantExtra.so-2.params else - $BAZEL ${BAZEL_FLAGS[@]} build --repo_env=CC ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so + $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so fi rm -f bazel-bin/libReactantExtraLib* From 08a0f7634be18948a463689fbe34a2250d2349ca Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 15:31:50 -0500 Subject: [PATCH 12/15] more aggressively reject gcc --- R/Reactant/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 195efa4427c..fd291f41a13 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -287,6 +287,7 @@ sed -i -e "s/BB_TARGET/${bb_target}/g" \ BUILD unset CC +rm `which gcc` export HERMETIC_PYTHON_VERSION=3.12 From da80157944b1a3d21c0caae4225c3832579441b9 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 16:03:51 -0500 Subject: [PATCH 13/15] more things --- R/Reactant/build_tarballs.jl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index fd291f41a13..e68ec89b7b2 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -110,6 +110,13 @@ BAZEL_BUILD_FLAGS+=(--action_env=TMP=$TMPDIR --action_env=TEMP=$TMPDIR --action_ BAZEL_BUILD_FLAGS+=(--host_cpu=k8) BAZEL_BUILD_FLAGS+=(--host_platform=//:linux_x86_64) BAZEL_BUILD_FLAGS+=(--host_crosstool_top=@//:ygg_cross_compile_toolchain_suite) + +if [[ "${bb_full_target}" == *gpu+none* ]]; then + BAZEL_BUILD_FLAGS+=(--crosstool_top=@//:ygg_cross_compile_toolchain_suite) + BAZEL_BUILD_FLAGS+=(--copt=-D__caddr_t=char*) + BAZEL_BUILD_FLAGS+=(--copt=-D_GNU_SOURCE) +fi + # BAZEL_BUILD_FLAGS+=(--extra_execution_platforms=@xla//tools/toolchains/cross_compile/config:linux_x86_64) if [[ "${target}" == x86_64-apple-darwin* ]]; then @@ -156,7 +163,6 @@ if [[ "${target}" == *-darwin* ]]; then echo "register_toolchains(\\"//:cc_toolchain_for_ygg_darwin_arm64\\")" >> WORKSPACE fi BAZEL_BUILD_FLAGS+=(--linkopt=-twolevel_namespace) - BAZEL_BUILD_FLAGS+=(--crosstool_top=@//:ygg_cross_compile_toolchain_suite) BAZEL_BUILD_FLAGS+=(--define=clang_macos_x86_64=true) # `using_clang` comes from Enzyme-JAX, to handle clang-specific options. BAZEL_BUILD_FLAGS+=(--define=using_clang=true) @@ -203,7 +209,6 @@ if [[ "${target}" == *-linux-* ]]; then BAZEL_BUILD_FLAGS+=(--platforms=@//:linux_x86_64) echo "register_toolchains(\\"//:cc_toolchain_for_ygg_x86\\")" >> WORKSPACE elif [[ "${target}" == aarch64-* ]]; then - BAZEL_BUILD_FLAGS+=(--crosstool_top=@//:ygg_cross_compile_toolchain_suite) BAZEL_BUILD_FLAGS+=(--platforms=@//:linux_aarch64) BAZEL_BUILD_FLAGS+=(--cpu=${BAZEL_CPU}) BAZEL_BUILD_FLAGS+=(--@xla//xla/tsl/framework/contraction:disable_onednn_contraction_kernel=True) @@ -287,7 +292,8 @@ sed -i -e "s/BB_TARGET/${bb_target}/g" \ BUILD unset CC -rm `which gcc` +#rm `which cc` +#rm `which gcc` export HERMETIC_PYTHON_VERSION=3.12 From 822afa3176945206e5030ae576841be132ae7088 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 16:45:08 -0500 Subject: [PATCH 14/15] cleanup --- R/Reactant/build_tarballs.jl | 63 ++++++++++-------------------------- 1 file changed, 17 insertions(+), 46 deletions(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index e68ec89b7b2..7da7907d47a 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "0803c28d67a39a245f3d469d68cd11e3a7d0836c" +reactant_commit = "d3cee1ac27e3dd9f90779c84e0a6848a802b6878" version = v"0.0.252" sources = [ @@ -109,12 +109,13 @@ BAZEL_BUILD_FLAGS+=(--verbose_failures) BAZEL_BUILD_FLAGS+=(--action_env=TMP=$TMPDIR --action_env=TEMP=$TMPDIR --action_env=TMPDIR=$TMPDIR --sandbox_tmpfs_path=$TMPDIR) BAZEL_BUILD_FLAGS+=(--host_cpu=k8) BAZEL_BUILD_FLAGS+=(--host_platform=//:linux_x86_64) -BAZEL_BUILD_FLAGS+=(--host_crosstool_top=@//:ygg_cross_compile_toolchain_suite) +BAZEL_BUILD_FLAGS+=(--host_crosstool_top=@//:ygg_host_toolchain_suite) + +# `using_clang` comes from Enzyme-JAX, to handle clang-specific options. +BAZEL_BUILD_FLAGS+=(--define=using_clang=true) if [[ "${bb_full_target}" == *gpu+none* ]]; then BAZEL_BUILD_FLAGS+=(--crosstool_top=@//:ygg_cross_compile_toolchain_suite) - BAZEL_BUILD_FLAGS+=(--copt=-D__caddr_t=char*) - BAZEL_BUILD_FLAGS+=(--copt=-D_GNU_SOURCE) fi # BAZEL_BUILD_FLAGS+=(--extra_execution_platforms=@xla//tools/toolchains/cross_compile/config:linux_x86_64) @@ -164,8 +165,6 @@ if [[ "${target}" == *-darwin* ]]; then fi BAZEL_BUILD_FLAGS+=(--linkopt=-twolevel_namespace) BAZEL_BUILD_FLAGS+=(--define=clang_macos_x86_64=true) - # `using_clang` comes from Enzyme-JAX, to handle clang-specific options. - BAZEL_BUILD_FLAGS+=(--define=using_clang=true) BAZEL_BUILD_FLAGS+=(--define HAVE_LINK_H=0) BAZEL_BUILD_FLAGS+=(--macos_minimum_os=${MACOSX_DEPLOYMENT_TARGET}) BAZEL_BUILD_FLAGS+=(--action_env=MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}) @@ -183,8 +182,6 @@ if [[ "${target}" == *-mingw* ]]; then BAZEL_BUILD_FLAGS+=(--copt=-DPTHREADPOOL_USE_PTHREADS=1) BAZEL_BUILD_FLAGS+=(--copt=-DWIN32_LEAN_AND_MEAN) BAZEL_BUILD_FLAGS+=(--copt=-DNOGDI) - # BAZEL_BUILD_FLAGS+=(--compiler=clang) - BAZEL_BUILD_FLAGS+=(--define=using_clang=true) if [[ "${target}" == x86_64* ]]; then BAZEL_BUILD_FLAGS+=(--platforms=@//:win_x86_64) BAZEL_BUILD_FLAGS+=(--cpu=${BAZEL_CPU}) @@ -228,18 +225,9 @@ if [[ "${bb_full_target}" == *gpu+cuda* ]]; then BAZEL_BUILD_FLAGS+=(--config=cuda) BAZEL_BUILD_FLAGS+=(--repo_env=HERMETIC_CUDA_VERSION="${HERMETIC_CUDA_VERSION}") if [[ "${HERMETIC_CUDA_VERSION}" == *13.* ]]; then - BAZEL_BUILD_FLAGS+=(--repo_env=HERMETIC_CUDNN_VERSION="9.12.0") - BAZEL_BUILD_FLAGS+=(--repo_env=HERMETIC_NVSHMEM_VERSION="3.3.20") - BAZEL_BUILD_FLAGS+=(--repo_env HERMETIC_CUDA_COMPUTE_CAPABILITIES="sm_75,sm_80,sm_90,sm_100,compute_120") - fi - - if [[ "${GCC_MAJOR_VERSION}" -le 12 && "${target}" == x86_64-* ]]; then - # Someone wants to compile some code which requires flags not understood by GCC 12. - BAZEL_BUILD_FLAGS+=(--define=xnn_enable_avxvnniint8=false) - fi - if [[ "${GCC_MAJOR_VERSION}" -le 11 && "${target}" == x86_64-* ]]; then - # Someone wants to compile some code which requires flags not understood by GCC 11. - BAZEL_BUILD_FLAGS+=(--define=xnn_enable_avx512fp16=false) + BAZEL_BUILD_FLAGS+=(--config=cuda13) + else + BAZEL_BUILD_FLAGS+=(--config=cuda12) fi if [[ "${target}" != x86_64-linux-gnu ]]; then @@ -262,7 +250,6 @@ if [[ "${bb_full_target}" == *gpu+cuda* ]]; then fi BAZEL_BUILD_FLAGS+=( --action_env=CLANG_CUDA_COMPILER_PATH=$(which clang) - --define=using_clang=true ) fi @@ -290,10 +277,6 @@ sed -i -e "s/BB_TARGET/${bb_target}/g" \ -e "s/GCC_VERSION/${GCC_VERSION}/g" \ -e "s/BAZEL_CPU/${BAZEL_CPU}/g" \ BUILD - -unset CC -#rm `which cc` -#rm `which gcc` export HERMETIC_PYTHON_VERSION=3.12 @@ -311,13 +294,6 @@ if [[ "${target}" == *-darwin* ]]; then sed -i 's/12.0.1-iains/12.1.0/' "/opt/bin/x86_64-linux-musl-cxx11/x86_64-linux-musl-clang"* fi - # sed -i.bak1 -e "s/\\"k8|/\\"${BAZEL_CPU}\\": \\":cc-compiler-k8\\", \\"k8|/g" \ - # -e "s/cpu = \\"k8\\"/cpu = \\"${BAZEL_CPU}\\"/g" \ - # /workspace/bazel_root/*/external/bazel_tools~cc_configure_extension~local_config_cc/BUILD - - # sed -i.bak2 -e "s/\\":cpu_aarch64\\":/\\"@platforms\/\/cpu:aarch64\\":/g" \ - # /workspace/bazel_root/*/external/xla/third_party/highwayhash/highwayhash.BUILD - # We expect the following bazel build command to fail to link at the end, because the # build system insists on linking with `-whole_archive` also on macOS. Until we figure # out how to make it stop doing this we have to manually do this. Any other error @@ -329,10 +305,6 @@ if [[ "${target}" == *-darwin* ]]; then -e "/gc-sections/d" \ bazel-bin/libReactantExtra.so-2.params - # # Show the params file for debugging, but convert newlines to spaces - # cat bazel-bin/libReactantExtra.so-2.params | tr '\n' ' ' - # echo "" - cc @bazel-bin/libReactantExtra.so-2.params elif [[ "${target}" == *mingw32* ]]; then $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so || echo stage1 @@ -346,15 +318,15 @@ elif [[ "${target}" == *mingw32* ]]; then -e "s/^ntdll.lib/-lntdll/g" \ bazel-bin/libReactantExtra.so-2.params - echo "-lole32" >> bazel-bin/libReactantExtra.so-2.params -echo "-lshlwapi" >> bazel-bin/libReactantExtra.so-2.params -echo "-lshell32" >> bazel-bin/libReactantExtra.so-2.params -echo "-lshdocvw" >> bazel-bin/libReactantExtra.so-2.params -echo "-lshcore" >> bazel-bin/libReactantExtra.so-2.params -echo "-lcrypt32" >> bazel-bin/libReactantExtra.so-2.params -echo "-lbcrypt" >> bazel-bin/libReactantExtra.so-2.params -echo "-lmsvcrt" >> bazel-bin/libReactantExtra.so-2.params -echo "-luuid" >> bazel-bin/libReactantExtra.so-2.params + echo "-lole32" >> bazel-bin/libReactantExtra.so-2.params + echo "-lshlwapi" >> bazel-bin/libReactantExtra.so-2.params + echo "-lshell32" >> bazel-bin/libReactantExtra.so-2.params + echo "-lshdocvw" >> bazel-bin/libReactantExtra.so-2.params + echo "-lshcore" >> bazel-bin/libReactantExtra.so-2.params + echo "-lcrypt32" >> bazel-bin/libReactantExtra.so-2.params + echo "-lbcrypt" >> bazel-bin/libReactantExtra.so-2.params + echo "-lmsvcrt" >> bazel-bin/libReactantExtra.so-2.params + echo "-luuid" >> bazel-bin/libReactantExtra.so-2.params clang @bazel-bin/libReactantExtra.so-2.params @@ -372,7 +344,6 @@ if [[ "${bb_full_target}" == *gpu+cuda* ]]; then cp -v bazel-ReactantExtra/external/nvidia_nvshmem/lib/libnvshmem_device.bc ${libdir} find bazel-bin find ${libdir} - # cp -v /workspace/bazel_root/*/external/cuda_nccl/lib/libnccl.so.2 ${libdir} if [[ "${target}" == x86_64-linux-gnu ]]; then NVCC_DIR=(bazel-bin/libReactantExtra.so.runfiles/cuda_nvcc) From e5d35e0fe536b69984e7137361fc8a1b19a3daf3 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 18 Oct 2025 19:50:07 -0500 Subject: [PATCH 15/15] push --- R/Reactant/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index 7da7907d47a..b906c062991 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -6,7 +6,7 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "d3cee1ac27e3dd9f90779c84e0a6848a802b6878" +reactant_commit = "c3255d4e49fc12c2804d6a72d1b2e99129dbbfea" version = v"0.0.252" sources = [