Make PETSc build on macOS Sierra with GCC#1835
Conversation
Don't set cpp when building on Darwin.
| # License along with this program; if not, write to the Free Software | ||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| ############################################################################## | ||
|
|
There was a problem hiding this comment.
Seems nice to have it -- there's a long copyright message above, and the import statements are rather short in comparison, and are not related to the copyright statement in any way.
There was a problem hiding this comment.
it is not there in pretty much any package.py. So for consistency i would not add it.
| '--with-mpi=1', | ||
| '--with-mpi-dir=%s' % self.spec['mpi'].prefix, | ||
| ] | ||
| if sys.platform != "darwin": |
There was a problem hiding this comment.
why is that change? PETSc builds perfectly fine for me on Sierra and same was on ElCapitan?
There was a problem hiding this comment.
The problem is that Spack's cpp doesn't work. I'm building first gcc (6.2) via Spack, then use this gcc to build other packages. Apparently gcc's cpp doesn't work on Sierra with certain system header files. Similar issues have existed with gcc on Darwin for a long time, so I didn't investigate details but instead simply reverted to letting PETSc choose the cpp it naturally wants. I don't have the exact error message handy any more.
There was a problem hiding this comment.
it certainly worked for me with ElCapitan and gcc from Spack, i will quickly try gcc now...
There was a problem hiding this comment.
btw, if this is Sierra only + gcc isse, the if should reflect this fact. It certainly builds fine with clang on Sierra! See #1814. For now I would at least suggest combining
mac_ver = '.'.join(py_platform.mac_ver()[0].split('.')[:2])
with
if spec.satisfies('%gcc')
Turning this off for all builds on darwin does not look right to me.
@tgamblin is there a variable in Spack which holds version of OS to be used in conditionals inside package.py?
There was a problem hiding this comment.
here is the if:
if (sys.platform == "darwin") and (spec.satisfies('%gcc')) and (spec.architecture.platform_os.version == "10.12"):
There was a problem hiding this comment.
I'm running OSX El Capitan and have spack at 462a4a1, building with clang + gfortran. I've hit this bug and have also found that I've had to remove the
'--with-cpp=cpp',
'--with-cxxcpp=cpp',
lines to get PETSc to build. I'm not sure why I have troubles building this while @davydden doesn't. Apart from his upgraded system, we have pretty much the same setup.
There was a problem hiding this comment.
@jppelteret i suppose you are on Sierra?
@eschnett would you mind adding (spec.architecture.platform_os.version == "10.12") to your if?
Given extra feedback, i agree that this should be fixed to make things work.
|
it builds on darwin[1] already (both with clang and gcc), please provide more details of what is the problem? [1] ElCapitan. |
|
cant reproduce the issue as So it could be that |
|
The problem I encountered has nothing to do with You will have to write |
davydden
left a comment
There was a problem hiding this comment.
i talked ot @jppelteret and he had this issue indeed on ElCapitan. I don't know what is going on here and why i never had this issue on ElCapitan, but let's merge this.
@tgamblin ping.
Don't set cpp when building on Darwin.