-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
openmp link flags for compilers #876
Comments
I don't like either way. We can't have our compiler classes depending on Is there a general mechanism that could be USED to provide the desired Maybe the recent work on appropriate BLAS/LAPACK flags is the right On Sun, May 1, 2016 at 2:20 PM, Denis Davydov notifications@github.com
|
I have a feeling that you misunderstand what
with shared memory. State of affairs is that compilers have to implement it if they want to allow users to utilize this. It is absolutely opposite to mpi which is a library to do parallel computation with distributed memory. |
@citibeth: FYI |
Haha, I was already working on this actually, but my solution was much simpler. I just added an When a user builds a package with clang and explicitly enables openmp, does the config.log shows a useful error message? If so, that would make my argument more defendable. If not, then perhaps it would be worthwhile to turn this flag into a function like you suggested, but have it depend on the version of the compiler. I would also still argue that it's worthwhile to split Clang and Apple/LLVM into two separate compilers. I'm willing to do the leg work for that depending on how people feel about that suggestion. By the way, here is a more complete table of openmp flags per compiler:
|
i fully agree. Perhaps i was not clear above, i did not intend to always add
agree again! 😄 I don't know the internals, but with both approaches suggested above i assumed we could query compiler version and do (for example for
That is an option. I tend to agree that this is the way to go. Alternatively, with less work one could add extra checks (like the one above) to see if |
Personally, I would love to make compilers a build dependency. Then, that compiler can |
👍 |
Thank you for the clarification. I agree, it belongs with the compiler. On Mon, May 2, 2016 at 1:08 AM, Denis Davydov notifications@github.com
|
There's been discussion of that, and it's on one of @tgamblin's long list On Mon, May 2, 2016 at 9:51 AM, Adam J. Stewart notifications@github.com
|
Ok, this worked for me on
or should it rather be I agree that ideally
I think this would also facilitate mixing of |
The need to provide
openmp
link flags came up in a couple of place, see #875 or #845 .Different compilers need different flags (see https://www.dartmouth.edu/~rc/classes/intro_openmp/compile_run.html ):
-- GNU (gcc, g++, gfortran) :
-fopenmp
-- Intel (icc ifort):
-openmp
-- Portland Group (pgcc,pgCC,pgf77,pgf90) :
-mp
As far as i can tell, the flags are the same for C/C++ and Fortran. So we don't need to discriminate between those cases.
Obviously, this must be related to
Compiler
class, and those flags are to be implemented in$SPACK_ROOT/lib/spack/spack/compilers/clang.py
and alike.(1) First approach, example for
gcc
and for
clang
Then inside the
package.py
it would be used where needed as (if I am not mistaken)(2) Second approach: I don't know if this is possible, but a more flexible alternative (in the spirit of #657) would be to have in compiler class
Shall we need to add more dynamic checks based on specs, it would be much easier with (2) approach, as far as i understand the whole framework.
Either of this should be very straightforward to add, and I will be happy to give it a go if we agree on the approach.
@tgamblin @mathstuf @eschnett @adamjstewart @alalazo @citibeth : what do you think?
The text was updated successfully, but these errors were encountered: