inlab-geo / espresso

Earth Science PRoblems for the Evaluation of Strategies, Solvers and Optimizers
https://geo-espresso.readthedocs.io
Other
15 stars 9 forks source link

pip install error on M1 #70

Closed msambridge closed 2 years ago

msambridge commented 2 years ago

I tried pip install and got the message below?

(base) RSES-064580:Dropbox u8414462$ pip install cofi-espresso Collecting cofi-espresso Downloading cofi_espresso-0.0.1.dev4.tar.gz (355 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 355.7/355.7 kB 3.6 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: matplotlib>=3.1 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from cofi-espresso) (3.5.1) Requirement already satisfied: numpy>=1.18 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from cofi-espresso) (1.22.3) Requirement already satisfied: scipy>=1.0.0 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from cofi-espresso) (1.5.3) Requirement already satisfied: tqdm>=4.0 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from cofi-espresso) (4.64.0) Requirement already satisfied: cycler>=0.10 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from matplotlib>=3.1->cofi-espresso) (0.11.0) Requirement already satisfied: packaging>=20.0 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from matplotlib>=3.1->cofi-espresso) (21.3) Requirement already satisfied: kiwisolver>=1.0.1 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from matplotlib>=3.1->cofi-espresso) (1.4.2) Requirement already satisfied: python-dateutil>=2.7 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from matplotlib>=3.1->cofi-espresso) (2.8.2) Requirement already satisfied: pyparsing>=2.2.1 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from matplotlib>=3.1->cofi-espresso) (3.0.4) Requirement already satisfied: pillow>=6.2.0 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from matplotlib>=3.1->cofi-espresso) (9.2.0) Requirement already satisfied: fonttools>=4.22.0 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from matplotlib>=3.1->cofi-espresso) (4.25.0) Requirement already satisfied: six>=1.5 in /Users/u8414462/opt/anaconda3/lib/python3.8/site-packages (from python-dateutil>=2.7->matplotlib>=3.1->cofi-espresso) (1.16.0) Building wheels for collected packages: cofi-espresso Building wheel for cofi-espresso (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for cofi-espresso (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [83 lines of output] Not searching for unused variables given on the command line. -- The C compiler identification is Clang 10.0.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: /Users/u8414462/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -- Check for working C compiler: /Users/u8414462/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang - broken CMake Error at /private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-build-env-ao64g9wd/overlay/lib/python3.8/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message): The C compiler

      "/Users/u8414462/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-install-weg6fph0/cofi-espresso_71f6be7415ab47ed99ca701574d5f705/_cmake_test_compile/build/CMakeFiles/CMakeTmp

      Run Build Command(s):/private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-build-env-ao64g9wd/overlay/lib/python3.8/site-packages/ninja/data/bin/ninja cmTC_c224c && [1/2] Building C object CMakeFiles/cmTC_c224c.dir/testCCompiler.c.o
      [2/2] Linking C executable cmTC_c224c
      FAILED: cmTC_c224c
      : && /Users/u8414462/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/u8414462/opt/anaconda3/include  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.16 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/u8414462/opt/anaconda3/lib -L/Users/u8414462/opt/anaconda3/lib CMakeFiles/cmTC_c224c.dir/testCCompiler.c.o -o cmTC_c224c   && :
      ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
      clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
      ninja: build stopped: subcommand failed.

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

  -- Configuring incomplete, errors occurred!
  See also "/private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-install-weg6fph0/cofi-espresso_71f6be7415ab47ed99ca701574d5f705/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "/private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-install-weg6fph0/cofi-espresso_71f6be7415ab47ed99ca701574d5f705/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
  Not searching for unused variables given on the command line.
  -- The C compiler identification is Clang 10.0.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Users/u8414462/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
  -- Check for working C compiler: /Users/u8414462/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang - broken
  CMake Error at /private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-build-env-ao64g9wd/overlay/lib/python3.8/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/Users/u8414462/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-install-weg6fph0/cofi-espresso_71f6be7415ab47ed99ca701574d5f705/_cmake_test_compile/build/CMakeFiles/CMakeTmp

      Run Build Command(s):/usr/bin/make -f Makefile cmTC_0713a/fast &&
      You have not agreed to the Xcode license agreements, please run 'sudo xcodebuild -license' from within a Terminal window to review and agree to the Xcode license agreements.

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

  -- Configuring incomplete, errors occurred!
  See also "/private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-install-weg6fph0/cofi-espresso_71f6be7415ab47ed99ca701574d5f705/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "/private/var/folders/4c/h8hvkbn17rb36dsylqf_wp44jk123f/T/pip-install-weg6fph0/cofi-espresso_71f6be7415ab47ed99ca701574d5f705/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
  ********************************************************************************
  scikit-build could not get a working generator for your system. Aborting build.

  Building MacOSX wheels for Python 3.8 requires XCode.
  Get it here:

    https://developer.apple.com/xcode/

  ********************************************************************************

  Hint: search 'error' in current terminal session to find out the details.

  If the error is not due to above reasons, please feel free to lodge an issue at https://github.com/inlab-geo/cofi_espresso/issues for help

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cofi-espresso Failed to build cofi-espresso ERROR: Could not build wheels for cofi-espresso, which is required to install pyproject.toml-based projects (base) RSES-064580:Dropbox u8414462$

jwhhh commented 2 years ago

Hi Malcolm, it seems there's an issue with Xcode. See the line:

You have not agreed to the Xcode license agreements, please run 'sudo xcodebuild -license' from within a Terminal window to review and agree to the Xcode license agreements.

Can you please try to run sudo xcodebuild -license and install cofi-espresso again?

I tried to install cofi-espresso on my M1 and it worked.

valentineap commented 2 years ago

It seems that this is an issue with anaconda-clang being incompatible(?) with the latest Apple SDK. See https://stackoverflow.com/questions/69236331/conda-macos-big-sur-ld-unsupported-tapi-file-type-tapi-tbd-in-yaml-file for some further details.

valentineap commented 2 years ago

It seems this issue doesn't arise in a completely clean conda environment, so it is likely just something messed up somewhere in Malcolm's ecosystem...