Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: pysfml-cython  (Read 102344 times)

0 Members and 2 Guests are viewing this topic.

gtoast

  • Newbie
  • *
  • Posts: 2
    • View Profile
pysfml2-cython
« Reply #90 on: February 03, 2012, 01:43:18 pm »
I'm having trouble getting pysfml2 to build. I'm on Mac OS X Lion using python2.7 via Macports. I've successfully installed SFML2 and been able to run examples but I when I try to build pysfml2 I get a bunch of warnings and a failure to find the sfml-[blah] libraries.

Code: [Select]

...tons and tons of warnings...
363 warnings generated.
/Developer/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -fwrapv -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c hacks.cpp -o build/temp.macosx-10.7-x86_64-2.7/hacks.o
/Developer/usr/bin/clang++ -bundle -undefined dynamic_lookup -L/opt/local/lib build/temp.macosx-10.7-x86_64-2.7/sf.o build/temp.macosx-10.7-x86_64-2.7/hacks.o -L/Users/cdimara/Development/SFML/build-release/lib/sfml-graphics.framework -lsfml-graphics -lsfml-window -lsfml-audio -lsfml-system -o /Users/cdimara/Development/pysfml2-cython/sf.so
ld: library not found for -lsfml-graphics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/Developer/usr/bin/clang++' failed with exit status 1
Full error log

Any thoughts on what I'm doing wrong?

gtoast

  • Newbie
  • *
  • Posts: 2
    • View Profile
pysfml2-cython
« Reply #91 on: February 04, 2012, 03:41:50 pm »
Figured it out.

Though its not really detailed on the either the SFML2 or the PySFML2 install page, you need to make sure you uncheck the box saying build frameworks when you generate your unix make files in cmake for SFML2.

After that things work fine.

dfanz0r

  • Newbie
  • *
  • Posts: 11
    • View Profile
pysfml2-cython
« Reply #92 on: February 04, 2012, 11:04:41 pm »
I found something that would probably be good to fix

http://www.sfml-dev.org/documentation/2.0/classsf_1_1Clock.php

In the documentation for SFML 2 it says Clock.restart() should return the time since the clock was started.

Can you make this return that time also? It should be a pretty quick fix.

dfanz0r

  • Newbie
  • *
  • Posts: 11
    • View Profile
pysfml2-cython
« Reply #93 on: February 06, 2012, 03:54:11 am »
Ok so i have built it in MinGW this time it builds, and i think it runs fine.

The newer version doesn't seem to want to play nicely with another cython module im using for speeding up openGL some. The older build worked fine with it. Any idea's?

Razzeeyy

  • Newbie
  • *
  • Posts: 17
    • View Profile
pysfml2-cython
« Reply #94 on: February 17, 2012, 12:37:17 pm »
Excuse me, but do this binding works with python3?
I'm just confused by the 'cython' word.
AFAIK Cython is just different interpreter for python, isn't it? or it provides a bit different syntax too?

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
pysfml2-cython
« Reply #95 on: February 22, 2012, 06:19:29 pm »
Quote from: "dfanz0r"
Ok, for now i can just use the prebuilt version all im using now is clock window and event. I will need the Audio streaming stuff later on though. Will soon be looking into keyboard and joysticks too. Network would be useful at some point down the road but its not really needed for a while.


Keyboard and joysticks should work fine. Network classes aren't ported because their features are available in the Python standard library. I'll add streaming as soon as possible.

Quote from: "dfanz0r"
I found something that would probably be good to fix

http://www.sfml-dev.org/documentation/2.0/classsf_1_1Clock.php

In the documentation for SFML 2 it says Clock.restart() should return the time since the clock was started.

Can you make this return that time also? It should be a pretty quick fix.


Thanks, I made the change as soon as I read your message.

Quote from: "gtoast"
Figured it out.

Though its not really detailed on the either the SFML2 or the PySFML2 install page, you need to make sure you uncheck the box saying build frameworks when you generate your unix make files in cmake for SFML2.

After that things work fine.


It looks like it's mentioned here: http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

Quote
CMAKE_INSTALL_FRAMEWORK_PREFIX (Mac OS X only)
This is the install path for frameworks. By default, it is defined to the root library, i.e. /Library/Frameworks folder. As stated for CMAKE_INSTALL_PREFIX it is not mandatory to install files after compiling, but it is cleaner to install them.
This path is used to install on your system sndfile.framework (a required dependency not provided by Apple) and SFML as frameworks if BUILD_FRAMEWORKS is selected.


Quote from: "dfanz0r"
Ok so i have built it in MinGW this time it builds, and i think it runs fine.

The newer version doesn't seem to want to play nicely with another cython module im using for speeding up openGL some. The older build worked fine with it. Any idea's?


I've tried to use this module for OpenGL calls myself, so I need to know which tools you're using.
I now have a working Visual Studio installation, hopefully I'll be able to make it easier to build the module with it.

Quote from: "Razzeeyy"
Excuse me, but do this binding works with python3?
I'm just confused by the 'cython' word.
AFAIK Cython is just different interpreter for python, isn't it? or it provides a bit different syntax too?


Cython is a tool used to create CPython 2/3 extension modules. I have modified the documentation to be more clear about that.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
pysfml2-cython
« Reply #96 on: February 28, 2012, 04:13:12 am »
I have added a Windows installer for Python 2.7 32-bit. Feedback is welcome.
I have removed the source snapshot with Cython-generated files, as it was mainly intended to make the compilation easier for Windows users.

For version numbers, I think I'm just going to increase the revision number every time I generate a new installer. When SFML is released, I will use the same major and minor numbers as SFML, and I will use the revision number for pySFML-related changes. So if you're using SFML 2.1, you'll need pySFML 2.1.x.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
pysfml2-cython
« Reply #97 on: February 28, 2012, 08:34:27 pm »
By the way, I still have crashes at program exit (I was hoping that the problem comes from MinGW). Currently, I'm not focusing on it too much since it's not a big problem when you're trying out a library in its early stage.
I'm curious to know if everyone has this problem, and if it comes from SFML's cleanup or something else. I almost never have this kind of crash on GNU/Linux.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
pysfml2-cython
« Reply #98 on: March 05, 2012, 11:21:02 am »
I have fixed the Python 3 build, but you need to call the patch.py script to fix a file generated by Cython. See the updated documentation : http://pysfml2-cython.readthedocs.org/en/latest/building.html#building-a-python-3-module

I also added Python 3 and 64 bits Windows installers.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

dfanz0r

  • Newbie
  • *
  • Posts: 11
    • View Profile
pysfml2-cython
« Reply #99 on: March 07, 2012, 11:29:23 pm »
Ill try this new version out, and see if it fixes some of the issues i was having before.

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
pysfml2-cython
« Reply #100 on: March 17, 2012, 12:01:43 am »
I have renamed the module to sfml. It's more explicit and may avoid clashes.
If you want to keep it shorter, use “import sfml as sf” from now on.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

MarekkPie

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: pysfml2-cython
« Reply #101 on: March 25, 2012, 11:06:01 pm »
Is there anything in pySFML 2.0 that doesn't map nicely to the C++ version? I am wanting to test it out, but the documentation is a bit lacking in specificity.

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
Re: pysfml2-cython
« Reply #102 on: April 02, 2012, 07:08:55 pm »
Is there anything in pySFML 2.0 that doesn't map nicely to the C++ version? I am wanting to test it out, but the documentation is a bit lacking in specificity.

Read the tutorial for an overview. I'm eager to know if something important is missed out. I guess I should add a page for C++ developers as well.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

matpow2

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: pysfml2-cython
« Reply #103 on: April 11, 2012, 09:07:53 pm »
I'm not sure if this has been mentioned already, but the module is missing a way to manipulate the audio 'listener'.

If it could be added, that would be nice, thanks.

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
Re: pysfml2-cython
« Reply #104 on: April 20, 2012, 06:22:21 am »
Thanks for pointing that out, I've added it.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython