我知道初始平台检查失败的几个原因cmake
,但在我的情况下无法弄清楚,主要是因为 cmake 似乎删除了用于检查的目录。
作为一个例子,我尝试编译 OpenCV:
\n$ cmake ..\n-- The CXX compiler identification is AppleClang 12.0.0.12000032\n-- The C compiler identification is AppleClang 12.0.0.12000032\n-- Detecting CXX compiler ABI info\n-- Detecting CXX compiler ABI info - failed\n-- Check for working CXX compiler: /usr/local/opt/ccache/libexec/c++\n-- Check for working CXX compiler: /usr/local/opt/ccache/libexec/c++ - broken\nCMake Error at /usr/local/Cellar/cmake/3.20.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:59 (message):\n The C++ compiler\n\n "/usr/local/opt/ccache/libexec/c++"\n\n is not able to compile a simple test program.\n\n It fails with the following output:\n\n Change Dir: custom_dep_location/downloads/opencv-4.1.1/build/CMakeFiles/CMakeTmp\n \n Run Build Command(s):/usr/bin/make -f Makefile cmTC_35974/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_35974.dir/build.make CMakeFiles/cmTC_35974.dir/build\n Building CXX object CMakeFiles/cmTC_35974.dir/testCXXCompiler.cxx.o\n /usr/local/opt/ccache/libexec/c++ -Icustom_dep_location/include -Lcustom_dep_location/lib -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -fPIE -MD -MT CMakeFiles/cmTC_35974.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_35974.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_35974.dir/testCXXCompiler.cxx.o -c custom_dep_location/downloads/opencv-4.1.1/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx\n clang: warning: argument unused during compilation: '-Lcustom_dep_location/lib' [-Wunused-command-line-argument]\n Linking CXX executable cmTC_35974\n /usr/local/Cellar/cmake/3.20.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_35974.dir/link.txt --verbose=1\n /usr/local/opt/ccache/libexec/c++ -Icustom_dep_location/include -Lcustom_dep_location/lib -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_35974.dir/testCXXCompiler.cxx.o -o cmTC_35974 \n ld: warning: directory not found for option '-Lcustom_dep_location/lib'\n clang: error: linker command failed with exit code 1 (use -v to see invocation)\n make[1]: *** [cmTC_35974] Error 1\n make: *** [cmTC_35974/fast] Error 2\n \n \n\n \n\n CMake will not be able to correctly generate this project.\nCall Stack (most recent call first):\n CMakeLists.txt:108 (project)\n\n\n-- Configuring incomplete, errors occurred!\nSee also "custom_dep_location/downloads/opencv-4.1.1/build/CMakeFiles/CMakeOutput.log".\nSee also "custom_dep_location/downloads/opencv-4.1.1/build/CMakeFiles/CMakeError.log".\n
Run Code Online (Sandbox Code Playgroud)\n所以我很自然地想知道到底是什么失败了,可悲的是没有提到这一点。看来用于检查的临时文件夹实际上并不存在。\n当我查看时
\n Run Build Command(s):/usr/bin/make -f Makefile cmTC_35974/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_35974.dir/build.make CMakeFiles/cmTC_35974.dir/build\n
Run Code Online (Sandbox Code Playgroud)\n我假设这些目录相对于调用 cmake 的目录(因此 cwd),但它们不存在,因此我无法手动重新运行命令来获取更多错误消息。\n它们也不是临时目录或其他/var/\xe2\x80\xa6
任何地方我的系统
如何让 cmake 保留其临时目录、找到它们并手动执行它正在尝试但失败的命令?
\n 归档时间: |
|
查看次数: |
1011 次 |
最近记录: |