Paddle win10源码编译cmake报错

rkkpypqq  于 2022-11-03  发布在  其他
关注(0)|答案(6)|浏览(393)

GPU Paddle release-1.8
win10, cuda 10.0, cudnn 7.6, python 3.7,Visual Studio 2017
按照官方文档里win编译需要的python库:umpy, protobuf, wheel都安装。

cmake命令:
cmake .. -G "Visual Studio 15 2017 Win64" -DPY_VERSION=3.7 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DWITH_FLUID_ONLY=ON -DWITH_GPU=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}

报错地方:
CMake Error at cmake/generic.cmake:313 (add_dependencies): The dependency target "python" of target "py_func_op" does not exist.

CMake Error at cmake/generic.cmake:313 (add_dependencies): The dependency target "python" of target "paddle_pybind" does not exist.

以及诸多警告:

CMake Warning at CMakeLists.txt:126 (MESSAGE):
  Disable NCCL when compiling for Windows.  Force WITH_NCCL=OFF.

CMake Warning at CMakeLists.txt:144 (MESSAGE):
  If the environment is multi-card, the WITH_NCCL option needs to be turned
  on, otherwise only a single card can be used.

CMake Warning at cmake/tensorrt.cmake:46 (message):
  TensorRT is NOT found when WITH_DSO is ON.

CMake Warning at CMakeLists.txt:224 (message):
  On inference mode, will take place some specific optimization.  Turn on the
  ON_INFER flag when building inference_lib only.

CMake Warning:
  Manually-specified variables were not used by the project:

把完整的编译过程贴下来:

\Paddle\build>cmake .. -G "Visual Studio 15 2017 Win64" -DPY_VERSION=3.7 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DWITH_FLUID_ONLY=ON -DWITH_GPU=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}
-- Found Paddle host system: win32, version:
-- Found Paddle host system's CPU: 12 cores
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363.
-- The CXX compiler identification is MSVC 19.16.27041.0
-- The C compiler identification is MSVC 19.16.27041.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/AppInstall/Work/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - 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: D:/AppInstall/Work/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CXX compiler: D:/AppInstall/Work/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe, version: MSVC 19.16.27041.0
-- C compiler: D:/AppInstall/Work/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe, version: MSVC 19.16.27041.0
-- AR tools: D:/AppInstall/Work/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/lib.exe
-- Use static C runtime time, refer to https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=vs-2019
-- Using parallel compiling (/MP)
-- Found Git: D:/AppInstall/Work/Git/cmd/git.exe (found version "2.27.0.windows.1")
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Performing Test MMX_FOUND
-- Performing Test MMX_FOUND - Failed
-- Performing Test SSE2_FOUND
-- Performing Test SSE2_FOUND - Success
-- Performing Test SSE3_FOUND
-- Performing Test SSE3_FOUND - Success
-- Performing Test AVX_FOUND
-- Performing Test AVX_FOUND - Success
-- Performing Test AVX2_FOUND
-- Performing Test AVX2_FOUND - Success
-- Performing Test AVX512F_FOUND
-- Performing Test AVX512F_FOUND - Failed
CMake Warning at CMakeLists.txt:126 (MESSAGE):
  Disable NCCL when compiling for Windows.  Force WITH_NCCL=OFF.

CMake Warning at CMakeLists.txt:144 (MESSAGE):
  If the environment is multi-card, the WITH_NCCL option needs to be turned
  on, otherwise only a single card can be used.

-- Current cuDNN header is D:/AppInstall/Work/Nivida GPU Computing/include/cudnn.h. Current cuDNN version is v7.6.
-- Disable XBYAK in Windows and MacOS
-- Looking for C++ include shlwapi.h
-- Looking for C++ include shlwapi.h - found
-- BOOST_VERSION: 1.41.0, BOOST_URL: http://paddlepaddledeps.bj.bcebos.com/boost_1_41_0.tar.gz
-- warp-ctc library: C:/Users/xx/Paddle/build/third_party/install/warpctc/bin/warpctc.dll
-- Download dependence[cudaerror] from http://paddlepaddledeps.bj.bcebos.com/cudaErrorMessage.tar.gz
-- MKLML_VER: mklml_win_2019.0.1.20181227, MKLML_URL: https://paddlepaddledeps.bj.bcebos.com/mklml_win_2019.0.1.20181227.zip
-- Found cblas and lapack in MKLML (include: C:/Users/xx/Paddle/build/third_party/install/mklml/include, library: C:/Users/xx/Paddle/build/third_party/install/mklml/lib/mklml.lib)
-- Set C:/Users/xx/Paddle/build/third_party/install/mkldnn/llib to runtime path
-- MKLDNN library: C:/Users/xx/Paddle/build/third_party/install/mkldnn/bin/mkldnn.lib
-- Protobuf protoc executable: C:/Users/xx/Paddle/build/third_party/install/protobuf/bin/protoc.exe
-- Protobuf-lite library: C:/Users/xx/Paddle/build/third_party/install/protobuf/lib/libprotobuf-lite.lib
-- Protobuf library: C:/Users/xx/Paddle/build/third_party/install/protobuf/lib/libprotobuf.lib
-- Protoc library: C:/Users/xx/Paddle/build/third_party/install/protobuf/lib/libprotoc.lib
-- Protobuf version: 3.1.0
-- Found PythonInterp: C:/Users/xx/Paddle/build/${PYTHON_EXECUTABLE} (Required is at least version "3.7")
-- Found PythonLibs: C:/Users/xx/Paddle/build/${PYTHON_LIBRARY} (Required is at least version "3.7")
-- Looking for UINT64_MAX
-- Looking for UINT64_MAX - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of pthread_spinlock_t
-- Check size of pthread_spinlock_t - failed
-- Check size of pthread_barrier_t
-- Check size of pthread_barrier_t - failed
-- CUDA detected: 10.0
-- WARNING: This is just a warning for publishing release.
      You are building GPU version without supporting different architectures.
      So the wheel package may fail on other GPU architectures.
      You can add -DCUDA_ARCH_NAME=All in cmake command
      to get a full wheel package to resolve this warning.
      While, this version will still work on local GPU architecture.
-- Automatic GPU detection failed. Building for all known architectures.
-- Added CUDA NVCC flags for: sm_30 sm_35 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75
CMake Warning at cmake/tensorrt.cmake:46 (message):
  TensorRT is NOT found when WITH_DSO is ON.
Call Stack (most recent call first):
  CMakeLists.txt:183 (include)

-- Paddle version is 0.0.0
-- Found CUDA: ${CUDA_TOOLKIT_ROOT_DIR} (found version "10.0")
-- Cannot find CUPTI, GPU Profiling is incorrect.
-- Enable Intel OpenMP with C:/Users/xx/Paddle/build/third_party/install/mklml/lib/libiomp5md.lib
CMake Warning at CMakeLists.txt:224 (message):
  On inference mode, will take place some specific optimization.  Turn on the
  ON_INFER flag when building inference_lib only.

-- commit: 659da23f17
-- branch: release/1.8
-- WARNING: This is just a warning for publishing release.
      You are building AVX version without NOAVX core.
      So the wheel package may fail on NOAVX machine.
      You can add -DFLUID_CORE_NAME=/path/to/your/core_noavx.* in cmake command
      to get a full wheel package to resolve this warning.
      While, this version will still work on local machine.
-- Configuring done
CMake Error at cmake/generic.cmake:313 (add_dependencies):
  The dependency target "python" of target "py_func_op" does not exist.
Call Stack (most recent call first):
  paddle/fluid/operators/CMakeLists.txt:123 (cc_library)

CMake Error at cmake/generic.cmake:313 (add_dependencies):
  The dependency target "python" of target "paddle_pybind" does not exist.
Call Stack (most recent call first):
  paddle/fluid/pybind/CMakeLists.txt:114 (cc_library)

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    WITH_FLUID_ONLY

CMake Generate step failed.  Build files cannot be regenerated correctly.
xlpyo6sf

xlpyo6sf1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看 官网API文档常见问题历史IssueAI社区 来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

z31licg0

z31licg02#

@Grubby-Wang https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/compile/compile_Windows.html 您好,请使用这篇文档进行编译,cmake 配置为 cmake .. -G "Visual Studio 14 2015 Win64" -DWITH_GPU=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release 你这篇文档应该是很早期的文档。
warning为特意打出来的提示信息,没有别的问题。

efzxgjgh

efzxgjgh3#

档。
warning为特意打出来的提示信息,没有别的问题。

@zhouwei25更换了您提供的方法,报错的还是一样的问题:

CMake Error at cmake/generic.cmake:313 (add_dependencies):
  The dependency target "python" of target "py_func_op" does not exist.
Call Stack (most recent call first):
  paddle/fluid/operators/CMakeLists.txt:123 (cc_library)

CMake Error at cmake/generic.cmake:313 (add_dependencies):
  The dependency target "python" of target "paddle_pybind" does not exist.
Call Stack (most recent call first):
  paddle/fluid/pybind/CMakeLists.txt:114 (cc_library)

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
jpfvwuh4

jpfvwuh44#

@Grubby-Wang 看看python有没有装好

jjhzyzn0

jjhzyzn05#

@zhouwei25多谢回复,重新确认python正常,并重新安装,安装仍然有问题,报错跟之前一样,不知道是哪里没安装或者设置未设置好

zhte4eai

zhte4eai6#

问题已解决,cmake 方法的问题,但是深入原因不清楚:
cmake .. -G "Visual Studio 15 2017" -A x64 -DWITH_GPU=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DPY_VERSION=3
参考用的文档是:https://paddle-inference.readthedocs.io/en/latest/user_guides/source_compile.html#windows-10

相关问题