cornell-zhang / heterocl

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Heterogeneous Computing
https://cornell-zhang.github.io/heterocl/
Apache License 2.0
326 stars 92 forks source link

Installation problems when using non-default tools #181

Closed chhzh123 closed 4 years ago

chhzh123 commented 4 years ago

The installation page seems to miss lots of details. Though it suggests users set their own CMake and LLVM version, after I change LLVM_CONFIG, HCL_PKG_LLVM, and HCL_PKG_LLVM_BIN in Makefile.config, the build system still downloads LLVM 6.0 from the Internet by default. The reason comes from the current Makefile that the prerequisite of build-tvm is build-pkgs, which is no need for those who have installed LLVM or CMake.

Moreover, it seems HeteroCL uses a rather old TVM that does not support the new version of LLVM. There are some APIs changed for LLVM 9.0 or above, and it would be better if HeteroCL could consider different versions of LLVM for the codegen, e.g. the SaveToFile function in TVM.

I am also misled that the make instruction only builds the libraries, and users can install the built HeteroCL with their favorite python. However, I found it revoked python2 in my Linux, which is not I expected. Since python refers to Python 2 while python3 refers to the correct Python 3 version in some Linux systems, I suggest separate this part for the default installation. Otherwise, provide a $(PYTHON) variable for users to change their python versions.

To sum up, the installation guide needs to be enhanced, and supports for newer versions of LLVM should be added. After deleting the build-pkgs requisite, maybe something like

make build-tvm
export HCL_HOME=/path/to/heterocl
export PYTHONPATH=$HCL_HOME/python:$HCL_HOME/hlib/python:${PYTHONPATH}

would be preferable.

zhangzhiru commented 4 years ago

@chhzh123 do you plan to submit a PR that fixes some of these issues?

Note that we are not too interested in supporting newer version of LLVM for now (as it's only useful for CPU sim right now). Regardless, our installation guide should be clear about the version we recommend; plus the build system should not re-download and rebuild LLVM even user has already set the local path.

chhzh123 commented 4 years ago

@chhzh123 do you plan to submit a PR that fixes some of these issues?

Note that we are not too interested in supporting newer version of LLVM for now (as it's only useful for CPU sim right now). Regardless, our installation guide should be clear about the version we recommend; plus the build system should not re-download and rebuild LLVM even user has already set the local path.

Well, then leave it without changes.

zhangzhiru commented 4 years ago

You mentioned that the build system downloads LLVM 6 despite of the changes in Makefile.config. Have you fixed that issue?

chhzh123 commented 4 years ago

Yes, I found that results from the original configuration file that only recognizes LLVM 7.0 and below. I have created a PR to fix it.