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

Move all include statements outside of namespaces #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Irubataru
Copy link

First, sorry about closing the previous pull request. I wanted to submit a second one and therefore thought I should make dedicated branches for each PR. Continuing with the original PR message:

This fix is an attempt at cleaning up the include structure of your code as well as removing any "using namespace..." from header files which might leak into library user's code.

Most important is the first commit f232ad4 which moves all standard library headers outside of the QDP namespace. This is very important as it is in direct conflict with the C++ standard (see [library.using.headers] item 3), and will therefore not compile on all compilers (e.g. gcc 7.2.0 which is what I am using).

The remaining commits is an attempt at forcing this rule for all QDP headers as well. This compiles and runs for me using configuration flags

--enable-parallel-arch=parscalar
--enable-precision=double
--enable-alignment=64
--enable-sse2

where QMP is compiled using MPI communication and not threads. I believe some additional testing is in order, but you will know the different targets better than I, and will therefore be able to do these tests more thoroughly.

This is necessary due to the fact that it breaks the C++ standard (see
item 20.5.2.2.3). This can and will therefore sometime lead to compilation
errors.
One should in general not have includes inside of namespaces unless
strictly necessary (which it isn't in this case).
@bjoo
Copy link
Contributor

bjoo commented Jun 5, 2018 via email

@Irubataru
Copy link
Author

Hi Balint,

Yes, I have built chroma based on all of my recent USQCD pull requests. I built chroma with the following options for configure:

  --enable-sse-wilson-dslash
  --enable-parallel-arch=scalar
  --enable-precision=double
  --enable-alignment=64
  --enable-sse
  --enable-sse2

I also am limited in time, and can't really go through all that many combinations of settings.

Cheers,
Jonas

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

Successfully merging this pull request may close these issues.

2 participants