Error compiling cog for MacOS 10.6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Error compiling cog for MacOS 10.6

Mariano Martinez Peck
 
Hi Eliot. I am trying to compie CogVM from XCode. If I choose "Mac OS X 10.5 (Base SDK)" CogVM compiles without problem.

But if I choose "Mac OS X 10.6" I have a compile error in ucontext.h line 42:

#error ucontext routines are deprecated, and require _XOPEN_SOURCE to be define

It comes from sqUnix
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling cog for MacOS 10.6

Mariano Martinez Peck
 
sorry....quick send...try again:
Hi Eliot. I am trying to compie CogVM from XCode. If I choose "Mac OS X 10.5 (Base SDK)" CogVM compiles without problem.

But if I choose "Mac OS X 10.6" I have a compile error in ucontext.h line 42:

#error ucontext routines are deprecated, and require _XOPEN_SOURCE to be define

It comes from sqUnixVMProfile.x where you have:

#include <ucontext.h>


any ideas how can I fix this?

Thanks!

Mariano
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling cog for MacOS 10.6

Eliot Miranda-2
 


On Fri, Jul 30, 2010 at 6:29 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
sorry....quick send...try again:
Hi Eliot. I am trying to compie CogVM from XCode. If I choose "Mac OS X 10.5 (Base SDK)" CogVM compiles without problem.

But if I choose "Mac OS X 10.6" I have a compile error in ucontext.h line 42:

#error ucontext routines are deprecated, and require _XOPEN_SOURCE to be define

It comes from sqUnixVMProfile.x where you have:

#include <ucontext.h>


any ideas how can I fix this?

I guess three ways.  One is simply to define _XOPEN_SOURCE.  But better is to figure out how to get the program counter pointer value from a signal handler in 10.6.  i.e. what the profiler does is periodically sample the VM thread's program counter.  It does this using a thread that sends SIGPROF to the VM thread and have the SIGPROF handler (pcbufferSIGPROFhandler) get the interrupted pc from the ucontext structure passed into the signal handler.  Presumably there's a new way of doing this in 10.6.  Find out what that is.

The third way is simply to define NO_VM_PROFILE and then the file will provide only stubs and you'll have no functional VM profiler.

HTH
Eliot



Thanks!

Mariano


Reply | Threaded
Open this post in threaded view
|

Re: Error compiling cog for MacOS 10.6

Casey Ransberger-2
 
Hmm. I didn't have any trouble compiling Cog on 10.6. Which Xcode version are you using?

On Jul 30, 2010, at 11:57 AM, Eliot Miranda <[hidden email]> wrote:



On Fri, Jul 30, 2010 at 6:29 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
sorry....quick send...try again:
Hi Eliot. I am trying to compie CogVM from XCode. If I choose "Mac OS X 10.5 (Base SDK)" CogVM compiles without problem.

But if I choose "Mac OS X 10.6" I have a compile error in ucontext.h line 42:

#error ucontext routines are deprecated, and require _XOPEN_SOURCE to be define

It comes from sqUnixVMProfile.x where you have:

#include <ucontext.h>


any ideas how can I fix this?

I guess three ways.  One is simply to define _XOPEN_SOURCE.  But better is to figure out how to get the program counter pointer value from a signal handler in 10.6.  i.e. what the profiler does is periodically sample the VM thread's program counter.  It does this using a thread that sends SIGPROF to the VM thread and have the SIGPROF handler (pcbufferSIGPROFhandler) get the interrupted pc from the ucontext structure passed into the signal handler.  Presumably there's a new way of doing this in 10.6.  Find out what that is.

The third way is simply to define NO_VM_PROFILE and then the file will provide only stubs and you'll have no functional VM profiler.

HTH
Eliot



Thanks!

Mariano


Reply | Threaded
Open this post in threaded view
|

Re: Error compiling cog for MacOS 10.6

Mariano Martinez Peck
 
Version 3.2.2
64-bit

Component versions
Xcode IDE: 1650.0
Xcode Core: 1648.0

In addition, GCC

;-) gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Did you try setting the option "Mac OS X 10.6"  in XCode ?

Thanks

Mariano


On Fri, Jul 30, 2010 at 9:22 PM, Casey Ransberger <[hidden email]> wrote:
 
Hmm. I didn't have any trouble compiling Cog on 10.6. Which Xcode version are you using?

On Jul 30, 2010, at 11:57 AM, Eliot Miranda <[hidden email]> wrote:



On Fri, Jul 30, 2010 at 6:29 AM, Mariano Martinez Peck <[hidden email][hidden email]> wrote:
 
sorry....quick send...try again:
Hi Eliot. I am trying to compie CogVM from XCode. If I choose "Mac OS X 10.5 (Base SDK)" CogVM compiles without problem.

But if I choose "Mac OS X 10.6" I have a compile error in ucontext.h line 42:

#error ucontext routines are deprecated, and require _XOPEN_SOURCE to be define

It comes from sqUnixVMProfile.x where you have:

#include <ucontext.h>


any ideas how can I fix this?

I guess three ways.  One is simply to define _XOPEN_SOURCE.  But better is to figure out how to get the program counter pointer value from a signal handler in 10.6.  i.e. what the profiler does is periodically sample the VM thread's program counter.  It does this using a thread that sends SIGPROF to the VM thread and have the SIGPROF handler (pcbufferSIGPROFhandler) get the interrupted pc from the ucontext structure passed into the signal handler.  Presumably there's a new way of doing this in 10.6.  Find out what that is.

The third way is simply to define NO_VM_PROFILE and then the file will provide only stubs and you'll have no functional VM profiler.

HTH
Eliot



Thanks!

Mariano




Reply | Threaded
Open this post in threaded view
|

Re: Error compiling cog for MacOS 10.6

Casey Ransberger-2
 
Nope; that's probably the difference then. I used the makevm script in the macbuild directory. 

On Jul 30, 2010, at 12:27 PM, Mariano Martinez Peck <[hidden email]> wrote:

Version 3.2.2
64-bit

Component versions
Xcode IDE: 1650.0
Xcode Core: 1648.0

In addition, GCC

;-) gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Did you try setting the option "Mac OS X 10.6"  in XCode ?

Thanks

Mariano


On Fri, Jul 30, 2010 at 9:22 PM, Casey Ransberger <[hidden email]> wrote:
 
Hmm. I didn't have any trouble compiling Cog on 10.6. Which Xcode version are you using?

On Jul 30, 2010, at 11:57 AM, Eliot Miranda <[hidden email]> wrote:



On Fri, Jul 30, 2010 at 6:29 AM, Mariano Martinez Peck <[hidden email][hidden email]> wrote:
 
sorry....quick send...try again:
Hi Eliot. I am trying to compie CogVM from XCode. If I choose "Mac OS X 10.5 (Base SDK)" CogVM compiles without problem.

But if I choose "Mac OS X 10.6" I have a compile error in ucontext.h line 42:

#error ucontext routines are deprecated, and require _XOPEN_SOURCE to be define

It comes from sqUnixVMProfile.x where you have:

#include <ucontext.h>


any ideas how can I fix this?

I guess three ways.  One is simply to define _XOPEN_SOURCE.  But better is to figure out how to get the program counter pointer value from a signal handler in 10.6.  i.e. what the profiler does is periodically sample the VM thread's program counter.  It does this using a thread that sends SIGPROF to the VM thread and have the SIGPROF handler (pcbufferSIGPROFhandler) get the interrupted pc from the ucontext structure passed into the signal handler.  Presumably there's a new way of doing this in 10.6.  Find out what that is.

The third way is simply to define NO_VM_PROFILE and then the file will provide only stubs and you'll have no functional VM profiler.

HTH
Eliot



Thanks!

Mariano




Reply | Threaded
Open this post in threaded view
|

Re: Error compiling cog for MacOS 10.6

Mariano Martinez Peck
 


On Fri, Jul 30, 2010 at 10:27 PM, Casey Ransberger <[hidden email]> wrote:
 
Nope; that's probably the difference then. I used the makevm script in the macbuild directory. 

Exactly. That works perfect for me also. Even using the default XCode configuration. It only fails when I explictly choose the option "Mac OS X 10.6"  in XCode

 

On Jul 30, 2010, at 12:27 PM, Mariano Martinez Peck <[hidden email]> wrote:

Version 3.2.2
64-bit

Component versions
Xcode IDE: 1650.0
Xcode Core: 1648.0

In addition, GCC

;-) gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Did you try setting the option "Mac OS X 10.6"  in XCode ?

Thanks

Mariano


On Fri, Jul 30, 2010 at 9:22 PM, Casey Ransberger <[hidden email][hidden email]> wrote:
 
Hmm. I didn't have any trouble compiling Cog on 10.6. Which Xcode version are you using?

On Jul 30, 2010, at 11:57 AM, Eliot Miranda <[hidden email][hidden email]> wrote:



On Fri, Jul 30, 2010 at 6:29 AM, Mariano Martinez Peck <[hidden email][hidden email][hidden email]> wrote:
 
sorry....quick send...try again:
Hi Eliot. I am trying to compie CogVM from XCode. If I choose "Mac OS X 10.5 (Base SDK)" CogVM compiles without problem.

But if I choose "Mac OS X 10.6" I have a compile error in ucontext.h line 42:

#error ucontext routines are deprecated, and require _XOPEN_SOURCE to be define

It comes from sqUnixVMProfile.x where you have:

#include <ucontext.h>


any ideas how can I fix this?

I guess three ways.  One is simply to define _XOPEN_SOURCE.  But better is to figure out how to get the program counter pointer value from a signal handler in 10.6.  i.e. what the profiler does is periodically sample the VM thread's program counter.  It does this using a thread that sends SIGPROF to the VM thread and have the SIGPROF handler (pcbufferSIGPROFhandler) get the interrupted pc from the ucontext structure passed into the signal handler.  Presumably there's a new way of doing this in 10.6.  Find out what that is.

The third way is simply to define NO_VM_PROFILE and then the file will provide only stubs and you'll have no functional VM profiler.

HTH
Eliot



Thanks!

Mariano