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

Conflicting declaration when compiling on 32 bit powerpc #206

Open
hpckurt opened this issue Jul 22, 2024 · 3 comments
Open

Conflicting declaration when compiling on 32 bit powerpc #206

hpckurt opened this issue Jul 22, 2024 · 3 comments

Comments

@hpckurt
Copy link

hpckurt commented Jul 22, 2024

I fully expect this not to be fixed, but thought I may as well open an issue anyways.

I'm trying to compile FluidX3D on 32 bit powerpc debian, but running into an error:

src/utilities.hpp:33:18: error: conflicting declaration ‘typedef uint64_t ulong’
   33 | typedef uint64_t ulong;
      |                  ^~~~~

I am using PoCL to compile for the CPU itself.

As I mentioned, I don't expect this to be fixed since it's nowhere near your expected use case :)

@ProjectPhysX
Copy link
Owner

Hi @hpckurt,

thanks for posting this bug on such exotic hardware! My requirement for FluidX3D is that it runs on every toaster, so let's get to the bottom of it.
What compiler are you using? g++? Which version?
Does commenting out the line resolve it?

Kind regards,
Moritz

@hpckurt
Copy link
Author

hpckurt commented Jul 22, 2024

Hi Moritz,

Thanks for getting back so quickly!

It actually does compile with that line commented out. Does that harm the application in any way?

I'm using gcc/g++. The g++ version is 13.3.0.

Regards,
Kurt

@ProjectPhysX
Copy link
Owner

Hi @hpckurt,

this doesn't harm the application. ulong is the data type for unsigned 64-bit integer, usually only present in C++ standard as unsigned long long int. The short alias ulong isn't defined by default. Your compiler deviates from standard here and already provides the ulong alias somewhere in one of the included headers, so it complains about redefinition.

We can shield the original definition from headers, like this:

#define ulong header_ulong
#include <header>
#undef ulong

typedef uint64_t ulong;

Can you test this for all of the headers in utilities.hpp lines 14-23 and tell me which one needs the shielding?

Thanks and kind regards,
Moritz

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