Conversation
| if self.compiler.name == "clang": | ||
| compiler_opts = [ | ||
| '--with-mpi=1', | ||
| '--with-cc=%s -Qunused-arguments' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # Avoid confusing PETSc config by clang: warning: argument unused during compilation |
There was a problem hiding this comment.
Why don't you use --CFLAGS=-Qunused-arguments and --CXXFLAGS=...
There was a problem hiding this comment.
because PETSc pass them to fortran compilers as well. See recent discussion on the mailing list. That's not an option, unfortunately. The best solution is to put those in Spack's compiler wrappers, IMHO.
There was a problem hiding this comment.
correction: CFLAGS are not used in config while looking for a working preprocessor, but CPPFLAGS are passed to fortran
There was a problem hiding this comment.
CPPFLAGS are for the preprocessor; if Fortran files are preprocessed, they need these flags as well. You want to use CXXFLAGS for the C++ compiler.
There was a problem hiding this comment.
@eschnett they are not used in PETSc configure system. It does not work like that there, believe me. See http://lists.mcs.anl.gov/pipermail/petsc-users/2016-March/028910.html
There was a problem hiding this comment.
In any case, you do want to add -Qunused-arguments to your wrappers as otherwise every build complains about clang: warning: argument unused during compilation.
|
I'm ok with it. But just out of curiosity what are the unused arguments passed to clang? Shouldn't be those removed instead of hiding them? |
|
What arguments are unused? |
|
@eschnett @nrichart @tgamblin : Consequently The same happens with every single build. Just other config system are less picky about this. That's why I believe the proper fix is NOT what is done here, but instead one should add p.s. For a record, here's again the discussion on PETSc mailing list: http://lists.mcs.anl.gov/pipermail/petsc-users/2016-March/028910.html |
|
Note, that those |
|
Lastly, I am not sure wrapper will be working with externally provided MPI compilers. Say Intel MPI is installed on a cluster, it might get difficult to convince it inside Spack building system to use Spack's wrappers to Intel |
|
@davydden: Intel MPI (and most vendor MPIs) are based on MPICH. Intel MPI's The wrappers are there to make building easy for packagers, not to put extra burdens on them. They're intended to help out when building nasty things that do not have nice configure systems, or for which the build system doesn't provide convenient customization of dependency paths. There are a LOT of those packages in the HPC universe. They also make it very easy to make a baseline autotools package; often you don't even have to provide We haven't had too much trouble with the wrappers so far. Aside from naming issues with I don't see how the I could be proven wrong, but again, the wrappers have been pretty effective so far. Adding One final use we have for the wrappers is to support applying tools to builds. We're pretty interested in being able to instrument installations with things like LLVM and other tools, and the wrapper give us a convenient handle on the entire build environment. A couple examples. First, we would like to make it possible to use some in-house thread sanitizers on entire packages, and at the moment this requires that the entire program be instrumented at compile time, including dependencies. The wrappers are great for this. There is also a |
|
Ok I think that answers everyone's questions -- thanks @davydden! Do you want to add an issue to address the |
|
@tgamblin it's good to know that it works for Intel MPI. I will create an issue for |
* Adding spatial index 0.2.1 * Bring includes and correct version number
I think the proper fix is to add
-Qunused-argumentsto Spack wrappers when using clang. If someone tells me where that is, i will update the PR and test it.