SSE4 used when not exist
When trying to use DLib python binding, i got this error.
Dlib was compiled to use SSE41 instructions, but these aren't available on your machine.
So i tried to compile it manualy to remove SSE41 inclusion, without success. I've try several flags like -DUSE_SSE4_INSTRUCTIONS=off
and -DENABLE_SSE4=off
to disable SSE4 but it always enabled
(my-env) root@server:~/dlib-19.21# python setup.py install --set USE_SSE4_INSTRUCTION=off
running install
running bdist_egg
running egg_info
writing tools/python/dlib.egg-info/PKG-INFO
writing dependency_links to tools/python/dlib.egg-info/dependency_links.txt
writing top-level names to tools/python/dlib.egg-info/top_level.txt
package init file 'tools/python/dlib/__init__.py' not found (or not a regular file)
reading manifest file 'tools/python/dlib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'tools/python/build*'
writing manifest file 'tools/python/dlib.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Building extension for Python 3.6.0 | packaged by conda-forge | (default, Feb 9 2017, 14:36:55)
Invoking CMake setup: 'cmake /root/dlib-19.21/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/root/dlib-19.21/build/lib.linux-x86_64-3.6 -DPYTHON_EXECUTABLE=/opt/anaconda/envs/my-env/bin/python -DUSE_SSE4_INSTRUCTION=off -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /opt/anaconda/envs/my-env/bin/python (found version "3.6")
-- Found PythonLibs: /opt/anaconda/envs/my-env/lib/libpython3.6m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- pybind11 v2.2.2
-- Using CMake version: 3.18.4
-- Compiling dlib version: 19.21.0
-- SSE4 instructions can be executed by the host processor.
-- Enabling SSE4 instructions
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
It turns out our server has glitchy cpu flags. It is a VM.
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc rep_good nopl cpuid tsc_known_freq pni ssse3 cx16 pcid sse4_2 x2apic hypervisor lahf_lm pti
It doesn't have SSE4 instruction but have SSE4.2. Maybe because of that CMake think that it should enable SSE4.
Our server running Ubuntu 20.04