kiss-icp: Mac M1: python3.9 and python3.10 packages missing

Tried to install on Mac M1 arm and because it doesn’t have pre-compiled wheels, the attempt to compile locally also failed.

Collecting scipy
  Using cached scipy-1.9.2.tar.gz (42.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [66 lines of output]
      The Meson build system
      Version: 0.63.3
      Source dir: /private/var/folders/k2/06nf1_6s039601g5ply3b63h00054w/T/pip-install-ovshm20c/scipy_fb0ee8bf9ea2434bb6b7426918caf471
      Build dir: /private/var/folders/k2/06nf1_6s039601g5ply3b63h00054w/T/pip-install-ovshm20c/scipy_fb0ee8bf9ea2434bb6b7426918caf471/.mesonpy-o2z7u9kx/build
      Build type: native build
      Project name: SciPy
      Project version: 1.9.2
      C compiler for the host machine: cc (clang 12.0.5 "Apple clang version 12.0.5 (clang-1205.0.22.9)")
      C linker for the host machine: cc ld64 650.9
      C++ compiler for the host machine: c++ (clang 12.0.5 "Apple clang version 12.0.5 (clang-1205.0.22.9)")
      C++ linker for the host machine: c++ ld64 650.9
      Host machine cpu family: aarch64
      Host machine cpu: arm64
      Compiler for C supports arguments -Wno-unused-but-set-variable: NO
      Compiler for C supports arguments -Wno-unused-but-set-variable: NO (cached)
      Compiler for C supports arguments -Wno-unused-function: YES
      Compiler for C supports arguments -Wno-conversion: YES
      Compiler for C supports arguments -Wno-misleading-indentation: YES
      Compiler for C supports arguments -Wno-incompatible-pointer-types: YES
      Library m found: YES
      Fortran compiler for the host machine: gfortran (gcc 12.1.0 "GNU Fortran (Homebrew GCC 12.1.0) 12.1.0")
      Fortran linker for the host machine: gfortran ld64 650.9
      Compiler for Fortran supports arguments -Wno-conversion: YES
      Program cython found: YES (/private/var/folders/k2/06nf1_6s039601g5ply3b63h00054w/T/pip-build-env-k6wcpwx6/overlay/bin/cython)
      Program pythran found: YES (/private/var/folders/k2/06nf1_6s039601g5ply3b63h00054w/T/pip-build-env-k6wcpwx6/overlay/bin/pythran)
      Program cp found: YES (/bin/cp)
      Program python found: YES (some.venv-kiss-39/bin/python3.9)
      Found pkg-config: /opt/homebrew/bin/pkg-config (0.29.2)
      Library npymath found: YES
      Library npyrandom found: YES
      Found CMake: /opt/homebrew/bin/cmake (3.24.0)
      Run-time dependency openblas found: NO (tried pkgconfig, framework and cmake)
      Run-time dependency openblas found: NO (tried pkgconfig, framework and cmake)

      ../../scipy/meson.build:129:0: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig, framework and cmake

Or it’s probably because scipy doesn’t support Mac M1 yet? idk. But just leave it here for visibility since you did a great job of Mac x64 support as I can see from wheels available on PyPi and maybe this is interesting to other people as well.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

@bexcite as of release 0.2.9 now the python package is working, at least on my M2 mac.

Just pip install -U kiss-icp and no more undefined reference for me 😉 Honestly I’m not 100% sure what I’ve changed. The tbb library is now being populated with FetchContentDeclare instead of ExternalProject. Which looks to be the reason behind the fact that cmake might be changing something in the binary artifact of the tbb library.

If you want it would be nice if you can confirm is also working on your side!

EDIT: turns out that everything was related to the APPLE "-mmacosx-version-min compiler flag. Apparently the hand-baked tbb external project I had before was not properlly populating the cmake cache. More reasons to support moving everything to FetchContentDeclare and let cmake run #129 + #143

Withouth this flag set, the pybind build was already complaining in the CI : 2023-04-11T15:31:00.8507880Z ld: warning: object file (/Users/runner/work/kiss-icp/kiss-icp/python/_skbuild/macosx-11.0-x86_64-3.11/cmake-build/kiss_icp/tbb/lib/libtbb.a(small_object_pool.cpp.o)) was built for newer macOS version (11.7) than being linked (11.0)

Looks like the TBB team already struggled with this and provide support on their build system here

# Enable support of minimum supported macOS version flag
if (APPLE)
    if (NOT CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG)
        set(CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=" CACHE STRING "Minimum macOS version flag")
    endif()
    if (NOT CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG)
        set(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=" CACHE STRING "Minimum macOS version flag")
    endif()
endif()

@nachovizzo I can confirm, 0.2.9 is working finely from PyPi on my M1 machine!!!

Many thanks to figuring this out and writing the analysis. Kudos!!