Graphegon / pygraphblas

GraphBLAS for Python
https://graphegon.github.io/pygraphblas/pygraphblas/index.html
Apache License 2.0
343 stars 27 forks source link

Any hints for Installing on Mac? #100

Closed bsbodden closed 2 years ago

bsbodden commented 3 years ago

I'm on a Mac running Python 3.9.7. After cloning the repo the result of running:

python setup.py install

is:

build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:3944:12: error: use of undeclared identifier 'GxB_PRINT_1BASED'
  int n = (GxB_PRINT_1BASED) <= 0;
           ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:3945:30: error: use of undeclared identifier 'GxB_PRINT_1BASED'
  *o = (unsigned long long)((GxB_PRINT_1BASED) | 0);  /* check that GxB_PRINT_1BASED is an integer */
                             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:28554:10: error: implicit declaration of function
      'GxB_Matrix_build_Scalar' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_build_Scalar(x0, x1, x2, x3, x4);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:28620:14: error: implicit declaration of function
      'GxB_Matrix_build_Scalar' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_build_Scalar(x0, x1, x2, x3, x4); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31500:10: error: implicit declaration of function 'GxB_Matrix_iso'
      is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_iso(x0, x1);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31500:10: note: did you mean 'GxB_Matrix_diag'?
/usr/local/include/GraphBLAS.h:3706:10: note: 'GxB_Matrix_diag' declared here
GrB_Info GxB_Matrix_diag    // construct a diagonal matrix from a vector
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31538:14: error: implicit declaration of function 'GxB_Matrix_iso'
      is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_iso(x0, x1); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31553:10: error: implicit declaration of function
      'GxB_Matrix_memoryUsage' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_memoryUsage(x0, x1);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31591:14: error: implicit declaration of function
      'GxB_Matrix_memoryUsage' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_memoryUsage(x0, x1); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31606:10: error: implicit declaration of function
      'GxB_Matrix_pack_BitmapC' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_pack_BitmapC(x0, x1, x2, x3, x4, x5, x6, x7);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31690:14: error: implicit declaration of function
      'GxB_Matrix_pack_BitmapC' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_pack_BitmapC(x0, x1, x2, x3, x4, x5, x6, x7); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31705:10: error: implicit declaration of function
      'GxB_Matrix_pack_BitmapR' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_pack_BitmapR(x0, x1, x2, x3, x4, x5, x6, x7);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31789:14: error: implicit declaration of function
      'GxB_Matrix_pack_BitmapR' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_pack_BitmapR(x0, x1, x2, x3, x4, x5, x6, x7); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31804:10: error: implicit declaration of function
      'GxB_Matrix_pack_CSC' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_pack_CSC(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31905:14: error: implicit declaration of function
      'GxB_Matrix_pack_CSC' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_pack_CSC(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:31920:10: error: implicit declaration of function
      'GxB_Matrix_pack_CSR' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_pack_CSR(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:32021:14: error: implicit declaration of function
      'GxB_Matrix_pack_CSR' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_pack_CSR(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:32036:10: error: implicit declaration of function
      'GxB_Matrix_pack_FullC' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_pack_FullC(x0, x1, x2, x3, x4);
         ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:32097:14: error: implicit declaration of function
      'GxB_Matrix_pack_FullC' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  { result = GxB_Matrix_pack_FullC(x0, x1, x2, x3, x4); }
             ^
build/temp.macosx-10.15-x86_64-3.9/suitesparse_graphblas._graphblas.c:32112:10: error: implicit declaration of function
      'GxB_Matrix_pack_FullR' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return GxB_Matrix_pack_FullR(x0, x1, x2, x3, x4);
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: Setup script exited with error: command '/usr/bin/clang' failed with exit code 1
michelp commented 3 years ago

It looks like you don't have SuiteSparse installed first, which is the library that pygraphblas depends on.

I don't have a Mac or Windows machine so I don't know definitively that there is a simple approach. On Mac I usually recommend people use the docker images, it's a slight hassle but otherwise works great and you can launch a notebook server quickly and easily with:

docker run -it --rm -p 8888:8888 graphblas/pygraphblas-notebook

(remove the --rm if you want it to survive past one session).

If you want to install in the system, you'll need SuiteSparse first. I think maybe the conda build works on mac? If so try the instructions at:

https://anaconda.org/conda-forge/python-suitesparse-graphblas

first.

bsbodden commented 2 years ago

Thanks Michel. I didn't want to venture down the Conda path on this machine, since I have too many critical pip-based projects going on currently so I ended using the Docker Image. Overall it runs but there are a few issues that'll report on separate GH issues.