From 3dc6c719ed700f1695d6ee8a063cad7406e0fba3 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Thu, 4 Dec 2025 11:47:51 -0600 Subject: [PATCH 1/4] Solo libraise build --- 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 1b4ec09..1d5b836 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -405,7 +405,7 @@ elif [[ "${target}" == aarch64-* ]] && [[ "${HERMETIC_CUDA_VERSION}" == *12.* ]] cp /workspace/srcdir/cuda_nvcc-linux-sbsa*-archive/lib/*.a /workspace/bazel_root/*/external/cuda_nvcc/lib/ $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so else - $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so + $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libRaise.so fi rm -f bazel-bin/libReactantExtraLib* @@ -604,7 +604,8 @@ if [[ "${bb_full_target}" == *gpu+rocm* ]]; then fi -install -Dvm 755 bazel-bin/libReactantExtra.so "${libdir}/libReactantExtra.${dlext}" +install -Dvm 755 bazel-bin/libRaise.so "${libdir}/libRaise.${dlext}" +# install -Dvm 755 bazel-bin/libReactantExtra.so "${libdir}/libReactantExtra.${dlext}" install_license ../../LICENSE """ @@ -701,6 +702,10 @@ for gpu in ("none", "cuda", "rocm"), mode in ("opt", "dbg"), cuda_version in ("n preferred_gcc_version = v"13" preferred_llvm_version = v"18.1.7" + + if gpu != "none" + continue + end # Disable debug builds for cuda if mode == "dbg" @@ -866,7 +871,8 @@ for gpu in ("none", "cuda", "rocm"), mode in ("opt", "dbg"), cuda_version in ("n # The products that we will ensure are always built products = Product[ - LibraryProduct(["libReactantExtra", "libReactantExtra"], :libReactantExtra) + # LibraryProduct(["libReactantExtra", "libReactantExtra"], :libReactantExtra) + LibraryProduct(["libRaise", "libRaise"], :libRaise) ] if gpu == "cuda" From 9219780e11dc193615969e49f6bbcb88ff5bedff Mon Sep 17 00:00:00 2001 From: William Moses Date: Thu, 4 Dec 2025 11:54:23 -0600 Subject: [PATCH 2/4] 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 1d5b836..38575f7 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -7,7 +7,7 @@ include(joinpath(YGGDRASIL_DIR, "platforms", "macos_sdks.jl")) name = "Reactant" repo = "https://github.com/EnzymeAD/Reactant.jl.git" -reactant_commit = "d635c44c62154243eadf038868d730c72d3b4031" +reactant_commit = "c7d2d6a9987327a25ac345ba3fe2c7cde8d4ba72" version = v"0.0.267" sources = [ From 2f028d795e8d2b5beae663c4bb2a6dba09d53305 Mon Sep 17 00:00:00 2001 From: William Moses Date: Thu, 4 Dec 2025 13:11:36 -0600 Subject: [PATCH 3/4] Update build process for libRaise.so with enzyme_ad --- 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 38575f7..ca12331 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -405,7 +405,7 @@ elif [[ "${target}" == aarch64-* ]] && [[ "${HERMETIC_CUDA_VERSION}" == *12.* ]] cp /workspace/srcdir/cuda_nvcc-linux-sbsa*-archive/lib/*.a /workspace/bazel_root/*/external/cuda_nvcc/lib/ $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libReactantExtra.so else - $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} :libRaise.so + $BAZEL ${BAZEL_FLAGS[@]} build ${BAZEL_BUILD_FLAGS[@]} @enzyme_ad//:libRaise.so fi rm -f bazel-bin/libReactantExtraLib* @@ -604,7 +604,8 @@ if [[ "${bb_full_target}" == *gpu+rocm* ]]; then fi -install -Dvm 755 bazel-bin/libRaise.so "${libdir}/libRaise.${dlext}" +find bazel-bin -iname libRaise.so +install -Dvm 755 bazel-bin/external/enzyme_ad/libRaise.so "${libdir}/libRaise.${dlext}" # install -Dvm 755 bazel-bin/libReactantExtra.so "${libdir}/libReactantExtra.${dlext}" install_license ../../LICENSE """ From 343518b5ce340edfb1c9fe7ef95cd2e84f2df614 Mon Sep 17 00:00:00 2001 From: William Moses Date: Thu, 4 Dec 2025 14:00:03 -0600 Subject: [PATCH 4/4] Update build_tarballs.jl --- R/Reactant/build_tarballs.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/Reactant/build_tarballs.jl b/R/Reactant/build_tarballs.jl index ca12331..919f89a 100644 --- a/R/Reactant/build_tarballs.jl +++ b/R/Reactant/build_tarballs.jl @@ -708,14 +708,15 @@ for gpu in ("none", "cuda", "rocm"), mode in ("opt", "dbg"), cuda_version in ("n continue end + if Sys.isapple(platform) + continue + end + # Disable debug builds for cuda if mode == "dbg" if gpu != "none" continue end - if !Sys.isapple(platform) - continue - end end # If you skip GPU builds here, remember to update also platform augmentation above. @@ -733,7 +734,7 @@ for gpu in ("none", "cuda", "rocm"), mode in ("opt", "dbg"), cuda_version in ("n continue end - if gpu == "rocm" && arch(platform) == "aarch64" + if arch(platform) == "aarch64" # At the moment we can't build for ROCM on aarch64, let's skip it continue end