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

Fix expected identifier bug on clang builds #46

Open
chapman39 opened this issue Dec 8, 2023 · 6 comments
Open

Fix expected identifier bug on clang builds #46

chapman39 opened this issue Dec 8, 2023 · 6 comments

Comments

@chapman39
Copy link
Contributor

Hi,

I am trying to build gslib using mvapich2 installed with clang and I get the following error:

 /opt/local/include/mpich-mp/mpi.h:116:56: error: expected identifier

 static const MPI_Datatype mpich_mpi_char
 MPICH_ATTR_TYPE_TAG(char)

                = MPI_CHAR;

                                                        ^

 /opt/local/include/mpich-mp/mpi.h:24:106: note: expanded from macro
 'MPICH_ATTR_TYPE_TAG'

 #    define MPICH_ATTR_TYPE_TAG(type)
 __attribute__((type_tag_for_datatype(MPI,type)))

Turns out this error has affected others before trying to build on apple machines - all the way back in 2015: https://lists.mcs.anl.gov/pipermail/nek5000-users/2015-May/003325.html

The problem is nek5000 has #defined MPI to be 1, but the mpich header file
'mpi.h' uses the symbol 'MPI' (for a completely different reason).

I have a branch locally that resolves this problem. All that needs to be done is change the macro name MPI to something more specific, such as GSLIB_USE_MPI.

@chapman39
Copy link
Contributor Author

If I'm allowed to create a pull request I'd be happy to upload the fix.

@stgeke
Copy link
Contributor

stgeke commented Dec 9, 2023

Sure, please go ahead.

@chapman39
Copy link
Contributor Author

I'll need permission first

$git push --set-upstream origin bugfix/chapman39/mvapich2-clang-expected-identifier

ERROR: Permission to Nek5000/gslib.git denied to chapman39.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@stgeke
Copy link
Contributor

stgeke commented Dec 11, 2023

You cannot directly push to the repo. Instead please create a PR.

@chapman39
Copy link
Contributor Author

I'm not able to create a PR

@stgeke
Copy link
Contributor

stgeke commented Dec 11, 2023

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