26 February 2012

77. Compiling Wine 1.4-rc4 and wine 1.4-rc5 on debian testing

UPDATE 16 May 2013: See here for Wine 1.5.30: http://verahill.blogspot.com.au/2013/05/416-wine-1530-in-chroot.html

A more exhaustive description of installing wine in general is here: http://verahill.blogspot.com.au/2012/01/debian-testingwheezy-64-bit-installing.html

I'm not a fan of running windows programmes on linux -- there are enough high-quality packages out there for linux to last you a life-time, and no matter how good wine is¸ the experience of running a windows program on linux is likely to be worse (if faster) than running it natively.

But like most people I'm help prisoner by my fellow co-workers who insists on dog+world using MS Office etc. Also, in spite of everything there are a few pieces of specialised software which lack linux equivalents.

UPDATE (10th Jan 2013): See here for Wine 1.5.21 using the multiarch approach: http://verahill.blogspot.com.au/2013/01/308-compiling-wine-1521-on-debian.html

Finally, from the point of view of easing new users off of windows and onto a real OS, wine and virtualbox fill important functions. I was myself a heavy user of both in the beginning, before learning how to use gnuplot, latex etc.

JPEG support is a PITA, but possible -- see below.

opencl -dev and lib32opencl1 require the contrib non-free repos, e.g.
deb ftp://ftp.au.debian.org/debian/ testing main contrib non-free
Updated: I've tried the same guide on wine 1.4-rc5

--- START HERE ---
With that out of the way, here's building wine 1.4-rc4

First, you need a whole lot of packages -- these will be installed if you've previously compiled wine according to this:

sudo apt-get install bison flex gcc libc6-dev libfontconfig-dev libfreetype6-dev libglu-dev libgsm1-dev libice-dev libjpeg-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libpng-dev libsm-dev libssl-dev libusb-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt-dev libxt-dev libxxf86vm-dev make libcapi20-dev liblcms-dev libsane-dev libhal-dev libdbus-1-dev valgrind prelink libcups2-dev opencl-dev lib32opencl1 oss4-dev gettext

sudo apt-get install lib32v4l-dev lib32ncurses5-dev lib32asound2-dev lib32z-dev ia32-libs-dev

To enable jpeg support you are SUPPOSED TO:
First, remove existing symlinks
sudo rm /usr/lib32/libjpeg.so.62 /usr/lib32/libjpeg.so.62.0.0
Then, create new ones
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62.0.0

Download the sources and expand:
wget http://prdownloads.sourceforge.net/wine/wine-1.4-rc4.tar.bz2
bzip2 -d wine-1.4-rc4.tar.bz2
tar -xvf wine-1.4-rc4.tar

If you get errors, see below and here for solutions. Missing libraries are often ok -- it just means certain functionality will be missing. It's up to you what is important. If you followed the instructions above you'll have jpeg support in spite of what configure spits out.

make -j7

as usual 7 is the number of cores +1. If you have a dual core, replace 7 with 3. Parallel building is sometimes much, much faster than just using one core, sometimes not.
If you already have a version of wine installed, this is a good time to uninstall it. Then,

sudo checkinstall

builds a .deb package and installs it. It's useful if you need to uninstall in the future.


Copying documentation directory...

part takes forever. It will finish in about ten minutes or so. If the building of the debian package fails, make sure you set the version number correctly (see errors below).

aptitude show wine-1.4
Package: wine-1.4                      
New: yes
State: installed
Automatically installed: no
Version: 1.4-rc4-1
Priority: extra
Section: checkinstall
Maintainer: root@beryllium
Uncompressed Size: 129 M
Description: Wine 1.4-rc4


Updated 02/03/2012:

For Wine1.4-rc5:
 wget http://sourceforge.net/projects/wine/files/Source/wine-1.4-rc5.tar.bz2
tar -xvf wine-1.4-rc5.tar.bz2
cd wine-1.4-rc5/
gstreamer, libgsm, libtiff, libjpeg warnings. You can ignore them.
sudo checkinstall

List of errors:

configure: OpenCL 32-bit development files not found, OpenCL won't be supported.

sudo apt-get install lib32opencl1 opencl-dev

configure: gstreamer-0.10 base plugins 32-bit development files not found, gstreamer support disabled
No solution:
Not the only one with this problem...I don't care enough about video to follow this up any more. Likely, an approach similar to this will work: http://forum.winehq.org/viewtopic.php?t=5797&sid=afde9de83a98b8cb24df2bb3646930b6

configure: OSS sound system found but too old (OSSv4 needed), OSS won't be supported.

 sudo apt-get install oss4-dev

configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported.
Solution, maybe:
I don't care too much,  but there are solutions if you are desperate enough: http://forum.winehq.org/viewtopic.php?t=5797&sid=afde9de83a98b8cb24df2bb3646930b6


configure: libtiff 32-bit development files not found, TIFF won't be supported.

No soution:
This comes up on some boxes, but not others. Comparing the installed packages I have no idea why.

aptitude search tiff|grep dev

v   libtiff-dev                     -                                        
i A libtiff4-dev                    - Tag Image File Format (TIFF) library (old
p   libtiff5-dev                    - Tag Image File Format library (TIFF), deve

ls /usr/lib32/libtiff* -lah
 /usr/lib32/libtiff.so -> libtiff.so.4.3.3
/usr/lib32/libtiff.so.4 -> libtiff.so.4.3.3
 /usr/lib32/libtiffxx.so -> libtiffxx.so.0.0.7

configure: WARNING: gettext tools not found, translations won't be built.
sudo apt-get install gettext

configure: WARNING: libjpeg 32-bit development files not found, JPEG won't be supported.

First, install
sudo apt-get install libjpeg8-dev

This pointed me here.

Here's how to check for the bug
 locate libjpeg | grep 32
ls /usr/lib32/libjpeg.* -lah

/usr/lib32/libjpeg.so -> libjpeg.so.62.0.0
/usr/lib32/libjpeg.so.62 -> libjpeg.so.62.0.0
 /usr/lib32/libjpeg.so.8 -> libjpeg.so.8.0.2

Yup, libjpeg.so points to v 6.2 instead of v 8 which I have installed.

According to the bug report, the cause of the error is that the header file jpeglib.h states one version, and the /usr/lib32/libjpeg.so points to another:

cat /usr/include/jpeglib.h|grep "LIB_VERSION"| grep define
#define JPEG_LIB_VERSION        80 /* Compatibility version 8.0 */

Remove existing symlinks
sudo rm /usr/lib32/libjpeg.so.62 /usr/lib32/libjpeg.so.62.0.0
Create new ones
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62.0.0

ls /usr/lib32/libjpeg.* -lah now gives



/usr/lib32/libjpeg.so -> libjpeg.so.62.0.0

 /usr/lib32/libjpeg.so.62 -> /usr/lib32/libjpeg.so.8

 /usr/lib32/libjpeg.so.62.0.0 -> /usr/lib32/libjpeg.so.8

/usr/lib32/libjpeg.so.8 -> libjpeg.so.8.0.2


The error message remains on ./configure, but jpeg support is /supposed/ to work in spite of this.

Building Debian package... FAILED!
*** Failed to build the package
Do you want to see the log file?  [y]:
dpkg-deb: error: parsing file '/var/tmp/tmp.Y50XUaisW0/package/DEBIAN/control' near line 7 package 'wine-1.4':  error in Version string 'rc4-1': version number does not start with digit

sudo checkinstall
This package will be built according to these values:
0 -  Maintainer: [ root@beryllium ]
1 -  Summary: [ Wine 1.4-rc4 ]
2 -  Name:    [ wine-1.4 ]
3 -  Version: [ rc4 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ wine-1.4-rc4 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ wine-1.4 ]
12 - Conflicts: [  ]
13 - Replaces: [  ]
Enter a number to change any of them or press ENTER to continue: 3
Enter new version:
>> 1.4-rc4


  1. Thank you so much for this procedure... I was lost trying before finding your page.

  2. Thanks for this. Just installed Wheezy and didn't want to deal with old version(s) of Wine.

  3. make -j7 is the number of cores +1

    Stop copy paste nonsense.... sigh...

    make -j1 will spawn 1 worker process
    -j7 will spawn 7.


    makes adding -jjob unnecessary
    on an i7 this is the same as -j8

    When in doubt check top.....

    1. You comment could be read to miss the real point -- whether you should over-commit (threads>cores) or not (threads<=cores)?





    2. See here for the optimal number of threads in a test case:

      N+1 works out pretty well.

    3. Same anon,


      Clearly shows the validity of my previous post, and it did seem you initially missed my point, so maybe a clarification is in place.

      Historically N+1 or even N*1.5 was used & worked better on memory / I-O constrained systems where the available cache was used as a short lasting one to feed the extra committed threads / processes while I-O was in progress...

      As you've observed correctly this is not the case on machines that have an abundance of RAM, where this acts as a long lasting cache, no data that got written to disk will be read back > spawning additional threads / processes has therefore a detrimental effect on efficiency due to (much) more rescheduling / TLB shootdown interrupts.

      In short, when available ram is larger then total disk-space needed for build
      N = amount of logical cpu's
      if not
      N = logical cpu's + 1

      Setting the global environment variable (CONCURRENCY_LEVEL) instead of fixed values for -j for automated builds using the previously mentioned

      is always the safest bet, especially when using server grade machines and high speed 0 seek time solid state disks ...


    4. Thank you for the background -- and I should have put a link to the kernel test here given that they very clearly confirmed what you said in the first post.

      I've updated post 305 (http://verahill.blogspot.com.au/2013/01/305-make-jn-should-n-equal-number-of.html) with a link to the kernel test and your additional comment, so that readers get the full picture.

      I also realize I sounded a bit smug in the previous comment -- although I was actually just happily surprised that the N+1 advice was supported by that particular set of tests.

    5. Same anon again ;-)

      I realized that I was being smug myself in the first post too ( and quite a bit too brief ). I very much appreciate the effort you took for verifying my statement, which proves to me you got a good attitude.

      Too much it happens that false assumptions are made based on old facts and old references too often contradict with recent ones. ( copy pasta rulez ;-)
      This too often confuses new linux users, as I recall being frustrated over deprecated info presented as current more then once ( looong time ago lol )

      Anyway as I'm doing full time development on cluster / HPC systems ( 3D related ) and being to lazy to keep a blog about it I volunteer to peer review your articles. If interested ... leave a comment

    6. Cheers for the offer :)
      I might even take you up on it if I end up revisiting either realtime kernels (which people like me always tend to misunderstand) or network optimisation.

      Anyway, I know the feeling when you see a misconception propagated too often -- you stop looking at each example as an isolated incident of someone simply getting the details wrong, and it starts feeling like there's a conspiracy of idiots.

      Anyway, thank you for correcting me and providing a bit of background.