google / ml-compiler-opt

Infrastructure for Machine Learning Guided Optimization (MLGO) in LLVM.
Apache License 2.0
612 stars 92 forks source link

【BUG】clang (LLVM option parsing): Unknown command line argument '-tfutils-use-simplelogger' #315

Closed 18liumin closed 9 months ago

mtrofin commented 10 months ago

how did you build clang, are you sure it has tflite linked?

18liumin commented 10 months ago

how did you build clang, are you sure it has tflite linked?

cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_LTO=OFF -DCMAKE_INSTALL_PREFIX=${LLVM_INSTALLDIR} -DLLVM_ENABLE_PROJECTS="clang;lld" -DTENSORFLOW_C_LIB_PATH=${TENSORFLOW_C_LIB_PATH} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=On -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -C ${TFLITE_PATH}/tflite.cmake

Is -DTENSORFLOW_C_LIB_PATH parameter required? use libtensorflow-cpu-linux-x86_64-2.6.0.tar.gz i just want to use my my own data set

mtrofin commented 10 months ago

-DTENSORFLOW_C_LIB_PATH and -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=On aren't required anymore, so just the -C ${TFLITE_PATH}/tflite.cmake should be enough. Can you test that TFLiteUtils.cpp is compiled?

fwiw, -tfutils-use-simplelogger is also not needed anymore, and you can yank it out of the place it's passed in compilation_runner.py, but regardless, there seems to be an issue with the build not appearing to pick TFLiteUtils.cpp.

18liumin commented 10 months ago

-DTENSORFLOW_C_LIB_PATH and -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=On aren't required anymore, so just the -C ${TFLITE_PATH}/tflite.cmake should be enough. Can you test that TFLiteUtils.cpp is compiled?

fwiw, -tfutils-use-simplelogger is also not needed anymore, and you can yank it out of the place it's passed in compilation_runner.py, but regardless, there seems to be an issue with the build not appearing to pick TFLiteUtils.cpp.

My llvm-project does not have TFLiteUtils.cpp file, Because the branch was switched : git checkout fa4c3f70ff0768a270b0620dc6d158ed1205ec4e

boomanaiden154 commented 10 months ago

You should probably just build with main. That commit is pretty out of date at this point and that line should probably be removed from the demo, or a more recent commit at least should be put up to avoid confusion.

If you ran the steps to grab the actual commit SHA that Fuchsia is using though, you should get something much more recent.

mtrofin commented 9 months ago

The flag has been removed in both llvm repo and here - closing (cdfb51295d814a875925974364931ef4337641e1 and PR #316, respectivelly)