Conversation
5053480 to
524230b
Compare
| 'fc' : 'intel/ifort' } | ||
|
|
||
| @property | ||
| def openmp_flag(self): |
There was a problem hiding this comment.
I think it's -qopenmp in the latest version.
There was a problem hiding this comment.
do you know from which version?
There was a problem hiding this comment.
here they say -openmp for 15.0 : https://software.intel.com/en-us/node/522690
There was a problem hiding this comment.
I can't find a web page showcasing it, but the change should start from 16:
$ icc --version
icc (ICC) 16.0.2 20160204
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
$ icc -openmp main.c
icc: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'There was a problem hiding this comment.
ok, i will add a check for 16.0...
|
there is a fancy issue. I am testing the two methods by calling them in which ends up with an error Interestingly enough this works just fine. I don't understand how this is possible. Any advices from the |
|
Take a look at the You don't need the function call syntax to execute that code : from the client point of view it will look like accessing an attribute. What happens in your error is that you got a string returned with : self.compiler.cxx11_flagand then you try to |
|
@alalazo thanks for explanations 👍 I learned something new today 😄 |
|
Ok, i checked both functions and they work as expected for Apple's |
355612e to
bd850e4
Compare
3101db1 to
355612e
Compare
|
@alalazo i deleted the last comment as I found out this is not the case. |
lib/spack/spack/compilers/clang.py
Outdated
| if ver_string.endswith('-apple'): | ||
| return True | ||
| else: | ||
| return False |
There was a problem hiding this comment.
I think a more Pythonic implementation would be:
return ver_string.endswith('-apple')There was a problem hiding this comment.
Actually, this would be even better:
@property
def is_apple(self):
ver_string = str(self.version)
return ver_string.endswith('-apple')There was a problem hiding this comment.
will do, looks much better!
|
Wow, this looks way better than my implementation. Can you add a default |
| @property | ||
| def cxx11_flag(self): | ||
| tty.die("cxx11_flag() is not implemented for pgi. Consider creating a pull-request.") | ||
| return "-std=c++11" |
There was a problem hiding this comment.
From the man page for pgc++, it appears that PGI accepts either -std=c++11 or --c++11 so you can remove this message.
|
@adamjstewart i (hopefully) addressed you comments. |
|
there is also in the |
lib/spack/spack/compiler.py
Outdated
| # Override in derived classes if needed | ||
| @property | ||
| def cxx11_flag(self): | ||
| return "-std=c++11" |
There was a problem hiding this comment.
The more I think about it, these properties should probably look something like:
# This property should be overridden in the compiler subclass if
# OpenMP is supported by that compiler
@property
def openmp_flag(self):
# If it is not overridden, assume it is not supported and warn the user
tty.die("The compiler you have chosen does not currently support OpenMP. If you think it should, please edit the compiler subclass and submit a pull request or issue.")
# This property should be overridden in the compiler subclass if
# C++11 is supported by that compiler
@property
def cxx11_flag(self):
# If it is not overridden, assume it is not supported and warn the user
tty.die("The compiler you have chosen does not currently support C++11. If you think it should, please edit the compiler subclass and submit a pull request or issue.")The benefit of this is that if someone adds a new compiler but forgets to override these properties, or the compiler does not support them, Spack warns the user. Otherwise, the current implementation will just use the wrong flag and crash. Feel free to shorten up the message if you want.
There was a problem hiding this comment.
sounds good to me, will change the behaviour.
|
@davydden: Yes, I agree about removing: # argument used to get C++11 options
cxx11_flag = "-std=c++11"from compilers.py. Your property is replacing this variable. |
…d on the compiler version
…pple or not using version
…properties are not implemented in a derived class
…y with the same name
…en in derived classes
6937081 to
f84f045
Compare
|
quickly documented the usage of compiler flags. |
|
Submitted this a while back. Your feature is probably more correct. Feel free to remove my change if needed. |
|
I notice there are efforts to add OpenMP flags, C++14 flags, and names of executables such as |
|
no, they don't. Flags are done using |
lib/spack/spack/compiler.py
Outdated
| @property | ||
| def openmp_flag(self): | ||
| # If it is not overridden, assume it is not supported and warn the user | ||
| tty.die("The compiler you have chosen does not currently support OpenMP. If you think it should, please edit the compiler subclass and submit a pull request or issue.") |
There was a problem hiding this comment.
can these lines be made <80chars?
There was a problem hiding this comment.
sure they can 😄 i am on it...
There was a problem hiding this comment.
[Commercial] pull-in #375 with line length 80 chars ? 😄
There was a problem hiding this comment.
@alalazo: pretty sure your screen is at like 120 or something
|
@davydden @alalazo @adamjstewart @gartung thanks! this look great. I'll just shorten a few lines and merge. |
|
@eschnett: if compilers are made into dependencies eventually these could potentially use similar mechanisms. Right now since they're special they're a little different. |
|
@davydden: ok I'll let you shorten the lines :) |
|
@tgamblin shortened 😄 |
fixes #876
@adamjstewart ping.