or should it be tucked away so that every compile of everything doesn't see it?
#if defined(PETSC_HAVE_XMMINTRIN_H) && !defined(__CUDACC__) #include <xmmintrin.h> #endif if an example needs this include couldn't the example just include it directly? Thanks > Begin forwarded message: > > From: Matthew Knepley <[email protected]> > Subject: Re: [petsc-maint] Error during linking > Date: July 31, 2017 at 8:00:59 AM CDT > To: Oliver Henrich <[email protected]> > Cc: "[email protected]" <[email protected]> > > On Mon, Jul 31, 2017 at 7:51 AM, Oliver Henrich <[email protected] > <mailto:[email protected]>> wrote: > Hi Matt, > > Many thanks for getting back so quickly and sorry for not including the files > (I keep repeating this as well to my users ;-) > > Please find below the log files. As far as I can see it compiles with C. > > I can confirm that commenting out the definition of the header file > (petscsys.h line # 1901) after compilation and before linking to my code > fixes the problem and delivers correct results. > > I remember vaguely I had this problem in the past. But it took me now all > morning to fix it. > > Satish, do we have a Sierra build machine? This looks like a plain vanilla > configuration, so we should see this error in the nightly builds. It > should be easy to get a test that reproduces once I know exactly what > environment fails. > > Thanks, > > Matt > > Cheers, > Oliver > > > On 31 Jul 2017, at 13:25, Matthew Knepley <[email protected] > <mailto:[email protected]><mailto:[email protected] > <mailto:[email protected]>>> wrote: > > On Mon, Jul 31, 2017 at 5:18 AM, Oliver Henrich <[email protected] > <mailto:[email protected]><mailto:[email protected] > <mailto:[email protected]>>> wrote: > Hi there, > > I get compiling errors when linking PETSc against my code. The problem seems > to be related to Apple's marvellous Xcode and clang. > > My system is Mac OS X Sierra 10.12.6 and I’m using Xcode 8.3.3 and clang > 8.1.0, but I could reproduce this issue also with older versions of PETSc > (3.5.2) and Xcode 8.2.1. > > Here is the output shortly before and including the firstfatal error: > > In file included from /Users/ohenrich/petsc-3.7.6/include/petscksp.h:6: > In file included from /Users/ohenrich/petsc-3.7.6/include/petscpc.h:6: > In file included from /Users/ohenrich/petsc-3.7.6/include/petscmat.h:6: > In file included from /Users/ohenrich/petsc-3.7.6/include/petscvec.h:9: > In file included from /Users/ohenrich/petsc-3.7.6/include/petscis.h:7: > In file included from /Users/ohenrich/petsc-3.7.6/include/petscsys.h:1901: > In file included from > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/include/xmmintrin.h:27: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/include/mmintrin.h:44:24: > error: > expected ')' > static __inline__ void __DEFAULT_FN_ATTRS > > By commenting out line #1901 in > /petsc-3.7.6/include/petscsys.h:1901***after*** compiling PETSc I could > prevent this error from occurring. I’m running tests, but it seems my code > delivers the correct result. > > In order to really know what happened, we need configure.log and make.log. > However, are you compiling PETSc with C++? > There was a reported bug with the Intel headers and g++ where it was > misinterpreting the preprocessor hints about arguments, > which seems similar to what is happening here. I believe putting extern "C" > in for this header might work as well if the above > guess is correct. We are working to get configure to recognize and work > around this. > > Thanks, > > Matt > > Best wishes and many thanks, > Oliver > > -- > Dr Oliver Henrich > Department of Physics > University of Strathclyde, Glasgow > John Anderson Building 6.29 > Glasgow G4 0NG, Scotland, UK > > Tel: +44 (0)141 548 4012 > Fax: +44 (0)141 552 2891 > -- > The University of Strathclyde is a charitable body, registered in Scotland > with registration number SC015263. > > > > > -- > What most experimenters take for granted before they begin their experiments > is infinitely more interesting than any results to which their experiments > lead. > -- Norbert Wiener > > http://www.caam.rice.edu/~mk51/ <http://www.caam.rice.edu/~mk51/> > > -- > Dr Oliver Henrich > Department of Physics > University of Strathclyde, Glasgow > John Anderson Building 6.29 > Glasgow G4 0NG, Scotland, UK > > Tel: +44 (0)141 548 4012 <tel:%2B44%20%280%29141%20548%204012> > Fax: +44 (0)141 552 2891 <tel:%2B44%20%280%29141%20552%202891> > -- > The University of Strathclyde is a charitable body, registered in Scotland > with registration number SC015263. > > > > > -- > What most experimenters take for granted before they begin their experiments > is infinitely more interesting than any results to which their experiments > lead. > -- Norbert Wiener > > http://www.caam.rice.edu/~mk51/ <http://www.caam.rice.edu/~mk51/>
