POV-Ray : Newsgroups : povray.beta-test : Build povray 3.7 beta40 on mac osx Server Time
26 Apr 2024 09:57:45 EDT (-0400)
  Build povray 3.7 beta40 on mac osx (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: xoros
Subject: Build povray 3.7 beta40 on mac osx
Date: 15 Dec 2010 15:10:00
Message: <web.4d091fcd62af24a47800993b0@news.povray.org>
Hello,

I would like to build povray 3.7 beta40 on mac osx snow leopard, but it doesn't
work.
"./configure" works without any problems, but "make" always produces the
following error:

.../../source/backend/support/task.h:184: error: thread-local storage not
supported for this target

MacMegaPov isn't an option for me, because I need a command line version of
povray.

Best regards


Post a reply to this message

From: Le Forgeron
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 15 Dec 2010 15:22:30
Message: <4d092386$1@news.povray.org>
Le 15/12/2010 21:06, xoros nous fit lire :
> Hello,
> 
> I would like to build povray 3.7 beta40 on mac osx snow leopard, but it doesn't
> work.
> "./configure" works without any problems, but "make" always produces the
> following error:
> 
> .../../source/backend/support/task.h:184: error: thread-local storage not
> supported for this target

More clue in source/backend/frame.h
(in lines 1890+)

// platform-specific headers should have provided
DECLARE_THREAD_LOCAL_VARIABLE.
// if not, rather than generate an error, we will default to useing the
common
// __thread-style declaration. if your compiler throws an error on this
declaration,
// you'll need to fix your platform-specific config to provide a means
to declare
// thread-local variables. support for TLS is required for efficient
access by the
// render threads to their stats and cache data.
#ifndef DECLARE_THREAD_LOCAL_PTR
#define DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName)       __thread
ptrType *ptrName;
#endif

But I'm afraid your compiler/os does not support per thread variables
(or if it does, it need to be instrumented in configure... )


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 16 Dec 2010 11:36:48
Message: <4d0a4020$1@news.povray.org>
On 15.12.10 21:06, xoros wrote:
> Hello,
>
> I would like to build povray 3.7 beta40 on mac osx snow leopard, but it doesn't
> work.
> "./configure" works without any problems, but "make" always produces the
> following error:
>
> .../../source/backend/support/task.h:184: error: thread-local storage not
> supported for this target

This is not surprising as Apple boycotts the GPL3 versions of gcc, which 
effectively means all recent versions of gcc. What you need to do is select 
the llvm compiler that comes with the latest XCode rather than use the 
default gcc.

     Thorsten


Post a reply to this message

From: Edouard
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 16 Dec 2010 16:20:01
Message: <web.4d0a81d4ea80a0bbe45c8dfa0@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> On 15.12.10 21:06, xoros wrote:
> > Hello,
> >
> > I would like to build povray 3.7 beta40 on mac osx snow leopard, but it doesn't
> > work.
> > "./configure" works without any problems, but "make" always produces the
> > following error:
> >
> > .../../source/backend/support/task.h:184: error: thread-local storage not
> > supported for this target

I ran into this too.

> This is not surprising as Apple boycotts the GPL3 versions of gcc, which
> effectively means all recent versions of gcc. What you need to do is select
> the llvm compiler that comes with the latest XCode rather than use the
> default gcc.

Could you just refactor the POV code to use boost's thread local storage
instead? Obviously more than just one person would find that helpful.

Cheers,
Edouard.


Post a reply to this message

From: Jim Holsenback
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 16 Dec 2010 17:44:27
Message: <4d0a964b$1@news.povray.org>
On 12/16/2010 05:17 PM, Edouard wrote:
> Thorsten Froehlich <tho### [at] trfde> wrote:
>> On 15.12.10 21:06, xoros wrote:
>>> Hello,
>>>
>>> I would like to build povray 3.7 beta40 on mac osx snow leopard, but it doesn't
>>> work.
>>> "./configure" works without any problems, but "make" always produces the
>>> following error:
>>>
>>> .../../source/backend/support/task.h:184: error: thread-local storage not
>>> supported for this target
> 
> I ran into this too.
> 
>> This is not surprising as Apple boycotts the GPL3 versions of gcc, which
>> effectively means all recent versions of gcc. What you need to do is select
>> the llvm compiler that comes with the latest XCode rather than use the
>> default gcc.
> 
> Could you just refactor the POV code to use boost's thread local storage
> instead? Obviously more than just one person would find that helpful.
> 
> Cheers,
> Edouard.
> 
> 
haha ... just press the "easy button" and poof she's done ... not hardly


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 18 Dec 2010 03:21:30
Message: <4d0c6f0a$1@news.povray.org>
On 16.12.10 22:17, Edouard wrote:
> Could you just refactor the POV code to use boost's thread local storage
> instead? Obviously more than just one person would find that helpful.

No, because we won't need that code at all and it will go away in 3.71. It 
was actually changed from boost code to this at a time when I had little 
time to take care of the Mac side, hence it was not noticed early on that it 
is a problem.

	Thorsten


Post a reply to this message

From: Edouard
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 18 Dec 2010 04:05:00
Message: <web.4d0c784bea80a0bbe45c8dfa0@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> On 16.12.10 22:17, Edouard wrote:
> > Could you just refactor the POV code to use boost's thread local storage
> > instead? Obviously more than just one person would find that helpful.
>
> No, because we won't need that code at all and it will go away in 3.71. It
> was actually changed from boost code to this at a time when I had little
> time to take care of the Mac side, hence it was not noticed early on that it
> is a problem.

Doesn't really help the Mac users now though. Unless you're going to release
some 3.71 alpha source in the next few days. That would be great.

>  Thorsten

Cheers,
Edouard.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 18 Dec 2010 07:23:03
Message: <4d0ca7a7$1@news.povray.org>
On 18.12.10 10:00, Edouard wrote:
> Thorsten Froehlich<tho### [at] trfde>  wrote:
>> On 16.12.10 22:17, Edouard wrote:
>>> Could you just refactor the POV code to use boost's thread local storage
>>> instead? Obviously more than just one person would find that helpful.
>>
>> No, because we won't need that code at all and it will go away in 3.71. It
>> was actually changed from boost code to this at a time when I had little
>> time to take care of the Mac side, hence it was not noticed early on that it
>> is a problem.
>
> Doesn't really help the Mac users now though. Unless you're going to release
> some 3.71 alpha source in the next few days. That would be great.

Well, this is not new at all. It has been in the code for well over a year. 
So expecting a release of new source code in a few days for seems rather 
strange...

	Thorsten


Post a reply to this message

From: jonas bulow
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 21 Dec 2010 17:55:01
Message: <web.4d11287fea80a0bb7d4da7460@news.povray.org>
"xoros" <xor### [at] fakehostcom> wrote:
> Hello,
>
> I would like to build povray 3.7 beta40 on mac osx snow leopard, but it doesn't
> work.
> "./configure" works without any problems, but "make" always produces the
> following error:
>
> .../../source/backend/support/task.h:184: error: thread-local storage not
> supported for this target
>
> MacMegaPov isn't an option for me, because I need a command line version of
> povray.
>
> Best regards

The patch below will make povray 3.7 beta40 compile fine on max osx.
Unfortunately, I'm not allowed to post attachements to this newsgroup so I also
put it here: http://pastebin.com/TYugP76L .

The idea is to use the thread local storage API defined by POSIX. It's not as
convenient as gcc's __thread but it is portable on POSIX platforms.

The last part of the patch brings the type uint alive by including sys/types.h.


diff -uwr original/povray-3.7.0.beta.40/source/backend/frame.h
new/povray-3.7.0.beta.40/source/backend/frame.h
--- original/povray-3.7.0.beta.40/source/backend/frame.h 2010-12-06
12:55:33.000000000 +0100
+++ new/povray-3.7.0.beta.40/source/backend/frame.h 2010-12-21
22:59:33.000000000 +0100
@@ -96,6 +96,9 @@

 // Generic header for all modules

+#include <pthread.h>
+
+
 #include <new>

 #include <stdio.h>
@@ -1898,9 +1901,55 @@
 // you'll need to fix your platform-specific config to provide a means to
declare
 // thread-local variables. support for TLS is required for efficient access by
the
 // render threads to their stats and cache data.
+
+
 #ifndef DECLARE_THREAD_LOCAL_PTR
+#ifdef __APPLE__
+template<typename T>
+class Pthread_Thread_Local_Storage
+{
+ public:
+ Pthread_Thread_Local_Storage()
+  {
+    pthread_key_create(&m_key, NULL);
+  }
+
+ Pthread_Thread_Local_Storage(T *ptr)
+  {
+    pthread_key_create(&m_key, NULL);
+    pthread_setspecific(m_key, ptr);
+  }
+ //  ~Pthread_Thread_Local_Storage() {};
+
+  Pthread_Thread_Local_Storage& operator=(T const &rhs)
+  {
+    pthread_setspecific(m_key, rhs);
+    return *this;
+  };
+
+  bool operator!=(T* rhs)
+  {
+    return pthread_getspecific(m_key) != rhs;
+  }
+
+  T* operator->() const
+  {
+    return static_cast<T*>(pthread_getspecific(m_key));
+  }
+
+  operator T*() const
+  {
+    return static_cast<T*>(pthread_getspecific(m_key));
+  }
+
+ private:
+  pthread_key_t m_key;
+};
+#  define DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName)
Pthread_Thread_Local_Storage<ptrType> ptrName;
+#else
 #define DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName)       __thread ptrType
*ptrName;
 #endif
+#endif

 }

diff -uwr original/povray-3.7.0.beta.40/vfe/vfesession.h
new/povray-3.7.0.beta.40/vfe/vfesession.h
--- original/povray-3.7.0.beta.40/vfe/vfesession.h 2010-12-06 12:55:33.000000000
+0100
+++ new/povray-3.7.0.beta.40/vfe/vfesession.h 2010-12-21 22:36:54.000000000
+0100
@@ -94,6 +94,8 @@
 #ifndef __VFESESSION_H__
 #define __VFESESSION_H__

+#include <sys/types.h>
+
 #include <queue>

 namespace vfe


Post a reply to this message

From: Adam Weyhaupt
Subject: Re: Build povray 3.7 beta40 on mac osx
Date: 14 Jan 2011 14:50:01
Message: <web.4d30a896ea80a0bb2f451cea0@news.povray.org>
"jonas.bulow" <jon### [at] gmailcom> wrote:
> "xoros" <xor### [at] fakehostcom> wrote:
> > Hello,
> >
> > I would like to build povray 3.7 beta40 on mac osx snow leopard, but it doesn't
> > work.
> > "./configure" works without any problems, but "make" always produces the
> > following error:
> >
> > .../../source/backend/support/task.h:184: error: thread-local storage not
> > supported for this target
> >
> > MacMegaPov isn't an option for me, because I need a command line version of
> > povray.
> >
> > Best regards
>
> The patch below will make povray 3.7 beta40 compile fine on max osx.
> Unfortunately, I'm not allowed to post attachements to this newsgroup so I also
> put it here: http://pastebin.com/TYugP76L .
>
> The idea is to use the thread local storage API defined by POSIX. It's not as
> convenient as gcc's __thread but it is portable on POSIX platforms.
>
> The last part of the patch brings the type uint alive by including sys/types.h.
>


I'm trying to compile RC2 and have the same error as the original poster.  This
patch doesn't seem to be able to be automatically applied to frame.h in RC2, and
I wasn't able to figure out what the changes need to be.  This patch does work
great for me on beta40; I checked today and was able to compile with no
problems.  In frame.h, what in beta40 we had:

#define DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName)
Pthread_Thread_Local_Pointer<ptrType> ptrName;
#else
#efine DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName)       __thread ptrType
*ptrName;
#endif

but in RC2 we now have:

#ifndef DECLARE_THREAD_LOCAL_PTR
#define DECLARE_THREAD_LOCAL_PTR(ptrType, ptrName)
boost::thread_specific_ptr<ptrType> ptrName
#define IMPLEMENT_THREAD_LOCAL_PTR(ptrType, ptrName, ptrCleanup)
boost::thread_specific_ptr<ptrType> ptrName(ptrCleanup)
#define GET_THREAD_LOCAL_PTR(ptrName)
(ptrName.get())
#define SET_THREAD_LOCAL_PTR(ptrName, ptrValue)
(ptrName.reset(ptrValue))
#endif

I'm not knowledgable enough to know how to modify the patch for RC2.  Can
someone help?  I'm trying to compile on Mac OS X 10.6.6 using the llvm-gcc
compiler.

Thanks for any help you can provide,

Adam


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.