Skip to content

[cmake] AVX not detected on macos #5120

@themightyoarfish

Description

@themightyoarfish

I am compiling the current master c1835f4.

System is macos 10.15.7. The cmake configuration process does not pick up on the fact that both AVX and AVX2 should be available:

 > cmake ..                 -DBUILD_io=ON                 -DWITH_VTK=ON -DBUILD_kdtree=ON                 -DBUILD_visualization=ON -DBUILD_octree=ON                 -DBUILD_io=ON                 -DBUILD_filters=ON -DBUILD_surface=ON                 -DBUILD_CUDA=OFF                 -DBUILD_GPU=OFF -DBUILD_examples=OFF                 -DBUILD_features=ON -DBUILD_tools=ON                 -DBUILD_keypoints=OFF                 -DBUILD_ml=OFF -DBUILD_outofcore=OFF                 -DBUILD_people=OFF -DBUILD_tracking=OFF                 -DBUILD_registration=ON                 -DBUILD_recognition=OFF                 -DBUILD_stereo=OFF                 -DBUILD_ml=ON  -DBUILD_tools=ON -DBUILD_recognition=ON -DBUILD_keypoints=ON -DBUILD_apps=ON -DBUILD_apps_pointcloud_editor=ON-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/opt/ccache/libexec/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/local/opt/ccache/libexec/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- Found ClangFormat: /usr/local/bin/clang-format (found suitable version "13.0.0", minimum required is "10") 
-- Adding target 'format'
-- Performing Test HAVE_MM_MALLOC
-- Performing Test HAVE_MM_MALLOC - Success
-- Performing Test HAVE_POSIX_MEMALIGN
-- Performing Test HAVE_POSIX_MEMALIGN - Success
-- Performing Test HAVE_SSE4_2_EXTENSIONS
-- Performing Test HAVE_SSE4_2_EXTENSIONS - Failed
-- Performing Test HAVE_SSE4_1_EXTENSIONS
-- Performing Test HAVE_SSE4_1_EXTENSIONS - Success
-- Performing Test HAVE_AVX2
-- Performing Test HAVE_AVX2 - Failed			# <-------- here
-- Performing Test HAVE_AVX
-- Performing Test HAVE_AVX - Failed

My cpu supports both AVX 1.0 and AVX2:

> /usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features
[…] AVX1.0 […] AVX2 […]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions