Skip to content

Compilation error due to conflicting blkcnt_t typedef #48

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

Open
playboywang opened this issue May 9, 2025 · 1 comment
Open

Compilation error due to conflicting blkcnt_t typedef #48

playboywang opened this issue May 9, 2025 · 1 comment

Comments

@playboywang
Copy link

playboywang commented May 9, 2025

I am trying to build the project, but I encountered a compilation issue related to the blkcnt_t typedef. The error occurs while compiling the Kokkos_HostBarrier.cpp file. Specifically, the conflict happens between Kokkos' own declaration of blkcnt_t and the existing declaration in the system headers.

Here is the error message I received:

error: conflicting declaration ‘typedef u64 blkcnt_t’
In file included from /usr/src/linux-headers-6.5.0-18-generic/include/linux/limits.h:6,
from /usr/include/x86_64-linux-gnu/bits/local_lim.h:38,
from /usr/include/x86_64-linux-gnu/bits/posix1_lim.h:161,
from /usr/include/limits.h:195,
from /usr/lib/gcc/x86_64-linux-gnu/9/include/limits.h:194,
from /usr/lib/gcc/x86_64-linux-gnu/9/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-linux-gnu/9/include/limits.h:34,
from /usr/include/c++/9/climits:42,
from /home/xxx/ParEval-develop/tpl/kokkos/core/src/impl/Kokkos_BitOps.hpp:22,
from /home/xxx/ParEval-develop/tpl/kokkos/core/src/impl/Kokkos_HostBarrier.cpp:24:
/usr/src/linux-headers-6.5.0-18-generic/include/linux/types.h:132:13: error: conflicting declaration ‘typedef u64 blkcnt_t’
132 | typedef u64 blkcnt_t;
| ^~~~~~~~
It seems that the blkcnt_t type is defined in both Kokkos and the system headers (sys/types.h). This causes a conflict during the compilation process.

I would appreciate any guidance or suggestions on how to resolve this issue. Are there any recommended steps for avoiding this conflict, or should I modify the source code to ensure compatibility with my system's headers?

Environment:
Operating System: [e.g., Ubuntu 22.04]
Compiler: GCC 9.5.0
Kernel Headers Version: 6.5.0-18-generic
Kokkos Version: 4.1.00

@Dando18
Copy link
Member

Dando18 commented May 9, 2025

Hi, thanks for opening an issue!

I haven't seen this before and I'm not sure where the issue is coming from. I'm also not sure where Kokkos is defining this type.

Can you try building Kokkos with the tests or examples (see this page for the cmake flags) and running them?
If these aren't working, then there's an issue with getting Kokkos setup on your system and I would recommend opening an issue with them.
If these are working, then we can keep debugging and see where the issue comes from.

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

No branches or pull requests

2 participants