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

Compilation fails on platforms where sizeof(long double) == sizeof(double) #49

Open
ursg opened this issue Mar 28, 2023 · 1 comment
Open

Comments

@ursg
Copy link
Contributor

ursg commented Mar 28, 2023

Specifically, I tested on armv7l (raspberryPi 3), and got:

mpic++ -O3 -std=c++0x -Wall -fPIC  -c vlsv_common_mpi.cpp
vlsv_common_mpi.cpp: In function ‘ompi_datatype_t* vlsv::getMPIDatatype(datatype::type, uint64_t)’:
vlsv_common_mpi.cpp:159:11: error: duplicate case value
  159 |           case (sizeof(long double)):
      |           ^~~~
vlsv_common_mpi.cpp:155:11: note: previously used here
  155 |           case (sizeof(double)):
      |           ^~~~
make: *** [Makefile:67: vlsv_common_mpi.o] Error 1

Not sure if this is something that needs a specific fix though. This issue is mostly to document it, if anybody stumbles into this in the future. Most likely, it can be worked around by simply commenting out the long double case, as it is not used for any actual application AFAIK.

@iljah
Copy link

iljah commented Mar 28, 2023

Could instead use if (sizeof(float)) {} else if (sizeof(double)) {} else if (sizeof(long double)) {}...

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