2017-02-03 16 views
1

Windows 10、CMake 3.7.0、CUDA v8.0CMake:内部CMake変数が必要でないエラーが発生しました

CMakeはすぐに何かを見つけることができません。

cmake_minimum_required(VERSION 3.0) 
find_package(CUDA REQUIRED) 
#... 
#(other stuff here) 

が出力として、私が手::

CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): 
    Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found version "8.0") 
Call Stack (most recent call first): 
    C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) 
    C:/Program Files/CMake/share/cmake-3.7/Modules/FindCUDA.cmake:1013 (find_package_handle_standard_args) 
    CMakeLists.txt:2 (find_package) 

ですが、なぜでしょう私のcmakeのファイルは、ように見えますか?私が設定しなければならない環境変数はありますか?いくつかのUbuntuプロジェクトでは、変数CUDA_TOOKIT_ROOT_DIRを設定する必要がありました。しかし、私はそれが正しい場所(C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0)でなければならないと信じているものに設定し、これは何もしていないようです。私は何を設定する必要がありますか?

答えて

6

project()コールがなければ、ほとんどのCMakeコマンドは機能しません。そしてfind_package()もその一つです。唯一set()コマンドはproject()コールに先行していてもよい

通常、他のすべてのコマンドは、それに従ってください:

cmake_minimum_required(VERSION 3.0) 
project(MyProject) # <-- This defines many internal CMake variables, required for other commands. 
find_package(CUDA REQUIRED) 
+0

まあ、私は愚かな感じ。私のプロジェクトのコマンドは、cudaの要件の後でした。意味あり。ありがとう。 – user650261

関連する問題