Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParU: Don't include headers in extern "C" block. #451

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

mmuetzel
Copy link
Contributor

Building ParU with a CHOLMOD library that was built with CUDA currently fails with this error:

  [  1%] Building CXX object CMakeFiles/paru.dir/Source/paru_Diag_update.cpp.o
  In file included from /usr/include/c++/11/utility:69,
                   from /usr/include/cuda_fp16.hpp:67,
                   from /usr/include/cuda_fp16.h:3673,
                   from /usr/include/cublas_api.h:75,
                   from /usr/include/cublas_v2.h:65,
                   from /home/runner/work/SuiteSparse/SuiteSparse/CHOLMOD/Include/cholmod.h:451,
                   from /home/runner/work/SuiteSparse/SuiteSparse/ParU/Include/ParU_definitions.h:18,
                   from /home/runner/work/SuiteSparse/SuiteSparse/ParU/Include/ParU.hpp:42,
                   from /home/runner/work/SuiteSparse/SuiteSparse/ParU/Source/paru_internal.hpp:17,
                   from /home/runner/work/SuiteSparse/SuiteSparse/ParU/Source/paru_Diag_update.cpp:20:
  /usr/include/c++/11/bits/stl_relops.h:85:5: error: template with C linkage
     85 |     template <class _Tp>
        |     ^~~~~~~~
  In file included from /home/runner/work/SuiteSparse/SuiteSparse/ParU/Include/ParU.hpp:42,
                   from /home/runner/work/SuiteSparse/SuiteSparse/ParU/Source/paru_internal.hpp:17,
                   from /home/runner/work/SuiteSparse/SuiteSparse/ParU/Source/paru_Diag_update.cpp:20:
  /home/runner/work/SuiteSparse/SuiteSparse/ParU/Include/ParU_definitions.h:13:1: note: ‘extern "C"’ linkage started here
     13 | extern "C" {
        | ^~~~~~~~~~

(e.g.: https://github.com/DrTimothyAldenDavis/SuiteSparse/actions/runs/6578211130/job/17871436856#step:8:7567 )

The proposed change should be avoiding that error by not including headers inside an extern "C" block. (It would be easier to check whether this actually works if #450 was merged.)
Afaict, there is no difference in typedef enum [...] between C and C++. So, remove the extern "C" block entirely for simplicity.

@DrTimothyAldenDavis DrTimothyAldenDavis merged commit 84693e6 into DrTimothyAldenDavis:dev2 Oct 20, 2023
@DrTimothyAldenDavis
Copy link
Owner

Looks great -- thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants