我想在OS X Yosemite 10.10上为Python 2.7安装dlib。我尝试了pip和手动安装,两种情况下的错误都是一样的。下面我提供pip安装的回溯和CMakeError.log文件的内容。
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
-- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA
CMake Error at /private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/dlib/cmake_utils/use_cpp_11.cmake:74 (target_compile_features):
target_compile_features The compiler feature "cxx_thread_local" is not
known to CXX compiler
"Clang"
version 7.0.2.7000181.
Call Stack (most recent call first):
/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/dlib/CMakeLists.txt:770 (enable_cpp11_for_target)
-- Building a C++11 test project to see if your compiler supports C++11
-- ********** Your compiler failed to build a C++11 project. C++11 is required to use all parts of dlib! **********
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- C++11 activated (compiler doesn't have full C++11 support).
-- Found Python with installed numpy package
-- Numpy include path '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include'
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/build/temp.macosx-10.6-intel-2.7/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/setup.py", line 249, in <module>
'Topic :: Software Development',
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 563, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/setup.py", line 129, in run
self.build_extension(ext)
File "/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/setup.py", line 163, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/build/lib.macosx-10.6-intel-2.7', '-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-vW_HWD-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/45/0flgc1fd2y34rcnttzrxz5d80000gr/T/pip-build-4I4QuR/dlib/
这就是CMakeError.log文件中的内容:
Determining if the function sgetrf_single exists failed with the following output:
Change Dir: /Users/Meruyert/dlib/build/temp.macosx-10.6-intel-2.7/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_2cace/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_2cace.dir/build.make CMakeFiles/cmTC_2cace.dir/build
Building C object CMakeFiles/cmTC_2cace.dir/CheckFunctionExists.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgetrf_single -fPIE -o CMakeFiles/cmTC_2cace.dir/CheckFunctionExists.c.o -c /usr/local/Cellar/cmake/3.10.3/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_2cace
/usr/local/Cellar/cmake/3.10.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2cace.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgetrf_single -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_2cace.dir/CheckFunctionExists.c.o -o cmTC_2cace /usr/lib/libcblas.dylib
Undefined symbols for architecture x86_64:
"_sgetrf_single", referenced from:
_main in CheckFunctionExists.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_2cace] Error 1
make: *** [cmTC_2cace/fast] Error 2
如何解决此问题的任何帮助或建议将非常感谢!