Why is python building without the dl module, and how do I enable it (I've got that module on my x86 machines) Python 2.4.2 (#1, Dec 13 2005, 10:02:01) [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import dl Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named dl >>> patrick@tulkas ~/povray-3.6.1 $ emerge --info Portage 2.0.54 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r2 x86_64) ================================================================= System uname: 2.6.14-gentoo-r2 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ Gentoo Base System version 1.6.14 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] dev-lang/python: 2.3.5-r2, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=k8 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X a52 aac aalib accessibility acpi alsa audiofile avi bash-completion berkdb bitmap-fonts bzip2 caps cdda cdparanoia cdr corba crypt curl daap distcc doc dri dts dvb dvd dxr3 eds emacs emboss encode examples exif expat fam fbcon ffmpeg flac foomaticdb fortran ftp gd gdbm ggi gif glut gmp gnutls gpm gstreamer i8x0 idn imagemagic imlib ipv6 jack javascript jpeg kde ladcca lcms libwww lzw lzw-tiff mad matroska mng motif mp3 mpeg ncurses nls nvidia ogg oggvorbis openal opengl pam pcre pdflib perl png povray python qt quicktime readline samba sdl sndfile sox spell sqlite ssl subversion svg tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts udev usb userlocales vcd vcxd vorbis wifi xine xinerama xml xml2 xmms xpm xv zercoonf zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Python-2.4.2's setup.py contains: # Dynamic loading module if sys.maxint == 0x7fffffff: # This requires sizeof(int) == sizeof(long) == sizeof(char*) dl_inc = find_file('dlfcn.h', [], inc_dirs) if (dl_inc is not None) and (platform not in ['atheos', 'darwin']): exts.append( Extension('dl', ['dlmodule.c']) ) So this is most likely an upstream problem. Do you know of any systems with a python with the dl module on a 64-bit system?
according to the docs, that is by design: http://docs.python.org/lib/module-dl.html Note: This module will not work unless sizeof(int) == sizeof(long) == sizeof(char *) If this is not the case, SystemError will be raised on import. unless i'm mistaken, sizeof(int) is 32 under amd64 and sizeof(char *) is 64?
(In reply to comment #0) > > > So this is most likely an upstream problem. Do you know of any systems with a > python with the dl module on a 64-bit system? > I've heard rumours that FC4 would have it on its 64bit version. Can't check though, only have gentoo and don't know anybody that has FC4-64. Maybe they applied some specific PC patch?
This needs to be fixed upstream. Size of int differs from size of long/char* on (at least) alpha, ia64 and amd64.