Skip to content

Commit

Permalink
Bootstrap enzyme tblgen (rust-lang#730)
Browse files Browse the repository at this point in the history
* 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 <vchuravy@users.noreply.github.com>

Co-authored-by: William S. Moses <gh@wsmoses.com>
  • Loading branch information
vchuravy and wsmoses authored Jul 19, 2022
1 parent 84e7fe5 commit e8ed87c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .packaging/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ NATIVE_CMAKE_FLAGS+=(-DBC_LOAD_FLAGS="-target ${target} --sysroot=/opt/${target}
cmake -B build-native -S enzyme -GNinja "${NATIVE_CMAKE_FLAGS[@]}"
# Only build blasheaders (and eventually tblgen)
ninja -C build-native -j ${nproc} blasheaders
# Only build blasheaders and tblgen
ninja -C build-native -j ${nproc} blasheaders enzyme-tblgen
# 2. Cross-compile
CMAKE_FLAGS=()
CMAKE_FLAGS+=(-DENZYME_EXTERNAL_SHARED_LIB=ON)
CMAKE_FLAGS+=(-DBC_LOAD_HEADER=`pwd`/build-native/BCLoad/gsl/blas_headers.h)
CMAKE_FLAGS+=(-DEnzyme_TABLEGEN_EXE=`pwd`/build-native/tools/enzyme-tblgen/enzyme-tblgen)
CMAKE_FLAGS+=(-DENZYME_CLANG=OFF)
# RelWithDebInfo for decent performance, with debugability
CMAKE_FLAGS+=(-DCMAKE_BUILD_TYPE=RelWithDebInfo)
Expand Down
4 changes: 3 additions & 1 deletion enzyme/Enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# set(LLVM_LINK_COMPONENTS Core Support)
#endif()

set(Enzyme_TABLEGEN_EXE enzyme-tblgen)
if ("${Enzyme_TABLEGEN_EXE}" STREQUAL "")
set(Enzyme_TABLEGEN_EXE enzyme-tblgen)
endif()

get_target_property(TBL_LINKED_LIBS LLVMSupport INTERFACE_LINK_LIBRARIES)
list(REMOVE_ITEM TBL_LINKED_LIBS "ZLIB::ZLIB")
Expand Down

0 comments on commit e8ed87c

Please sign in to comment.