DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.15k stars 259 forks source link

CXSparse: Don't use complex numbers for MSVC targets #761

Closed mmuetzel closed 8 months ago

mmuetzel commented 8 months ago

For clang/clang++ targeting MSVC, the CMake variable MSVC is not set (only for clang-cl targeting MSVC). However, the MSVC target uses different types for complex numbers that CXSparse doesn't support (yet?).

Deactivate complex number arithmetic for CXSparse also for any compiler that targets MSVC.

Also, avoid overlinking the CXSparse library with libsuitesparseconfig. (It only uses the header but no functions from it.)

DrTimothyAldenDavis commented 8 months ago

Yes, CXSparse doesn't support MSVC's half-baked complex type. I have tagged it as a possible future extension:

https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/9706d509e4d3058653247b1030da46a16f2ea41e/CXSparse/CMakeLists.txt#L45-L46

Regarding overlinking: I'd like to revise CXSparse/Source/cs_malloc so that it calls SuiteSparse_config_malloc and friends, which themselves call malloc by default. I just haven't gotten around to it yet. So I'd prefer to keep the overlinking for now, or at most just comment it out so I can easily add it back in.

mmuetzel commented 8 months ago

Regarding overlinking: I'd like to revise CXSparse/Source/cs_malloc so that it calls SuiteSparse_config_malloc and friends, which themselves call malloc by default. I just haven't gotten around to it yet. So I'd prefer to keep the overlinking for now, or at most just comment it out so I can easily add it back in.

Oops. I now remember that you wrote the exact thing a couple of weeks ago. Sorry, I forgot.

Stripped that part of the PR.

DrTimothyAldenDavis commented 8 months ago

I think this is a good reminder for me to revise CXSparse to use the SuiteSparse_config_malloc functions and friends anyway. I'll do that shortly.

DrTimothyAldenDavis commented 8 months ago

In particular, see : https://github.com/DrTimothyAldenDavis/SuiteSparse/commit/3e43bffa3ab9323eb886a0484071482e75ac35df