Building pygame on Fedora 21 fails

Issue #240 resolved
Dustin Spicuzza created an issue

When building pygame on Fedora 21 via pip+hg, I get the following error message:

/usr/bin/ld: cannot find -lporttime

The common solution found on the internet (which worked for me) is creating a symlink from to

cd /usr/lib64
sudo ln -s

However, it'd be nice if pygame was able to detect the dependency properly and link to the correct library. Thanks for your work!

Comments (19)

  1. Thomas Kluyver

    In Fedora, I guess they compile into one shared library - there is still a separate porttime.h header file. I can't work out exactly where that difference comes from, but Fedora has a newer SVN snapshot of portmidi (217 rather than 184), so maybe it's something that portmidi changed. I don't know how best to check for that.

  2. René Dudfield

    I guess we need to detect if libporttime exists. Or maybe everyone compiles the two together now.

  3. Thomas Kluyver

    My fix got merged, so setting the environment variable PORTMIDI_INC_PORTTIME=1 makes it compile on Fedora now.

  4. Chris Long

    @takluyver I used your hint of $ export PORTMIDI_INC_PORTTIME=1 after installing all of the other dependencies that I tracked down and the install worked.


  5. Thomas Kluyver

    Not that I can think of. We can probably detect Fedora vs Ubuntu, but that feels clumsy. The real distinction, I think, is the version of portmidi they have packaged, and I don't know of any general cross-distro way to check for that.

  6. René Dudfield
    • changed status to open

    Damn. I meant to push to a new branch I'd made. But hg commit --amend for some reason changes back to default branch.

    See commit f463b140c832

    If there is no PORTMIDI_INC_PORTTIME environment variable it also checks for a /etc/redhat-release file and uses portmidi as porttime in that case.

    Seem ok?

  7. Thomas Kluyver

    I have confirmed that /etc/redhat-release exists on my Fedora machine and not on my Ubuntu one. However, there's a problem with how you check the environment variable (I made a comment on the commit). I think that having a reliable way to override it is more important than autodetection.

  8. Thomas Kluyver

    @illume I have tested it and it works on my Fedora laptop, so I'll mark this issue as resolved again.

  9. Log in to comment