[Build] Disable python binding by default; Add a pybind option to build-scalehls.sh; [Readme] Update readme accordingly

This commit is contained in:
Hanchen Ye 2022-03-09 02:11:32 -06:00
parent 564c413385
commit 8626ca3ed5
2 changed files with 11 additions and 7 deletions

View File

@ -21,11 +21,14 @@ For more details, please see our [HPCA'22 paper](https://arxiv.org/abs/2107.1167
## Setting this up
### Prerequisites
- python3
- cmake
- ninja
- clang and lld (recommended)
- clang and lld
Optionally, the following packages are required for the Python binding.
- pybind11
- python3 with numpy
- numpy
### Clone ScaleHLS
```sh
@ -34,7 +37,7 @@ $ cd scalehls
```
### Build ScaleHLS
Run the following script to build ScaleHLS. Note that you can use `-j xx` to specify the number of parallel linking jobs.
Run the following script to build ScaleHLS. Optionally, add `-p ON` to enable the Python binding and `-j xx` to specify the number of parallel linking jobs.
```sh
$ ./build-scalehls.sh
```
@ -60,7 +63,7 @@ $ scalehls-opt test_gemm.mlir -debug-only=scalehls \
| scalehls-translate -emit-hlscpp > test_gemm_dse.cpp
```
Meanwhile, we provide a `pyscalehls` tool to showcase the `scalehls` Python library:
If Python binding is enabled, we provide a `pyscalehls` tool to showcase the `scalehls` Python library:
```sh
$ pyscalehls.py test_gemm.c -f test_gemm > test_gemm_pyscalehls.cpp
```

View File

@ -5,10 +5,11 @@ set -o pipefail
set -o nounset
# Script options.
while getopts 'j:' opt
while getopts 'j:p:' opt
do
case $opt in
j) JOBS="${OPTARG}";;
p) PYBIND="${OPTARG}";;
esac
done
@ -44,8 +45,8 @@ if [ ! -f "CMakeCache.txt" ]; then
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=DEBUG \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DSCALEHLS_ENABLE_BINDINGS_PYTHON=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON="${PYBIND:=OFF}" \
-DSCALEHLS_ENABLE_BINDINGS_PYTHON="${PYBIND:=OFF}" \
-DLLVM_PARALLEL_LINK_JOBS="${JOBS:=}" \
-DLLVM_USE_LINKER=lld \
-DCMAKE_C_COMPILER=clang \