tensorflow / mlir-hlo

399 stars 70 forks source link

build error /usr/bin/ld.lld: error: unknown argument: --push-state #9

Open victorygogogo opened 3 years ago

victorygogogo commented 3 years ago

-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/e0004850/project_code/llvm_for_hlo/llvm-build

how to solve this problem

victorygogogo commented 3 years ago

if use "DLLVM_INSTALL_UTILS=ON" will cause this problem.

joker-eph commented 3 years ago

The issue seems like mixing gcc with the lld linker. Which version of gcc are you using? (/usr/bin/cc --version) Disabling -DLLVM_ENABLE_LLD=ON or building with clang (or a more recent gcc) should work I think?

victorygogogo commented 3 years ago

gcc version (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0 , Disabling -DLLVM_ENABLE_LLD=ON build is ok when use "build_tools/build_mlir.sh ${PWD}/llvm-project/ ${PWD}/llvm-build" this command $ mkdir build && cd build $ cmake .. -GNinja \ -DLLVM_ENABLE_LLD=ON \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_ASSERTIONS=On \ -DMLIR_DIR=${PWD}/../llvm-build/lib/cmake/mlir $ ninja check-mlir-hlo use the above command, set -DLLVM_ENABLE_LLD=OFF \ cause a link problem , so set -DLLVM_ENABLE_LLD=ON build is ok, is there any problem build like this?

and how to build wth clang ,can you tell me ?

joker-eph commented 3 years ago

-DCMAKE_C_COMPILER=<path_to_clang> -DCMAKE_CXX_COMPILER=<path_to_clang++>