sophgo / tpu-mlir

Machine learning compiler based on MLIR for Sophgo TPU.
Other
613 stars 154 forks source link

I can't build success by docker image #162

Closed sexjun closed 10 months ago

sexjun commented 10 months ago

I can't build success by the guide: https://github.com/sophgo/tpu-mlir/blob/master/README_cn.md after I pull docker and try to build it by

cd tpu-mlir
source ./envsetup.sh
./build.sh

I will put log on the end of this page.

code base:

commit 882a3523221481145f7114c215cc1267920a3637 (HEAD -> master, origin/master, origin/HEAD)

docker images ![Uploading image.png…]()

build failed log:

root@349de6d777b0:/workspace# ls
CMakeLists.txt  README_cn.md  capi    envsetup.sh   include  regression      release_pip.sh  third_party
LICENSE         bindings      docker  experimental  lib      release.sh      release_tools   tools
README.md       build.sh      docs    ignore        python   release_doc.sh  test            unittests
root@349de6d777b0:/workspace# source ./envsetup.sh
PROJECT_ROOT : /workspace
BUILD_PATH   : /workspace/build
INSTALL_PATH : /workspace/install
root@349de6d777b0:/workspace# ./build.sh
BUILD_PATH: /workspace/build
INSTALL_PATH: /workspace/install
BUILD_FLAG:
-- variable_test NPU_NUM_test_fp16=8, default=8
-- variable_test IC_PARALLEL_test_fp16=4, default=4
-- variable_test EU_NUM_test_fp16=8, default=8
-- variable_test LOCAL_MEM_SHIFT=17, default=17
-- The CXX compiler identification is Clang 14.0.0
-- The C compiler identification is Clang 14.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /usr/lib/x86_64-linux-gnu/libtinfo.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13")
-- Using MLIRConfig.cmake in: /usr/local/lib/cmake/mlir
-- Using LLVMConfig.cmake in: /usr/local/lib/cmake/llvm
-- Linker detection: GNU ld
-- Using LLVM_INCLUDE_DIRS in: /usr/local/include
-- Using MLIR_INCLUDE_DIRS in: /usr/local/include
-- Found OpenMP_C: -fopenmp=libomp (found version "5.0")
-- Found OpenMP_CXX: -fopenmp=libomp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- tpu-mlir version: v1.5.beta.0-233-g882a35232-20240110
-- CMAKE_CXX_FLAGS: -O2 -fopenmp=libomp -fPIC -Werror -Wno-unused-result -Wreturn-type -Wunused-variable
-- To compile fbs files /workspace/include/tpu_mlir/Builder/BM168x/bmodel.fbs for bmodel_generated.h
-- To compile fbs files /workspace/include/tpu_mlir/Builder/CV18xx/proto/cvimodel.fbs for cvimodel_generated.h
-- To compile fbs files /workspace/include/tpu_mlir/Builder/CV18xx/proto/parameter.fbs for parameter_generated.h
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so (found suitable version "3.10.12", minimum required is "3")
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3.7")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Performing Test HAS_FLTO_THIN
-- Performing Test HAS_FLTO_THIN - Success
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter Development.Module NumPy
-- Found python include dirs: /usr/include/python3.10
-- Found python libraries:
-- Found numpy v1.24.3: /usr/local/lib/python3.10/dist-packages/numpy/core/include
-- Using explicit pybind11 cmake directory: /usr/local/share/cmake/pybind11 (-Dpybind11_DIR to change)
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found pybind11 v2.11.1: /usr/local/include
-- Python prefix = '', suffix = '', extension = '.cpython-310-x86_64-linux-gnu.so
-- Found python include dirs: /usr/include/python3.10
-- Found python libraries:
-- Found numpy v1.24.3: /usr/local/lib/python3.10/dist-packages/numpy/core/include
-- Using explicit pybind11 cmake directory: /usr/local/share/cmake/pybind11 (-Dpybind11_DIR to change)
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found pybind11 v2.11.1: /usr/local/include
-- Python prefix = '', suffix = '', extension = '.cpython-310-x86_64-linux-gnu.so
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/build
[963/1349] Building CXX object tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/AutoInputConversion.cpp.o
FAILED: tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/AutoInputConversion.cpp.o
/usr/bin/ccache /usr/bin/clang++ -DEU_NUM_test_fp16=8 -DGTEST_HAS_RTTI=0 -DIC_PARALLEL_test_fp16=4 -DLOCAL_MEM_SHIFT=17 -DMLIR_VERSION=\"v1.5.beta.0-233-g882a35232-20240110\" -DNPU_NUM_test_fp16=8 -I/workspace/include -I/workspace/build/include -I/workspace/install/include -I/workspace/third_party/cnpy -I/workspace/third_party/nntoolchain/include -I/workspace/third_party/CV18xx/include -I/workspace/third_party/progressbar/include -I/workspace/tools/tpuc-opt-experiment -I/workspace/tools/tpuc-opt-experiment/include -I/workspace/build/tools/tpuc-opt-experiment -O2 -fopenmp=libomp -fPIC -Werror -Wno-unused-result -Wreturn-type -Wunused-variable  -fno-exceptions -funwind-tables -fno-rtti -std=gnu++17 -MD -MT tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/AutoInputConversion.cpp.o -MF tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/AutoInputConversion.cpp.o.d -o tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/AutoInputConversion.cpp.o -c /workspace/tools/tpuc-opt-experiment/InputConversion/AutoInputConversion.cpp
[964/1349] Building CXX object tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o
FAILED: tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o
/usr/bin/ccache /usr/bin/clang++ -DEU_NUM_test_fp16=8 -DGTEST_HAS_RTTI=0 -DIC_PARALLEL_test_fp16=4 -DLOCAL_MEM_SHIFT=17 -DMLIR_VERSION=\"v1.5.beta.0-233-g882a35232-20240110\" -DNPU_NUM_test_fp16=8 -I/workspace/include -I/workspace/build/include -I/workspace/install/include -I/workspace/third_party/cnpy -I/workspace/third_party/nntoolchain/include -I/workspace/third_party/CV18xx/include -I/workspace/third_party/progressbar/include -I/workspace/tools/tpuc-opt-experiment -I/workspace/tools/tpuc-opt-experiment/include -I/workspace/build/tools/tpuc-opt-experiment -O2 -fopenmp=libomp -fPIC -Werror -Wno-unused-result -Wreturn-type -Wunused-variable  -fno-exceptions -funwind-tables -fno-rtti -std=gnu++17 -MD -MT tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o -MF tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o.d -o tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o -c /workspace/tools/tpuc-opt-experiment/InputConversion/SetEntryPoint.cpp
AILED: tools/tpuc-opt-experiment/Inp

^Cninja: build stopped: interrupted by user.

root@349de6d777b0:/workspace# ./build.sh
BUILD_PATH: /workspace/build
INSTALL_PATH: /workspace/install
BUILD_FLAG:
-- variable_test NPU_NUM_test_fp16=8, default=8
-- variable_test IC_PARALLEL_test_fp16=4, default=4
-- variable_test EU_NUM_test_fp16=8, default=8
-- variable_test LOCAL_MEM_SHIFT=17, default=17
-- Using MLIRConfig.cmake in: /usr/local/lib/cmake/mlir
-- Using LLVMConfig.cmake in: /usr/local/lib/cmake/llvm
-- Using LLVM_INCLUDE_DIRS in: /usr/local/include
-- Using MLIR_INCLUDE_DIRS in: /usr/local/include
-- tpu-mlir version: v1.5.beta.0-233-g882a35232-20240110
-- CMAKE_CXX_FLAGS: -O2 -fopenmp=libomp -fPIC -Werror -Wno-unused-result -Wreturn-type -Wunused-variable
-- To compile fbs files /workspace/include/tpu_mlir/Builder/BM168x/bmodel.fbs for bmodel_generated.h
-- To compile fbs files /workspace/include/tpu_mlir/Builder/CV18xx/proto/cvimodel.fbs for cvimodel_generated.h
-- To compile fbs files /workspace/include/tpu_mlir/Builder/CV18xx/proto/parameter.fbs for parameter_generated.h
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found python include dirs: /usr/include/python3.10
-- Found python libraries:
-- Found numpy v1.24.3: /usr/local/lib/python3.10/dist-packages/numpy/core/include
-- Using explicit pybind11 cmake directory: /usr/local/share/cmake/pybind11 (-Dpybind11_DIR to change)
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found pybind11 v2.11.1: /usr/local/include
-- Python prefix = '', suffix = '', extension = '.cpython-310-x86_64-linux-gnu.so
-- Found python include dirs: /usr/include/python3.10
-- Found python libraries:
-- Found numpy v1.24.3: /usr/local/lib/python3.10/dist-packages/numpy/core/include
-- Using explicit pybind11 cmake directory: /usr/local/share/cmake/pybind11 (-Dpybind11_DIR to change)
-- Found pybind11: /usr/local/include (found version "2.11.1")
-- Found pybind11 v2.11.1: /usr/local/include
-- Python prefix = '', suffix = '', extension = '.cpython-310-x86_64-linux-gnu.so
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/build
[4/392] Building CXX object tools/tpuc-opt-experiment/GlobalOptimization/CMakeFiles/obj.MLIRGlobalOptimization.dir/RemoveZeroExtentTensors.cpp.o
FAILED: tools/tpuc-opt-experiment/GlobalOptimization/CMakeFiles/obj.MLIRGlobalOptimization.dir/RemoveZeroExtentTensors.cpp.o
/usr/bin/ccache /usr/bin/clang++ -DEU_NUM_test_fp16=8 -DGTEST_HAS_RTTI=0 -DIC_PARALLEL_test_fp16=4 -DLOCAL_MEM_SHIFT=17 -DMLIR_VERSION=\"v1.5.beta.0-233-g882a35232-20240110\" -DNPU_NUM_test_fp16=8 -I/workspace/include -I/workspace/build/include -I/workspace/install/include -I/workspace/third_party/cnpy -I/workspace/third_party/nntoolchain/include -I/workspace/third_party/CV18xx/include -I/workspace/third_party/progressbar/include -I/workspace/tools/tpuc-opt-experiment -I/workspace/tools/tpuc-opt-experiment/include -I/workspace/build/tools/tpuc-opt-experiment -O2 -fopenmp=libomp -fPIC -Werror -Wno-unused-result -Wreturn-type -Wunused-variable  -fno-exceptions -funwind-tables -fno-rtti -std=gnu++17 -MD -MT tools/tpuc-opt-experiment/GlobalOptimization/CMakeFiles/obj.MLIRGlobalOptimization.dir/RemoveZeroExtentTensors.cpp.o -MF tools/tpuc-opt-experiment/GlobalOptimization/CMakeFiles/obj.MLIRGlobalOptimization.dir/RemoveZeroExtentTensors.cpp.o.d -o tools/tpuc-opt-experiment/GlobalOptimization/CMakeFiles/obj.MLIRGlobalOptimization.dir/RemoveZeroExtentTensors.cpp.o -c /workspace/tools/tpuc-opt-experiment/GlobalOptimization/RemoveZeroExtentTensors.cpp
[5/392] Building CXX object tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o
FAILED: tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o
/usr/bin/ccache /usr/bin/clang++ -DEU_NUM_test_fp16=8 -DGTEST_HAS_RTTI=0 -DIC_PARALLEL_test_fp16=4 -DLOCAL_MEM_SHIFT=17 -DMLIR_VERSION=\"v1.5.beta.0-233-g882a35232-20240110\" -DNPU_NUM_test_fp16=8 -I/workspace/include -I/workspace/build/include -I/workspace/install/include -I/workspace/third_party/cnpy -I/workspace/third_party/nntoolchain/include -I/workspace/third_party/CV18xx/include -I/workspace/third_party/progressbar/include -I/workspace/tools/tpuc-opt-experiment -I/workspace/tools/tpuc-opt-experiment/include -I/workspace/build/tools/tpuc-opt-experiment -O2 -fopenmp=libomp -fPIC -Werror -Wno-unused-result -Wreturn-type -Wunused-variable  -fno-exceptions -funwind-tables -fno-rtti -std=gnu++17 -MD -MT tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o -MF tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o.d -o tools/tpuc-opt-experiment/InputConversion/CMakeFiles/obj.MLIRInputConversion.dir/SetEntryPoint.cpp.o -c /workspace/tools/tpuc-opt-experiment/InputConversion/SetEntryPoint.cpp
^Cninja: build stopped: interrupted by user.
sexjun commented 10 months ago
AACengineer commented 5 months ago

I had the same problem, how did you solve it? @sexjun