Skip to content

Commit e8ed87c

Browse files
vchuravywsmoses
andauthored
Bootstrap enzyme tblgen (rust-lang#730)
* Bootstrap enzyme tblgen * Update .packaging/build_tarballs.jl * Fix tablgen exe * only set tblgen if empty * Fix * Update .packaging/build_tarballs.jl Co-authored-by: Valentin Churavy <[email protected]> Co-authored-by: William S. Moses <[email protected]>
1 parent 84e7fe5 commit e8ed87c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.packaging/build_tarballs.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ NATIVE_CMAKE_FLAGS+=(-DBC_LOAD_FLAGS="-target ${target} --sysroot=/opt/${target}
3838
3939
cmake -B build-native -S enzyme -GNinja "${NATIVE_CMAKE_FLAGS[@]}"
4040
41-
# Only build blasheaders (and eventually tblgen)
42-
ninja -C build-native -j ${nproc} blasheaders
41+
# Only build blasheaders and tblgen
42+
ninja -C build-native -j ${nproc} blasheaders enzyme-tblgen
4343
4444
# 2. Cross-compile
4545
CMAKE_FLAGS=()
4646
CMAKE_FLAGS+=(-DENZYME_EXTERNAL_SHARED_LIB=ON)
4747
CMAKE_FLAGS+=(-DBC_LOAD_HEADER=`pwd`/build-native/BCLoad/gsl/blas_headers.h)
48+
CMAKE_FLAGS+=(-DEnzyme_TABLEGEN_EXE=`pwd`/build-native/tools/enzyme-tblgen/enzyme-tblgen)
4849
CMAKE_FLAGS+=(-DENZYME_CLANG=OFF)
4950
# RelWithDebInfo for decent performance, with debugability
5051
CMAKE_FLAGS+=(-DCMAKE_BUILD_TYPE=RelWithDebInfo)

enzyme/Enzyme/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# set(LLVM_LINK_COMPONENTS Core Support)
33
#endif()
44

5-
set(Enzyme_TABLEGEN_EXE enzyme-tblgen)
5+
if ("${Enzyme_TABLEGEN_EXE}" STREQUAL "")
6+
set(Enzyme_TABLEGEN_EXE enzyme-tblgen)
7+
endif()
68

79
get_target_property(TBL_LINKED_LIBS LLVMSupport INTERFACE_LINK_LIBRARIES)
810
list(REMOVE_ITEM TBL_LINKED_LIBS "ZLIB::ZLIB")

0 commit comments

Comments
 (0)