ProjectPhysX / FluidX3D

The fastest and most memory efficient lattice Boltzmann CFD software, running on all GPUs via OpenCL. Free for non-commercial use.
https://youtube.com/@ProjectPhysX
Other
3.81k stars 301 forks source link

Conflicting declaration when compiling on 32 bit powerpc #206

Open hpckurt opened 1 month ago

hpckurt commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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