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

Wrap assert include with extern C++ #1197

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Wrap assert include with extern C++ #1197

wants to merge 2 commits into from

Conversation

waynemitchell
Copy link
Contributor

Addresses #1191 and #1192

@waynemitchell
Copy link
Contributor Author

waynemitchell commented Dec 19, 2024

It seems that Intel's oneAPI 2025 adds a C++ templated version of assert.h, which is causing compile issues due to assert.h being included within an extern "C" block in _hypre_utilities.h. I'm not that familiar with how extern blocks should be used, so I want to make sure that the fix here is not going to have unintended consequences.

@ivikiwi-1111
Copy link

ivikiwi-1111 commented Dec 19, 2024

It did help to remove those extern C linkage errors mentioned in #1192, but compilation still fails with following error:

icpx  -O3 -fsycl -fsycl-unnamed-lambda  -DHAVE_CONFIG_H -I.. -I. -I./.. -I./../utilities    -qmkl -I/include -DMKL_ILP64 -I/opt/intel/oneapi/mkl/2025.0/include       -c csr_matop_device.c -o csr_matop_device.obj
icpx: warning: treating 'c' input as 'c++' when -fsycl is used [-Wexpected-file-type]
csr_matop_device.c:186:101: error: too few arguments to function call, expected at least 2, have 1
  186 |       HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::release_matrix_handle(&hypre_GpuMatDataMatHandle(data)) );
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                 ^
./../utilities/_hypre_utilities.hpp:817:7: note: expanded from macro 'HYPRE_ONEMKL_CALL'
  817 |       call;                                                                                  \
      |       ^~~~
/opt/intel/oneapi/mkl/2025.0/include/oneapi/mkl/spblas/sparse_structures.hpp:41:1: note: 'release_matrix_handle' declared here
   41 | release_matrix_handle(sycl::queue &queue,
      | ^                     ~~~~~~~~~~~~~~~~~~~
   42 |                       matrix_handle_t *p_spMat,
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~
   43 |                       const std::vector<sycl::event> &dependencies = {});
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
csr_matop_device.c:3274:44: warning: 'trsv' is deprecated: Use oneapi::mkl::sparse::trsv(queue, ... , diag_val, /* alpha */ 1.0, ...) instead. [-Wdeprecated-declarations]
 3274 |    HYPRE_ONEMKL_CALL( oneapi::mkl::sparse::trsv( *hypre_HandleComputeStream(hypre_handle()),
      |                                            ^
/opt/intel/oneapi/mkl/2025.0/include/oneapi/mkl/spblas/sparse_operations.hpp:232:1: note: 'trsv' has been explicitly marked deprecated here
  232 | ONEMKL_DECLARE_DEPRECATED_SPARSE_TRSV(double);
      | ^
/opt/intel/oneapi/mkl/2025.0/include/oneapi/mkl/spblas/sparse_operations.hpp:221:7: note: expanded from macro 'ONEMKL_DECLARE_DEPRECATED_SPARSE_TRSV'
  221 |     [[deprecated("Use oneapi::mkl::sparse::trsv(queue, ... , diag_val, /* alpha */ 1.0, ...) instead.")]] \
      |       ^
1 warning and 1 error generated.
make[2]: *** [../config/Makefile.config:66: csr_matop_device.obj] Error 1
make[2]: Leaving directory '/home/test/hypre/src/seq_mv'
make[1]: *** [Makefile:92: all] Error 2
make[1]: Leaving directory '/home/test/hypre/src/seq_mv'
make: *** [Makefile:91: all] Error 1

@waynemitchell
Copy link
Contributor Author

@ivikiwi-1111 , hmm... it seems there are many breaking changes in oneAPI 2025... rather than continuing to go back and forth with you on fixes, let me try to get oneAPI 2025 installed on a system that I have access to and try to get it compiling myself.

@waynemitchell waynemitchell changed the title Wrap assert include with extern C++ Draft: Wrap assert include with extern C++ Dec 19, 2024
@waynemitchell waynemitchell changed the title Draft: Wrap assert include with extern C++ Wrap assert include with extern C++ Dec 19, 2024
@waynemitchell waynemitchell marked this pull request as draft December 19, 2024 18:55
@victorapm
Copy link
Contributor

It seems that Intel's oneAPI 2025 adds a C++ templated version of assert.h

Hi Wayne, your fix looks correct to me. 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.

3 participants