astro-informatics / s2scat

Differentiable and GPU accelerated scattering covariance statistics on the sphere
https://astro-informatics.github.io/s2scat/
MIT License
5 stars 1 forks source link

fresh installation via pip fails () #23

Open mgatti29 opened 2 months ago

mgatti29 commented 2 months ago

Hi,

I am trying to pip install s2scat on a fresh python 3.9 environment. My pip install s2scat failed trying to install pyssht, in particular it protested about conan (I have conan 2 installed, but for some reasons the code thinks I have conan 1)

Thanks,

Marco

Building wheels for collected packages: pyssht Building wheel for pyssht (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for pyssht (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [88 lines of output]

  --------------------------------------------------------------------------------
  -- Trying 'Ninja' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  CMake Deprecation Warning at CMakeLists.txt:1 (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.

  Not searching for unused variables given on the command line.

  -- The C compiler identification is GNU 12.3.0
  -- Cray Programming Environment 2.7.30 C
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /opt/cray/pe/craype/2.7.30/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Configuring done (0.4s)
  -- Generating done (0.0s)
  -- Build files have been written to: /tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e/_cmake_test_compile/build
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja' generator - success
  --------------------------------------------------------------------------------

  Configuring Project
    Working directory:
      /tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e/_skbuild/linux-x86_64-3.9/cmake-build
    Command:
      /tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake /tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e/_skbuild/linux-x86_64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.19 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/bin/python3.9 -DPYTHON_INCLUDE_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/include/python3.9 -DPYTHON_LIBRARY:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/lib/libpython3.9.so -DPython_EXECUTABLE:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/bin/python3.9 -DPython_ROOT_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/include/python3.9 -DPython_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/bin/python3.9 -DPython3_ROOT_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/include/python3.9 -DPython3_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja -DBUILD_TESTING:BOOL=OFF -Dconan_deps=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE:STRING=Release

  Not searching for unused variables given on the command line.
  -- The C compiler identification is GNU 12.3.0
  -- Cray Programming Environment 2.7.30 C
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /opt/cray/pe/craype/2.7.30/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Downloading conan.cmake from https://github.com/conan-io/cmake-conan
  -- Conan: checking conan executable
  -- Conan: Found program /tmp/pip-build-env-7c33irar/overlay/bin/conan
  -- Conan: Version found Conan version 1.64.1

  -- Conan executing: /tmp/pip-build-env-7c33irar/overlay/bin/conan install /tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e/conanfile.txt --remote conancenter --generator cmake_find_package --generator cmake_paths --build missing --settings build_type=Release --settings compiler=gcc --settings compiler.version=12
  WARN: *** Conan 1 is legacy and on a deprecation path ***
  WARN: *** Please upgrade to Conan 2 ***
  ERROR: Invalid setting '12' is not a valid 'settings.compiler.version' value.
  Possible values are ['4.1', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5', '5.1', '5.2', '5.3', '5.4', '5.5', '6', '6.1', '6.2', '6.3', '6.4', '6.5', '7', '7.1', '7.2', '7.3', '7.4', '7.5', '8', '8.1', '8.2', '8.3', '8.4', '9', '9.1', '9.2', '9.3', '10', '10.1', '10.2', '10.3', '11', '11.1']
  Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
  CMake Error at _skbuild/linux-x86_64-3.9/cmake-build/conan.cmake:631 (message):
    Conan install failed='1'
  Call Stack (most recent call first):
    cmake/conan_dependencies.cmake:12 (conan_cmake_install)
    CMakeLists.txt:17 (include)

  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 666, in setup
      env = cmkr.configure(
    File "/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 357, in configure
      raise SKBuildError(msg)

  An error occurred while configuring with CMake.
    Command:
      /tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake /tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e/_skbuild/linux-x86_64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.19 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/bin/python3.9 -DPYTHON_INCLUDE_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/include/python3.9 -DPYTHON_LIBRARY:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/lib/libpython3.9.so -DPython_EXECUTABLE:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/bin/python3.9 -DPython_ROOT_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/include/python3.9 -DPython_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/bin/python3.9 -DPython3_ROOT_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/global/homes/m/mgatti/.conda/envs/jason_ev/include/python3.9 -DPython3_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-7c33irar/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja -DBUILD_TESTING:BOOL=OFF -Dconan_deps=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE:STRING=Release
    Source directory:
      /tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e
    Working directory:
      /tmp/pip-install-fkgws5pk/pyssht_60e2821496c74fb18ab2895559fff10e/_skbuild/linux-x86_64-3.9/cmake-build
  Please see CMake's output for more information.

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyssht Failed to build pyssht ERROR: Could not build wheels for pyssht, which is required to install pyproject.toml-based projects

CosmoMatt commented 2 months ago

Hey @mgatti29, this is quite a specific error and not necessarily an error with S2SCAT. I've installed from scratch on various machines (including google colab) without issue. What may be worth doing is trying to install just pyssht using the instructions in their repo here.

Basically just this for the C libraries

pip install conan cmake

git clone https://github.com/astro-informatics/ssht.git
mkdir ssht/build && cd ssht/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -Dconan_deps=True ..
make
make install

and this for the python package

pip install pyssht

If this installs then perhaps this is a more specific erro. If the python install for pyssht doesn't work then we can try and debug that specifically.

jasonmcewen commented 2 months ago

I think Conan might be pinned to version 1 in ssht, which could be the issue.

@mgatti29 Do you want to run on CPU or GPU? If GPU, then it's probably possible to install from source and just not install pyssht. That should be possible with a hack to the setup and requirements, right @CosmoMatt ?

Otherwise if you want to run on CPU then the C may well be useful. In which case it might be useful to ensure there is no conan set up already and the install of s2scat should handle that.

mgatti29 commented 2 months ago

I am very happy to run on GPUs only, we have A100s at nersc!

jasonmcewen commented 2 months ago

Ok, in that case you can probably just turn off the ssht requirements, right @CosmoMatt ?

CosmoMatt commented 2 months ago

@jasonmcewen that's certainly possible in S2FFT but there's no switch to do this. You'd have to manually clone the repo and comment out the offending functions/requirements etc.

The easiest option would likely be either debugging conan or redeploying pyssht to conan==2.0

jasonmcewen commented 2 months ago

Indeed, I just mean clone the repo and hack the setup so Marco can get running quickly. How would you hack the setup? Can you just remove ssht from the requirements? Then everything should run provided you don't use the C backends, right?

mgatti29 commented 1 month ago

Hi,

I just wanted to follow-up on this since I was away past week~ it would be great if you could point me how to remove the ssht requirements from the installation! Thanks

Marco