On Tue, Nov 6, 2018 at 9:33 AM Lawrence Mitchell <wencel@gmail.com> wrote:
> On 6 Nov 2018, at 14:18, Matthew Knepley <knepley@gmail.com> wrote:
>
> On Tue, Nov 6, 2018 at 4:54 AM Ham, David A <david.ham@imperial.ac.uk> wrote:

>

>
> From: <firedrake-bounces@imperial.ac.uk> on behalf of Matthew Knepley <knepley@gmail.com>
> Reply-To: firedrake <firedrake@imperial.ac.uk>
> Date: Tuesday, 6 November 2018 at 08:44
> To: firedrake <firedrake@imperial.ac.uk>
> Subject: Re: [firedrake] Installation with my own PETSc repository
>

>
> On Tue, Nov 6, 2018 at 3:38 AM Lawrence Mitchell <wencel@gmail.com> wrote:
>

>
> On 6 Nov 2018, at 08:27, Matthew Knepley <knepley@gmail.com> wrote:
>
> sidx_api.cc:45:8: error: thread-local storage is unsupported for the current target
> static __thread struct

>
> Hmm. The internet suggests that various Xcode versions removed (and then later reinstated) thread local storage in apple's clang. Eg here: https://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports/29929949#29929949
>

>
> Seems like Xcode 8 and newer do support it. But you have a very old Xcode?
>

>
> Yep, the old good Xcode is an old Xcode :)
>

>
> Can we make __thread a #define which is checked by configure?
>

>
> In principle, yes. Though this means we get further into maintaining a libspatialindex fork. Do we really need this?
>
>
> I am a fan of working around compiler deficiencies, rather than requiring users to change compilers. Its not a broken
> thing, but rather an unsupported thing. This is in the spirit of PETSc supporting old version of Python, old MPI, etc.
> If you tell me where it goes,  I will do it.


libspatialindex has a configure script (generated via autoconf), we maintain a "known good" fork here: github.com/firedrakeproject/libspatialindex. I don't understand autoconf very well, but I think the branch at configure-thread-local DTRT.

Can you checkout that branch and try building?

Okay, I did this and failed on std::shared_ptr. It seems that libspatialindex is just not going to build at all with my C++ compiler.

   Matt
 
Cheers,

Lawrence


--
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