Skip to content

[pyos] Installation from PyPI only supports some platforms #403

Closed

Description

@szhorvat

Looking at the installation instructions (readme or docs), I got the impression that a simple pip install python-graphblas would work for most users, but this does not appear to be the case. Originally I installed from Conda-Forge, so I did not notice this.

It seems that the essential dependency suitesparse-graphblas only provides binaries for Linux. Thus a simple pip install python-graphblas will fail for macOS and Windows users, and I expect most of them will be confused.

Can you please explain this situation better, so that the installation experience is as smooth as possible? I.e.,

  • Ideally, provide binaries for all platforms.
  • If this is not possible, point out the issues and their solutions.
    • A simple solution is to use Anaconda.
    • A more complicated one is to compile suitesparse-graphblas from source. There should be instructions for this.

pyOpenSci/software-submission#81

Activity

  1. szhorvat commented on Mar 10, 2023

    @szhorvat
    Author

    I tried to let suitesparse-graphblas compile from sources on my machine. I am using macOS 10.14, and I have SuiteSparse_GraphBLAS 4.0.3 installed through MacPorts. Since MacPorts places headers and libraries in a non-standard location, I used the following installation command:

    CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib pip install python-graphblas   
    

    The following (and many similar) errors occur:

          clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/szhorvat/opt/miniconda3/envs/gb2/include -fPIC -O2 -isystem /Users/szhorvat/opt/miniconda3/envs/gb2/include -I/opt/local/include -I/Users/szhorvat/opt/miniconda3/envs/gb2/include -I/Users/szhorvat/opt/miniconda3/envs/gb2/include/python3.10 -c suitesparse_graphblas/_graphblas.c -o build/temp.macosx-10.9-x86_64-cpython-310/suitesparse_graphblas/_graphblas.o
          suitesparse_graphblas/_graphblas.c:4655:12: error: use of undeclared identifier 'GxB_COMPRESSION'
            int n = (GxB_COMPRESSION) <= 0;
                     ^
          suitesparse_graphblas/_graphblas.c:4656:30: error: use of undeclared identifier 'GxB_COMPRESSION'
            *o = (unsigned long long)((GxB_COMPRESSION) | 0);  /* check that GxB_COMPRESSION is an integer */
                                       ^
          suitesparse_graphblas/_graphblas.c:4662:12: error: use of undeclared identifier 'GxB_IMPORT'
            int n = (GxB_IMPORT) <= 0;
                     ^
    

    I'm guessing SuiteSparse_GraphBLAS 4.0.3 is too old. I'll try with a newer one at a later point.

  2. eriknw commented on Mar 10, 2023

    @eriknw
    Member

    Ideally, provide binaries for all platforms.

    This is almost ready: GraphBLAS/python-suitesparse-graphblas#66
    and is high on our roadmap (WIP): #360 (comment)

    I think there is one last issue to figure out: how to create wheels with OpenMP on OS X Arm. Creating wheels with OpenMP is kind of fraught and is something we should probably ask a maintainer community such as Scientific-Python, PyOpenSci, or even StackOverflow. Any pointers?

    (Note: I used to manually build wheels for Windows and OS X, but I lost access to the machine I used to do this, and it was pretty painful to do).

    A more complicated one is to compile suitesparse-graphblas from source. There should be instructions for this.

    That's a good idea. We actually test compiling python-suitesparse-graphblas from source (and from latest main branch):

    elif [[ ${{ steps.sourcetype.outputs.selected }} == "source" ]]; then
    pip install --no-deps --no-binary=all suitesparse-graphblas
    elif [[ ${{ steps.sourcetype.outputs.selected }} == "upstream" ]]; then
    pip install --no-deps git+https://github.com/GraphBLAS/python-suitesparse-graphblas.git@main#egg=suitesparse-graphblas

    When we test this in CI, we install SuiteSparse:GraphBLAS from conda-forge, so we don't need to manipulate any paths.

    Building python-suitesparse-graphblas from source with SuiteSparse:GraphBLAS installed elsewhere is possible. This definitely deserves being documented once we figure out how to set the paths. This is kind of an advanced workflow, so we'll probably only include instructions for Linux at first where it's most likely. I think your attempt should work with a newer version of SuiteSparse:GraphBLAS, but it would be nice to confirm this.

    I'm guessing SuiteSparse_GraphBLAS 4.0.3 is too old. I'll try with a newer one at a later point.

    Yeah, that's way too old (almost 2 years old). python-suitesparse-graphblas version matches the version of SuiteSparse:GraphBLAS, and we require at least version 7.4.0.

  3. szhorvat commented on Mar 10, 2023

    @szhorvat
    Author

    I think there is one last issue to figure out: how to create wheels with OpenMP on OS X Arm. Creating wheels with OpenMP is kind of fraught and is something we should probably ask a maintainer community such as Scientific-Python, PyOpenSci, or even StackOverflow. Any pointers?

    python-igraph has binaries for most platforms, including macOS on ARM, so perhaps the setup there can be of interest to you? https://github.com/igraph/python-igraph/blob/main/.github/workflows/build.yml#L102 I'm not deeply familiar with the details, but I can find them out for you, if you have questions.

    What I recall:

    • On Windows OpenMP shouldn't be an issue if the OpenMP version provided by MSVC is sufficient for you.
    • On macOS, we build libomp from sources, to make sure that we can control the macOS version that is targeted (we currently support 10.9 or later), and so that we can link it statically, making the igraph binary self-contained. Do not try to link to Homebrew's libomp! That will not be portable, and you won't be able to support older macOS versions.
  4. eriknw commented on Mar 31, 2023

    @eriknw
    Member

    Closing as completed.

    python-suitesparse-graphblas now has wheels for linux, windows, and macos 🎉 (there are a few more wheels we'd like to add)

    Issue for instructions of how to install with pre-installed version of SuiteSparse:GraphBLAS is here: GraphBLAS/python-suitesparse-graphblas#79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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