Is it possible to run build-locally.py for a native build on osx-arm64?

I’m trying to build the llvmlite-feedstock package on an Apple Silicon mac running macOS 13.5.2, but I always get this error during CMake configuration:

running build_ext
$PREFIX/bin/python $SRC_DIR/ffi/build.py
Running: cmake -G Unix Makefiles $SRC_DIR/ffi
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is Clang 16.0.6
-- The CXX compiler identification is Clang 16.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: $BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-clang
CMake Error at /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/bin/arm64-apple-darwin20.0.0-clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/work/ffi/build/CMakeFiles/CMakeScratch/TryCompile-ftifTo'
    
    Run Build Command(s): /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/bin/cmake -E env VERBOSE=1 /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/bin/make -f Makefile cmTC_01438/fast
    /Users/gmarkall/work/numbadev/conda-forge/-- Check for working C compiler: $BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-clang - broken
llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/bin/make  -f CMakeFiles/cmTC_01438.dir/build.make CMakeFiles/cmTC_01438.dir/build
    make[1]: Entering directory '/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/work/ffi/build/CMakeFiles/CMakeScratch/TryCompile-ftifTo'
    Building C object CMakeFiles/cmTC_01438.dir/testCCompiler.c.o
    /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/bin/arm64-apple-darwin20.0.0-clang   -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include -fdebug-prefix-map=/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/work=/usr/local/src/conda/llvmlite-0.42.0dev0+memmgr -fdebug-prefix-map=/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla=/usr/local/src/conda-prefix  -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -mmacosx-version-min=11.0 -MD -MT CMakeFiles/cmTC_01438.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_01438.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_01438.dir/testCCompiler.c.o -c /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/work/ffi/build/CMakeFiles/CMakeScratch/TryCompile-ftifTo/testCCompiler.c
    Linking C executable cmTC_01438
    /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/bin/cmake -E cmake_link_script CMakeFiles/cmTC_01438.dir/link.txt --verbose=1
    /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_build_env/bin/arm64-apple-darwin20.0.0-clang -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include -fdebug-prefix-map=/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/work=/usr/local/src/conda/llvmlite-0.42.0dev0+memmgr -fdebug-prefix-map=/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla=/usr/local/src/conda-prefix  -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib -L/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib  CMakeFiles/cmTC_01438.dir/testCCompiler.c.o -o cmTC_01438 
    ld: library not found for -lSystem
    clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [CMakeFiles/cmTC_01438.dir/build.make:100: cmTC_01438] Error 1
    make[1]: Leaving directory '/Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/miniforge3/conda-bld/llvmlite_1700669986269/work/ffi/build/CMakeFiles/CMakeScratch/TryCompile-ftifTo'
    make: *** [Makefile:127: cmTC_01438/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:5 (project)


-- Configuring incomplete, errors occurred!

I’ve tried setting LIBRARY_PATH to include Users/gmarkall/work/numbadev/conda-forge/llvmlite-feedstock/SDKs/MacOSX11.0.sdk/usr/lib (as I’ve seen suggested in some places when users encounter the ld: library not found for -lSystem error to no avail.

I’m just attempting to build with:

python build-locally.py osx_arm64_python3.8.____cpython

Should I expect this to work? Am I going about things in the wrong manner?

1 Like

Hi Graham,

Can you clean the repo, try again and send the full log from build-locally.py?

Isuru

1 Like

I have the same issue - building MacOS packages locally has not worked for me in a long time.

Attached is a build log for bash-feedstock. The error message in config.log is the same as in Graham’s case.

build-locally.log.txt (111.4 KB)

Thanks Isuru - after cleaning the repo and attempting to run build-locally.py again, the attached log is produced. (Note I had to give it the .yml extension to be able to upload it)
build-locally.txt.yml (77.5 KB)

Hi,

Can you try export OSX_SDK_DIR=$PWD/SDKs instead of export OSX_SDK_DIR=SDKs?

(The error message is wrong)

Isuru

Thanks Isuru, that fixed it for me!

Many thanks, that also works for me!