Building 32-bit Wine on a 64-bit (x86-64) system

If you just want to use Wine, there is no need to compile it using the instructions here. Just go to the downloads page and click the link for your distribution.

If you want to run 64-bit Windows programs, see Wine64.

If you want to build Wine on a 32-bit system, see Recommended Packages.


Ubuntu

You will either need to create a 32-bit chroot or manually link in the development libraries needed to compile Wine. Both methods are described here.

chroot Method

For more information on chroot and Ubuntu, see https://help.ubuntu.com/community/BasicChroot and https://help.ubuntu.com/community/DebootstrapChroot

First, install the schroot and debootstrap packages:

sudo apt-get install schroot debootstrap 

Now create a configuration file for schroot:

sudo editor /etc/schroot/chroot.d/precise_i386.conf 

Put this in the new file:

[precise_i386]
description=Ubuntu Precise
personality=linux32
directory=/srv/chroot/precise_i386
root-users=your_username
type=directory
users=your_username 

Create a working installation of Ubuntu inside the chroot. Replace "precise" with your Ubuntu version. You can replace http://archive.ubuntu.com/ubuntu/ with an appropriate mirror from https://launchpad.net/ubuntu/+archivemirrors:

sudo mkdir -p /srv/chroot/precise_i386
sudo debootstrap --variant=buildd --arch=i386 precise /srv/chroot/precise_i386 http://archive.ubuntu.com/ubuntu/ 

Make apt-get work from within the chroot:

sudo cp /etc/apt/sources.list /srv/chroot/precise_i386/etc/apt/ 

Enter the chroot:

schroot -c precise_i386 -u root 

Get the basic packages:

apt-get install ubuntu-minimal
apt-get install python-software-properties 

Install the build dependencies:

apt-get update
apt-get build-dep wine 

You might need to add the wine repository first if you get an error such as:

E: You must put some 'source' URIs in your sources.list 

To do so, simply run:

add-apt-repository ppa:ubuntu-wine/ppa
apt-get update 

Download the Wine source tree into your chroot:

apt-get install git
git clone git://source.winehq.org/git/wine 

Note that the default schroot rebinds the /home directory on the host system so that it appears in the chroot system. This means your home folder is basically shared.

Compile:

cd wine
./configure
make 

To be able to use Wine from outside the chroot, Wine's dependencies must be installed outside the chroot. The easiest way is to exit the chroot and install a prepackaged copy of Wine:

exit
sudo apt-get install wine 

You can now run Wine from outside the chroot:

exit
cd wine
./wine notepad 

Manually Linking Libraries Method

To manually link the development libraries needed by Wine you'll need sudo privileges and all of the 32-bit libraries need to be installed ("sudo apt-get build-dep wine" will quickly install everything). However, this action alone will not provide all of the necessary symbolic links. In order to get these linkages you can install a convenience package that will make them for you:

sudo apt-add-repository ppa:ehoover/compholio
sudo apt-get update
sudo apt-get install ia32-libs-dev

Alternatively, you can copy-paste the following code into a terminal window to setup the symbolic links:

cd /usr/lib/i386-linux-gnu
sudo ln -s libfreetype.so.6 libfreetype.so
sudo ln -s libX11.so.6 libX11.so
sudo ln -s libXau.so.6 libXau.so
sudo ln -s libXcursor.so.1 libXcursor.so
sudo ln -s libXi.so.6 libXi.so
sudo ln -s libXext.so.6 libXext.so
sudo ln -s libXxf86vm.so.1 libXxf86vm.so
sudo ln -s libXrandr.so.2 libXrandr.so
sudo ln -s libXrender.so.1 libXrender.so
sudo ln -s libXinerama.so.1 libXinerama.so
sudo ln -s libXcomposite.so.1 libXcomposite.so
sudo ln -s libGLU.so.1 libGLU.so
sudo ln -s libOSMesa.so.6 libOSMesa.so
sudo ln -s libgnutls.so.26 libgnutls.so
sudo ln -s libsane.so.1 libsane.so
sudo ln -s libv4l1.so.0 libv4l1.so
sudo ln -s libv4l2.so.0 libv4l2.so
sudo ln -s liblcms.so.1 liblcms.so
sudo ln -s libcapi20.so.3 libcapi20.so
sudo ln -s libcups.so.2 libcups.so
sudo ln -s libfontconfig.so.1 libfontconfig.so
sudo ln -s libtiff.so.4 libtiff.so
sudo ln -s libmpg123.so.0 libmpg123.so
sudo ln -s libodbc.so.1 libodbc.so
sudo ln -s libopenal.so.1 libopenal.so
sudo ln -s libldap-2.4.so.2 libldap.so
sudo ln -s libldap_r-2.4.so.2 libldap_r.so
sudo ln -s liblber-2.4.so.2 liblber.so
sudo ln -s libxml2.so.2 libxml2.so
sudo ln -s libxslt.so.1 libxslt.so
sudo ln -s libssl.so.0.9.8 libssl.so
sudo ln -s libcrypto.so.0.9.8 libcrypto.so
sudo ln -s libjpeg.so.8 libjpeg.so
sudo ln -s mesa/libGL.so libGL.so
cd /usr/lib/i386-linux-gnu/mesa
sudo ln -s libGL.so.1 libGL.so
cd /lib/i386-linux-gnu
sudo ln -s libdbus-1.so.3 libdbus-1.so
sudo ln -s libpng12.so.0 libpng.so

You will probably also need a couple missing 32-bit libraries, those can be obtained by executing:

sudo apt-get install libosmesa6:i386 libosmesa-dev libjpeg-turbo8-dev:i386

Please note that there are a couple libraries that are not fully supported with this method due to the way multilib works on Ubuntu 12.04+, specifically libtiff and libgstreamer are known to not be detected on configure.

Debian

Squeeze

For me the following worked:

1) aptitude install:

ia32-libs ia32-libs-dev ia32-libs-gtk lib32asound2 lib32asound2-dev lib32bz2-1.0 lib32gcc1 lib32gomp1 lib32ncurses5 lib32ncurses5-dev lib32stdc++6 lib32v4l-0 lib32v4l-dev lib32vdpau1 lib32z1 lib32z1-dev libgl1-nvidia-alternatives-ia32 libgl1-nvidia-glx-ia32 linux-headers-2.6.32-5-amd64 linux-headers-2.6.32-5-common linux-image-2.6.32-5-amd64 linux-kbuild-2.6.32 nvidia-glx-ia32 nvidia-libopencl1-ia32 nvidia-vdpau-driver-ia32 bison ccache flex fontforge gcc gettext git-core libasound2-dev libaudio-dev libc6-dev libcups2-dev libdbus-1-dev libelfg0 libesd0-dev libexif-dev libexpat1-dev libfontconfig1-dev libfreetype6-dev libgcrypt11-dev libgif-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgnutls-dev libgpg-error-dev libgphoto2-2-dev libgsm1-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libhal-storage-dev libice-dev libjpeg62-dev liblcms1-dev libldap2-dev libmad0 libmad0-dev libncurses5-dev libodbcinstq1c2 libogg-dev libopenal-dev libopenal1 libpng12-dev libpopt-dev libsane-dev libsm-dev libssl-dev libtasn1-3-dev libtiff4-dev libtiffxx0c2 libusb-dev libvorbis-dev libvorbisfile3 libx11-dev libxau-dev libxcomposite-dev libxcursor-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-dev libxmu-dev libxmu-headers libxrandr-dev libxrender-dev libxslt1-dev libxt-dev libxv-dev libxxf86vm-dev m4 make mesa-common-dev unixodbc unixodbc-dev x11proto-composite-dev x11proto-core-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-video-dev x11proto-xext-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev xtrans-dev zlib1g-dev libcapi20-3 libcapi20-dev libieee1284-3-dev linux-libc-dev prelink ~

2) ./configure --prefix=/home/miguel/bin/wine32

3) make

4) make install

Wheezy

Warning: probably way out of date, attention is needed

  1. apt-get the following packages:
    • ia32-libs (you need version 1.18 at least)
    • libc6-dev-i386
    • lib32z1-dev
    • ia32-libs-dev (it has the /usr/lib32/libpng.so, which seems to be required when installing TTF fonts)
    • optionally, a bunch of other libraries: libxcursor-dev libfontconfig1-dev libldap2-dev libxslt-dev libgl1-mesa-dev libglu1-xorg-dev libgnutls-dev libxi-dev lib32ncurses5-dev libxrandr-dev libxxf86vm-dev
  2. Make symlinks (see below, in the Debian SID section, for the full list of symlinks):
    cd /usr/lib32 ln -s libdbus-1.so.3 libdbus-1.so  

This is required as of 2008/05/20 to prevent Wine warning that HAL cannot be found. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473586

  1. Download the wine source and assuming gcc and all needed development packages are installed (see Recommended Packages) you can compile wine using:

    ./configure
    make
    make install 
  2. If the configure command fails with "configure: error: C compiler cannot create executables" and you use gcc-4.1, install "gcc-4.1-multilib" to solve it.
  3. Run wine by executing /emul/ia32-linux/usr/bin/wine (you can add the directory to the path or make a script). If wine complains that it can't find libwine.so.1 make sure /emul/ia32-linux/usr/lib is part of the LD_LIBRARY_PATH or run ldconfig -v.

Troubleshooting

If you have problems with libjpeg, there is a confirmed bug. The work around is:

You need to remove the version 0.62 and create a symbolic link to the version 0.8, probably both are installed into /usr/lib, in my case (i'm using debian amd64) are installed in /usr/lib32, i just type: $ ls | grep libjpeg, i've located the both libjpeg, deleted the 62 typing: # rm -f ./libjpeg.so.62 ./libjpeg.so.62.0.0 and create the two symlinks from version 0.8 typing: # ln -s ./libjpeg.so.8 ./libjpeg.so.62 and # ln -s ./libjpeg.so.8 ./libjpeg.so.62.0.0 and just compiled the wine again and problem solved, to assure that is the correct version of libjpeg just type: ./configure | grep jpeg before the make.

I found that ./configure still gave me a libjpeg error, but programs that used libjpeg worked well.

Gentoo

NOTE: This will compile wine and install it into your system. It is a really bad idea to install stuff manually into your gentoo system. If you want to be on the safe side, omit the "make install" command. You can still run wine from the source directory using the wine wrapper found at the root of the directory.

  1. Emerge wine and wine should install fine, if on the other hand you want to compile wine by hand follow the steps below.
  2. Install the x86 compatibility libraries (emul-linux-x86-xlibs, emul-linux-x86-soundlibs, ..)
  3. Download the wine source and assuming gcc and all needed development packages are installed (see Recommended Packages) you can compile wine using: configure --prefix=/emul/linux/x86/usr --x-libraries=/emul/linux/x86/usr/lib/X11 (in case of xorg 7.0, else */usr/X11R6/lib), make depend && make, make install

  4. Run wine by executing /emul/linux/usr/bin/wine (you can also make a symlink /usr/bin/wine -> /emul/linux/usr/bin/wine and the same for wineserver, then you can just type wine). If wine complains that it can't find libwine.so.1 make sure /emul/linux/usr/lib is part of the LD_LIBRARY_PATH or run ldconfig -v.

If nothing seems to work try using ebuild to compile it once and copy the source from /var/tmp/portage/wine-9999/work/wine somewhere. Ebuild /usr/portage/app-emulation/wine/wine-9999.ebuild fetch unpack compile. To update CVS add clean to the beginning.

openSUSE

Make sure you have the following 32 bit development packages installed in addition to Recommended Packages

  • capi4linux-32bit
  • cups-libs-32bit
  • fontconfig-devel-32bit
  • freeglut-devel-32bit
  • freetype2-devel-32bit
  • gcc-32bit
  • giflib-devel-32bit
  • glibc-devel-32bit
  • hal-32bit
  • libjpeg-devel-32bit
  • liblcms-devel-32bit
  • libpng-devel-32bit
  • libxml2-devel-32bit
  • libxslt-devel-32bit
  • Mesa-devel-32bit
  • ncurses-devel-32bit
  • openldap2-devel-32bit
  • openssl-devel-32bit
  • sane-32bit
  • unixODBC-devel-32bit
  • xorg-x11-devel-32bit
  • xorg-x11-libICE-32bit
  • xorg-x11-libICE-devel-32bit
  • xorg-x11-libSM-devel-32bit
  • xorg-x11-libX11-devel-32bit
  • xorg-x11-libXext-32bit
  • xorg-x11-libXext-devel-32bit
  • xorg-x11-libXp-32bit
  • xorg-x11-libXrender-devel-32bit
  • xorg-x11-libXt-32bit
  • zlib-devel-32bit Additional for SuSE 11.x:
  • libasound2-32bit
  • libcom_err-devel-32bit
  • libgnutls26-32bit
  • libgphoto2-32bit
  • libopenssl0_9_8-32bit

For openSUSE 11.x you will need to create these symlinks:

cd /usr/lib
sudo ln -s libasound.so.2.0.0 libasound.so
sudo ln -s libfreetype.so.6 libfreetype.so
sudo ln -s libgphoto2.so.2.4.0 libgphoto2.so
sudo ln -s libcups.so.2 libcups.so
sudo ln -s libssl.so.0.9.8 libssl.so
sudo ln -s libcrypto.so.0.9.8 libcrypto.so
sudo ln -s libhal.so.1.0.0 libhal.so
sudo ln -s libgphoto2_port.so.0.8.0 libgphoto2_port.so
sudo ln -s libgnutls.so.26 libgnutls.so
sudo ln -s libgstreamer-0.10.so.0.29.0 libgstreamer-0.10.so
sudo ln -s libgstapp-0.10.so.0.24.0 libgstapp-0.10.so
sudo ln -s libgstbase-0.10.so.0.29.0 libgstbase-0.10.so
cd /lib
sudo ln -s libdbus-1.so.3.4.0 libdbus-1.so
sudo ln -s libkeyutils.so.1 /usr/lib/libkeyutils.so
sudo ln -s libgobject-2.0.so.0.2800.0 /usr/lib/libgobject-2.0.so
sudo ln -s libgmodule-2.0.so.0.2800.0 /usr/lib/libgmodule-2.0.so
sudo ln -s libgthread-2.0.so.0.2800.0 /usr/lib/libgthread-2.0.so
sudo ln -s libglib-2.0.so.0.2800.0 /usr/lib/libglib-2.0.so 

Note: the targets of the above symlinks may need to be adjusted depending on what versions of the libraries you have installed on your system.

Run configure with:

./configure --x-libraries=/usr/X11R6/lib 

The --x-libraries switch is important, otherwise it will pick up the 64bit X libraries and just not work.

Fedora 16

Install the development packages needed to compile Wine as follows:

yum install alsa-lib-devel.i686 alsa-lib-devel audiofile-devel.i686 audiofile-devel cups-devel.i686 cups-devel dbus-devel.i686 dbus-devel fontconfig-devel.i686 fontconfig-devel freetype.i686 freetype-devel.i686 freetype-devel giflib-devel.i686 giflib-devel lcms-devel.i686 lcms-devel libICE-devel.i686 libICE-devel libjpeg-turbo-devel.i686 libjpeg-turbo-devel libpng-devel.i686 libpng-devel libSM-devel.i686 libSM-devel libusb-devel.i686 libusb-devel libX11-devel.i686 libX11-devel libXau-devel.i686 libXau-devel libXcomposite-devel.i686 libXcomposite-devel libXcursor-devel.i686 libXcursor-devel libXext-devel.i686 libXext-devel libXi-devel.i686 libXi-devel libXinerama-devel.i686 libXinerama-devel libxml2-devel.i686 libxml2-devel libXrandr-devel.i686 libXrandr-devel libXrender-devel.i686 libXrender-devel libxslt-devel.i686 libxslt-devel libXt-devel.i686 libXt-devel libXv-devel.i686 libXv-devel libXxf86vm-devel.i686 libXxf86vm-devel mesa-libGL-devel.i686 mesa-libGL-devel mesa-libGLU-devel.i686 mesa-libGLU-devel ncurses-devel.i686 ncurses-devel openldap-devel.i686 openldap-devel openssl-devel.i686 openssl-devel zlib-devel.i686 pkgconfig sane-backends-devel.i686 sane-backends-devel xorg-x11-proto-devel glibc-devel.i686 prelink fontforge flex bison libstdc++-devel.i686 pulseaudio-libs-devel.i686 gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel openal-soft-devel.i686 isdn4k-utils-devel.i686 gsm-devel.i686 samba-winbind libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 gettext-devel.i686 libmpg123-devel.i686

Run the configure script, compile Wine, and install it as follows:

./configure
make && make install

Fedora 17

Install the development packages needed to compile Wine as follows:

yum install alsa-lib-devel.i686 alsa-lib-devel audiofile-devel.i686 audiofile-devel cups-devel.i686 cups-devel dbus-devel.i686 dbus-devel fontconfig-devel.i686 fontconfig-devel freetype.i686 freetype-devel.i686 freetype-devel giflib-devel.i686 giflib-devel lcms-devel.i686 lcms-devel libICE-devel.i686 libICE-devel libjpeg-turbo-devel.i686 libjpeg-turbo-devel libpng-devel.i686 libpng-devel libSM-devel.i686 libSM-devel libusb-devel.i686 libusb-devel libX11-devel.i686 libX11-devel libXau-devel.i686 libXau-devel libXcomposite-devel.i686 libXcomposite-devel libXcursor-devel.i686 libXcursor-devel libXext-devel.i686 libXext-devel libXi-devel.i686 libXi-devel libXinerama-devel.i686 libXinerama-devel libxml2-devel.i686 libxml2-devel libXrandr-devel.i686 libXrandr-devel libXrender-devel.i686 libXrender-devel libxslt-devel.i686 libxslt-devel libXt-devel.i686 libXt-devel libXv-devel.i686 libXv-devel libXxf86vm-devel.i686 libXxf86vm-devel mesa-libGL-devel.i686 mesa-libGL-devel mesa-libGLU-devel.i686 mesa-libGLU-devel ncurses-devel.i686 ncurses-devel openldap-devel.i686 openldap-devel openssl-devel.i686 openssl-devel zlib-devel.i686 pkgconfig sane-backends-devel.i686 sane-backends-devel xorg-x11-proto-devel glibc-devel.i686 prelink fontforge flex bison libstdc++-devel.i686 pulseaudio-libs-devel.i686 gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel openal-soft-devel.i686 isdn4k-utils-devel.i686 gsm-devel.i686 samba-winbind libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 gettext-devel.i686 libmpg123-devel.i686

Run the configure script, compile Wine, and install it as follows:

./configure
make && make install

CentOS 5

Here is a script that installs 32 bit wine-1.2.2 on a 64 bit centos 5. It downloads and builds all required packages. This builds wine using all cores on the computer, so watch out you don't explode it if someone else is on. This is what the script installs:

yum groupinstall "Development Tools" yum install alsa-lib-devel audiofile-devel cups-devel dbus-devel fontconfig-devel freetype-devel giflib-devel hal-devel lcms-devel libICE-devel libjpeg-devel libpng-devel libSM-devel libusb-devel libX11-devel libXau-devel libXcomposite-devel libXcursor-devel libXext-devel libXi-devel libXinerama-devel llibxml2-devel libXrandr-devel libXrender-devel libxslt-devel libXt-devel libXv-devel libXxf86vm-devel mesa-libGL-devel mesa-libGLU-devel ncurses-devel openldap-devel openssl-devel pkgconfig sane-backends-devel xorg-x11-proto-devel glibc-devel prelink fontforge flex bison gnutls-devel pulseaudio-libs-devel gcc.i386 gcc-c++.i386 autoconf.i386 automake.i386 binutils.i386 ccache.i386 elf*.i386 libtool.i386 lua.i386 make.i386 pkgconfig.i386 patchutils.i386 tolua++.i386 bzip2-devel.i386 glibc-devel.i386 zlib-devel.i386 libX*.i386 libX*-devel.i386 mesa*-devel.i386 gphoto2-devel isdn4k-utils-devel XFree86-devel bison flex gcc prelink pkgconfig libstdc++-devel.i386    yum groupinstall "X Window System" 

You can get the Required Packages that are also needed to install wine. These are not in the centos 5 repositories so you must build them yourself. There are also rpms in it that you must install.

Contents: gnutls-2.8.6.tar.bz2, flex-2.5.35.tar.bz2, libtiff-3.5.5-2.i386.rpm , libtool-ltdl-1.5.22-7.el5_4.i386.rpm, mpg123-1.3.1-1.el5.rf.i386.rpm, openal-0.0.9-0.9.20060204cvs.el5.kb.i386.rpm, openal-0.0.9-0.9.20060204cvs.el5.kb.x86_64.rpm, libtool-ltdl-1.5.22-7.el5_4.x86_64.rpm, mpg123-1.9.1-1.el5.rf.x86_64.rpm, and wine-1.2.2.tar.bz2 

EL6 (RHEL6 and SL6)

Required packages for proper building of 32-bit Wine on 64-bit EL6

yum install alsa-lib-devel.i686 libsndfile-devel.i686 readline-devel.i686 glib2.i686 glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 pulseaudio-libs-devel.i686 cmake portaudio-devel.i686 openal-soft-devel.i686 audiofile-devel.i686 freeglut-devel.i686 lcms-devel.i686 libieee1284-devel.i686 openldap-devel.i686 unixODBC-devel.i686 sane-backends-devel.i686 fontforge libgphoto2-devel.i686 isdn4k-utils-devel.i686 mesa-libGL-devel.i686 mesa-libGLU-devel.i686 libXxf86dga-devel.i686 libXxf86vm-devel.i686 giflib-devel.i686 cups-devel.i686 gsm-devel.i686 libv4l-devel.i686 fontpackages-devel ImageMagick-devel.i686 openal-soft-devel.i686 libX11-devel.i686 docbook-utils-pdf libtextcat tex-cm-lgc

Trying to rebuild the epel 6 wine srpms (wine-1.2.3-1.el6.src.rpm) in 32-bit mode, I had to do the following manual changes to the spec files:

  • portaudio.spec: add an "export CC='gcc -m32 -march=i686'" in an %ifarch %{ix86}
  • wine.spec: add an "export CC='gcc -m32 -march=i686'" in an %ifarch %{ix86}, and remove 'TARGETFLAGS="" %{?_smp_mflags}' after %{make}

The resulting packages (src and binary) are available here http://www.gymglish.com/opensource/rpms/centos6-rpms/

Then, I could build the rpms in this order:

rpmbuild -ba --sign --target i686 portaudio.spec
rpmbuild -ba --sign --target i686 openal-soft.spec
rpmbuild -ba --sign --target i686 nss-mdns.spec
rpmbuild -ba --sign --target i686 wine.spec
rpmbuild -ba --sign wine-docs.spec


  • We should probably also have a page called UsingWineOn64bit for users (as opposed to developers).


CategoryDevelopment

WineOn64bit (last edited 2013-05-02 14:30:14 by MichalIdziorek2)