HabanaAI / tpc_llvm

TPC-CLANG compiler that compiles a TPC C programming language which is used in HabanaLabs Deep-Learning Accelerators
22 stars 4 forks source link

adding -p | --prefix to buildTPC_LLVM.sh ? #1

Open torehl opened 2 years ago

torehl commented 2 years ago

Hi, would it be possible to add --prefix to the build script?

Should set -DCMAKE_INSTALL_PREFIX option. Makes it easier for nonstandard installs, e.g. module environment.

e.g.

# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "/cm/shared/apps/habana/tpc-llvm/1.0.0")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

Rgds, ToreL

michaelz-eng commented 2 years ago

Hi Torel,

Thank you for sharing with us your thoughts. The problem that I see with supporting the installation flag is that the user may override the original OS compiler. The names of both Habana's CXX and C compilers are clang-10 and clang++-10 as of the original system compiler. I can add an optional flag to the script to install the component according to the user request, like --install=path what do you think?

Thanks, Michael Zuckerman

torehl commented 2 years ago

I prepend-path. It's kind of expected that it replaces clang-10, if installed. Normally the HPC systems OS is quite a bit older, and clang-10 is not in. I have

prepend-path PATH /cm/shared/apps/habana/tpc-llvm/1.0.0/bin setenv CC /cm/shared/apps/habana/tpc-llvm/1.0.0/bin/clang setenv CXX /cm/shared/apps/habana/tpc-llvm/1.0.0/bin/clang++