File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,10 +162,17 @@ if(HNSWLIB_EXAMPLES)
162162 endif ()
163163 endif ()
164164 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
165- # We enable optimizations in all build types, even in Debug.
166- add_cxx_flags (
167- -Ofast -lrt -march=native -w -fopenmp -ftree-vectorize
168- -ftree-vectorizer-verbose=0 )
165+ add_cxx_flags (-Ofast -std=c++11 -DHAVE_CXX0X -fpic -w -fopenmp -ftree-vectorize -ftree-vectorizer-verbose=0 )
166+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc|powerpc" )
167+ add_cxx_flags (-mtune=native )
168+ message ("set -mtune=native flag" )
169+ else ()
170+ add_cxx_flags (-march=native )
171+ message ("set -march=native flag" )
172+ endif ()
173+ if (NOT APPLE )
174+ add_cxx_flags (-lrt )
175+ endif ()
169176 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
170177 if (NOT HNSWLIB_ENABLE_EXCEPTIONS)
171178 # Do not enable exceptions by default. We will enable them on a
You can’t perform that action at this time.
0 commit comments