greenlet & gevent?

67 views
Skip to first unread message

Jeremy Gray

unread,
Apr 12, 2013, 9:35:23 AM4/12/13
to psycho...@googlegroups.com, Sol Simpson
Hi Jon or anyone,

greenlet and gevent are needed for Sol's ioHub. And these need
libevent as well. I'm not able to compile them at the moment -- does
anyone have binaries for Mac (10.8.3, but I'll try anything) or know
where to get them? The EPD appears to have all the other necessary
things.

I'm having compile problems generally, so I should try to sort that
out. But in the meantime, this would help me test out ioHub.

Thanks,

--Jeremy

Jonathan Peirce

unread,
Apr 12, 2013, 10:53:43 AM4/12/13
to psycho...@googlegroups.com
I was going through exactly the same issues this morning . I built
libevent from source to try this out and that worked but didn't install
the header files to /usr/local/include

So then I did it using macports:
sudo port install libevent
Then add the macports install paths
/opt/local/lib
/opt/local/include
Then I downloaded the gevent source from github and did
python setup install

seems to have worked

Jon
--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

Jeremy Gray

unread,
Apr 12, 2013, 2:17:39 PM4/12/13
to psycho...@googlegroups.com
I'm having general compile issues like in this thread,
http://qt-project.org/forums/viewthread/21901 I'll try macports and
see how far I get.

--Jeremy
> --
> You received this message because you are subscribed to the Google Groups
> "psychopy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to psychopy-dev...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Jonathan Peirce

unread,
Apr 15, 2013, 6:04:19 AM4/15/13
to psycho...@googlegroups.com
Errors of ' No such file or directory ' during compile would presumably indicate that your path isn't set up correctly. Missing an include folder or something? What files does it report as not being found?

Jon

Jeremy Gray

unread,
Apr 15, 2013, 6:51:02 AM4/15/13
to psycho...@googlegroups.com
> Errors of ' No such file or directory ' during compile would presumably indicate that your path isn't set up correctly. Missing an include folder or something? What files does it report as not being found?

Yeah, this is my thought too, but its not obvious what to change.
googling the error message has not been revealing, unfortunately.
re-installing Xcode and or its tools has not helped.

This is the first error I get (when compiling pyo manually, or using
pip or macports for things):
/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:15:25:
error: limits.h: No such file or directory

I definitely do have that file (with read permission for ugo), can
view its contents, etc. Trying to compile ends with a gcc failed
error. Xcode 4.5+ uses clang but I am getting a gcc error, which might
be another clue, not sure what to make of it. both clang and gcc are
in /usr/bin/

Sol writes (but this does not work for me, same error. maybe 10.8 or
xcode 4.6 are different yet again):
many of the installers compile c code. At least on 10.7, the cause
cause big trouble. It all seems to stem from many installers expecting
the OSX10.6sdk folder in a specific dir. On OSX 10.7' Apple failed to
include the 10.6 SDK, and they moved the SDK location for 10.7, 10.8.
All these C compiling issues can be fixed, when using Xcode 4.4, by
adding a copy of the osX10.6sdk folder to the path it used to be in,
so the compilers can file the SDK.

link to a 10.6sdk zipped:
https://dl.dropbox.com/u/4486028/Wineskin%20Engines/MacOSX10.6.sdk.zip

Unzip and put the 10.6sdk folder to: /Developer/SDKs ,
which is where previous version of Xcode kept the SDKs, but do not do
so in Xcode 4.4 and above I guess. could also likely sim link it to
the path that SDKs are now kept in Xcode 4.4 +:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs

Jeremy Gray

unread,
Apr 15, 2013, 9:30:55 AM4/15/13
to psycho...@googlegroups.com
Some progress but not all the way there yet:

I just noticed that when compiling gevent, gcc is trying to use the 10.5 SDK
"gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -isysroot
/Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -O3 -arch i386 -isysroot
/Developer/SDKs/MacOSX10.5.sdk
-I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7
-c gevent/core.c -o build/temp.macosx-10.5-i386-2.7/gevent/core.o"

so I tried adding the .sdk for Mac 10.5, based on
http://stackoverflow.com/questions/5378518/how-to-add-base-sdk-for-10-5-in-xcode-4
I no longer get the limits.h not found error, but now get "event.h:
No such file or directory"

So, I next removed the MacOSX10.5.sdk and instead made a symlink of
the same path+name that just points to MacOSX10.6.sdk instead (which
is installed based on Sol's instructions).

This helped a great deal, and I can "pip install gevent", but get a warning:

ld: warning: ignoring file /usr/local/lib/libevent.dylib, file was
built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0
0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the
architecture being linked (i386): /usr/local/lib/libevent.dylib

In python, I can now import greenlet (which pip pulls in as a dep of
gevent), but not gevent, probably due to the link error / warning. So
maybe macports got the wrong version of libevent (64 bit?), but I
don't see an option to change to libevent for i386 (32 bit?)

--Jeremy

Jonathan Peirce

unread,
Apr 15, 2013, 11:15:13 AM4/15/13
to psycho...@googlegroups.com
I was having a problem with missing event.h before I switched to using
the macports to install libevent. Do
port install libevent
and make sure that /opt/local/lib and /opt/local/include are added to
your path (not /usr/local/lib... where most other things are installed).

Jon
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

Jeremy Gray

unread,
Apr 15, 2013, 11:24:51 AM4/15/13
to psycho...@googlegroups.com
I tried doing that but maybe I did not get the paths set correctly. I
also tried passing -I and -L params (with the /opt include and lib
directories), but no go.

But this just worked for me (no idea why, unfortunately):
sudo pip install cython -e
git://github.com/surfly/geven...@1.0rc2#egg=gevent

I can now import gevent, no errors. Actually trying to play with ioHub
will have to wait another day or two.

--Jeremy


On Mon, Apr 15, 2013 at 11:15 AM, Jonathan Peirce

Sol Simpson

unread,
Apr 22, 2013, 5:09:18 AM4/22/13
to psycho...@googlegroups.com
Again, sorry for missing this conversation until now. ;(

I just got pyYAML working with libyaml by basically doing what you did Jon for libevent, but using homebrew instead of macports:

brew install libyaml --universal

Then I had to exit my .bash_profile and add the /usr/local/include directory to my path; the other usr/local/ dirs were already in my path.

After doing that I installed pyYAML using:

python setup.py --with-libyaml install
Then everything works fine and I am getting pyYAML using the C backend.

Jonathan Peirce

unread,
Apr 29, 2013, 5:25:49 AM4/29/13
to psycho...@googlegroups.com
And is this needed? Again, it means me compiling and distributing c libs as part of the Standalone, which often takes me a while to sort out initially and is a common source of problems. I thought you said that xml could be used instead, which is already packaged?

Sol Simpson

unread,
May 8, 2013, 10:43:18 AM5/8/13
to psycho...@googlegroups.com
I now have my mail client keeping updates from this forum in my inbox, instead of a subfolder, resulting in me often not seeing them. That should fix my slow RT to answer posts when I should or can, sorry!

Using XML was suggested as a last resort option, especially for this release, as it would require rewriting much of the iohub preference setting loading code. Lucky you ended up getting it working so this was not required.

I came across as posting from 2010 in the group where there was a discussion about whether the psychopy preference files should be switched from xml to yaml for readability reasons. It was determined not be be needed since people did not directly need to read the psychopy builder preference settings (is my understanding from the post).

Right now the iohub preference files do need to be viewed and modified directly by people who use them if the default settings are not what is needed, and this is why I chose YAML over XML for this task. It is much more readable and understandable, especially for someone who already knows how to read a bit of python.

If \ when a GUI front end is made for iohub devices, part of that work could be to also switch to a similar XML schema format that PsychoPy uses for preferences when stored in XML, as then the readability of the file would be much less important.

Thanks.

Jon Peirce

unread,
May 8, 2013, 12:24:24 PM5/8/13
to psycho...@googlegroups.com
Having got Libyaml to work I'm not concerned about this right now.

--
Jonathan Peirce
Reply all
Reply to author
Forward
0 new messages