GraphBLAS / LAGraph

This is a library plus a test harness for collecting algorithms that use the GraphBLAS. For test coverage reports, see https://graphblas.org/LAGraph/ . Documentation: https://lagraph.readthedocs.org
Other
229 stars 61 forks source link

C++ compatibility #74

Closed szarnyasg closed 4 years ago

szarnyasg commented 4 years ago

The C++ compatibility is broken due to some data structures for complex numbers.

/usr/local/include/LAGraph.h:572:23: error: expected initializer before ‘LAGraph_ComplexFP64_1’
 extern double complex LAGraph_ComplexFP64_1;
                       ^~~~~~~~~~~~~~~~~~~~~
/usr/local/include/LAGraph.h:573:23: error: expected initializer before ‘LAGraph_ComplexFP64_0’
 extern double complex LAGraph_ComplexFP64_0;
                       ^~~~~~~~~~~~~~~~~~~~~

Interestingly, my IDE shows Use of unknown builtin '__builtin_complex' errors for CMPLX, BOOL, ONE, and T in LAGraph_complex.h but builds it regardless (as it's perfectly valid C code).

For the long term, we should decide how to handle C++ compatibility. If it's important, we should set up some tests to check it, otherwise, we should clarify the lack of support in the README.