You are not logged in.

#1 2011-08-08 22:21:52

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

lilypond from ABS doesn't compile: Py_InitModule

Hi there,

I'm trying to build lilypond from source, but it fails with this output:

/home/rekado/dev/abs/lilypond/src/lilypond-2.14.2/scripts/build/out/help2man out/musicxml2ly > out/musicxml2ly.1
langdefs.py: warning: lilypond-doc gettext domain not found.
/home/rekado/dev/abs/lilypond/src/lilypond-2.14.2/scripts/build/out/help2man out/lilysong > out/lilysong.1
Traceback (most recent call last):
  File "out/midi2ly", line 54, in <module>
    import midi
ImportError: /home/rekado/dev/abs/lilypond/src/lilypond-2.14.2/python/out/midi.so: undefined symbol: Py_InitModule
/home/rekado/dev/abs/lilypond/src/lilypond-2.14.2/scripts/build/out/help2man out/lilymidi > out/lilymidi.1
help2man: can't get `--help' info from out/midi2ly
make[1]: *** [out/midi2ly.1] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/rekado/dev/abs/lilypond/src/lilypond-2.14.2/scripts'
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

I see that Py_InitModule is obsolete in python3, but it should be defined in python2.7, which is what is used to run the ./configure script. I even redirected the symlink /usr/bin/python to /usr/bin/python2, but without success.
Do you know how to fix this?

Offline

#2 2011-12-20 23:15:37

sitquietly
Member
From: On the Wolf River
Registered: 2010-07-12
Posts: 220

Re: lilypond from ABS doesn't compile: Py_InitModule

rekado wrote:

.....
Do you know how to fix this?

Yes. Add "--disable-documentation" to the ./configure command in the PKGBUILD. 

Explanation: Archlinux pkgbuilds often do not control the build options through the configuration section of the PKGBUILD but rely on a controlled chroot build environment and how the source package happens to build in that environment. In this case our systems all have perl installed so compiling in the "open" system allows the lilypond build scripts to try to build the documentation. The Arch dev who packaged lilypond compiled it in a special environment in which perl was not present (because it is not listed in the makedepends); without perl the lilypond build scripts skipped the documentation.

In my opinion the best practice is to make the enable/disable of options explicit in the PKGBUILD so that we can see what is being built or excluded by reading it, and so that we can actually compile packages from ABS using makepkg.

By the way, you'll also find that some Archlinux packages will not build if /usr/bin/python points to python3. The devs may be building those packages in a chroot in which python points to python2 (as it should). I build everything on my Arch system from source code and find it best to remove /usr/bin/python -- anything trying to run "python" on my system fails and I fix it to access python2 or python3.

Offline

#3 2011-12-21 00:05:40

rekado
Member
From: Shanghai, China
Registered: 2009-01-13
Posts: 98
Website

Re: lilypond from ABS doesn't compile: Py_InitModule

Thanks for the explanation!

Offline

Board footer

Powered by FluxBB