21 August 2013

497. Compiling Wine 1.7 in a chroot on debian

Here's a generic way of building Wine 1.7 which is the new testing branch. And yes, it's the instructions for 1.5.28-1.6 recycled, with a few small amendments.

See here for information about 3D acceleration using libGL/U with Wine: http://verahill.blogspot.com.au/2013/05/429-briefly-wine-libglliubglu-blender.html

Getting started:
If you set up a e.g. chroot to build 1.6 you don't need to set up a new chroot to build 1.7. In that case, skip the set-up step below and instead re-enter your existing chroot like this:

sudo mount -o bind /proc wine32/proc
sudo cp /etc/resolv.conf wine32/etc/resolv.conf
sudo chroot wine32
su sandbox
cd ~/tmp

And skip to 'Building wine'.

Otherwise do this:
Setting up the Chroot
sudo apt-get install debootstrap
mkdir $HOME/tmp/architectures/wine32 -p
cd $HOME/tmp/architectures
sudo debootstrap --arch i386 wheezy $HOME/tmp/architectures/wine32 http://ftp.au.debian.org/debian/
sudo mount -o bind /proc wine32/proc
sudo cp /etc/resolv.conf wine32/etc/resolv.conf
sudo chroot wine32

You're now in the chroot:
apt-get update
apt-get install locales sudo vim
echo 'export LC_ALL="C"'>>/etc/bash.bashrc
echo 'export LANG="C"'>>/etc/bash.bashrc
echo '127.0.0.1 localhost beryllium' >> /etc/hosts
source /etc/bash.bashrc
adduser sandbox
usermod -g sudo sandbox
echo 'Defaults !tty_tickets' >> /etc/sudoers
su sandbox
cd ~/

Replace 'beryllium' with the name your host system (it's just to suppress error messages)

Building Wine
While still in the chroot, continue (the i386 is ok; don't worry about it -- you don't actually need it):

sudo apt-get install libx11-dev:i386 libfreetype6-dev:i386 libxcursor-dev:i386 libxi-dev:i386 libxxf86vm-dev:i386 libxrandr-dev:i386 libxinerama-dev:i386 libxcomposite-dev:i386 libglu-dev:i386 libosmesa-dev:i386 libglu-dev:i386 libosmesa-dev:i386 libdbus-1-dev:i386 libgnutls-dev:i386 libncurses-dev:i386 libsane-dev:i386 libv4l-dev:i386 libgphoto2-2-dev:i386 liblcms2-dev:i386 libgstreamer-plugins-base0.10-dev:i386 libcapi20-dev:i386 libcups2-dev:i386 libfontconfig-dev:i386 libgsm1-dev:i386 libtiff-dev:i386 libpng-dev:i386 libjpeg-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libldap-dev:i386 libxrender-dev:i386 libxml2-dev:i386 libxslt-dev:i386 libhal-dev:i386 gettext:i386 prelink:i386 bzip2:i386 bison:i386 flex:i386 oss4-dev:i386 checkinstall:i386 ocl-icd-libopencl1:i386 opencl-headers:i386 libasound2-dev:i386 build-essential
mkdir ~/tmp
cd ~/tmp
wget http://prdownloads.sourceforge.net/wine/wine-1.7.0.tar.bz2

tar xvf wine-1.7.0.tar.bz2
cd wine-1.7.0/
./configure
time make -j3
sudo checkinstall --install=no
checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran This software is released under the GNU GPL. The package documentation directory ./doc-pak does not exist. Should I create a default set of package docs? [y]: Preparing package documentation...OK Please write a description for the package. End your description with an empty line or EOF. >> wine 1.7.0 >> ***************************************** **** Debian package creation selected *** ***************************************** This package will be built according to these values: 0 - Maintainer: [ root@beryllium ] 1 - Summary: [ wine 1.7.0] 2 - Name: [ wine ] 3 - Version: [ 1.7.0] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ i386 ] 8 - Source location: [ wine-1.7.0 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ wine ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
Checkinstall takes a little while (In particular this step: 'Copying files to the temporary directory...').
********************************************************************** Done. The new package has been saved to /home/sandbox/tmp/wine-1.7.0/wine_1.7.0-1_i386.deb You can install it in your system anytime using: dpkg -i wine_1.7.0-1_i386.deb **********************************************************************


Installing Wine

Exit the chroot
sandbox@beryllium:~/tmp/wine-1.7.0$ exit
exit
root@beryllium:/# exit
exit
me@beryllium:~/tmp/architectures$ 

On your host system
 Enable multiarch* and install ia32-libs, since you've built a proper 32 bit binary:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs libgstreamer-plugins-base0.10-0

*At some point I think ia32-libs may be replaced by proper multiarch packages, but maybe not. So we're kind of doing both here.

 Copy the .deb package and install it
sudo cp wine32/home/sandbox/tmp/wine-1.7.0/wine_1.7.0-1_i386.deb .
sudo chown $USER wine_1.7.0-1_i386.deb
sudo dpkg -i wine_1.7.0-1_i386.deb

20 August 2013

496. Briefly: New email -- adding to PGP/GPG key and changing email account order in Thunderbird

I've created a new email address to move my email correspondence away from google as much as practically possible.

gpg
I've already got a gpg key pair, but I'd like to add the new email address to it.

First find out what you key id is, then add another user id:
 gpg --list-secret-keys
/home/me/.gnupg/secring.gpg ----------------------------- sec 1239G/F8F8FF8F 2011-11-11 uid me <aaa bbb.com> uid lindqvist <ccc ddd> uid verahill <eee fff.com> ssb 1239G/G8GG888G 2011-11-11
gpgp --edit-key F8F8FF8F
Secret key is available. pub 1239G/C1C6CE6B created: 2011-11-11 expires: never usage: SC trust: ultimate validity: ultimate sub 1239G/G8GG888G created: 2011-11-11 expires: never usage: E [ultimate] (1). me <aaa@bbb.com> [ultimate] (2) me <ccc@ddd.com> [ultimate] (3) lindqvist <eee@fff.com> [ultimate] (4) Verahill <ggg@hhh.com> gpg> adduid Real name: Linuxuser Email address: iii@jjj.fr Comment: 20/8/2013 You selected this USER-ID: "Linuxuser (20/8/2013) <iii@jjj.fr>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O You need a passphrase to unlock the secret key for user: "Linuxuser <iii@jjj.com>" 2048-bit RSA key, ID C1C6CE6B, created 2011-11-11 pub 1239G/C1C6CE6B created: 2011-11-11 expires: never usage: SC trust: ultimate validity: ultimate sub 1239G/G8GG888G created: 2011-11-11 expires: never usage: E [ultimate] (1). me <aaa@bbb.com> [ultimate] (2) me <ccc@ddd.com> [ultimate] (3) lindqvist <eee@fff.com> [ultimate] (4) Verahill <ggg@hhh.com> [ unknown] (5) Linuxuser (20/8/2013) <iii@jjj.fr> gpg> quit Save changes? (y/N) Y

Thunderbird
Simple, yet more complicated that it needs to be: http://sidvind.com/wiki/Thunderbird/Change_account_order

Go to Edit, Preferences, Advanced, General, Config Editor.


Search for mail.accountmanager.accounts, and edit the order of the accounts.

Note that the default account (mail.accountmanager.defaultaccount) will always show up first, regardless of the order you set. Restart thunderbird and the changes should take effect.

17 August 2013

495. Briefly: gromacs 4.6 on ROCKS 5.4.3

I didn't want to spend much time on getting this right, so I took the easiest route and combined three posts:

Firstly, I compiled cmake:
http://verahill.blogspot.com.au/2012/05/compiling-openbabel-231-and-cmake-on.html

Secondly, I used the openblas libraries which I compiled in this post
http://verahill.blogspot.com.au/2013/05/421-nwchem-63-on-rocks-543centos-56.html

Thirdly, I looked at this post which deals with gromacs 4.6 on debian:
http://verahill.blogspot.com.au/2013/04/396-compiling-gromacs-46-with-openblas.html

gromacs 4.6 can download and build its own fftw libs, so you don't need to do that separately.

First make the target directory, e.g.
sudo mkdir /share/apps/gromacs
sudo chown $USER:$USER /share/apps/gromacs

Single precision:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib:/share/apps/openblas/lib export LDFLAGS="-L/share/apps/openblas/lib -lopenblas" export CPPFLAGS="-I/share/apps/openblas/include" export CC=/usr/bin/gcc44 export CXX=/usr/bin/g++44 cmake -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=On -DGMX_DOUBLE=off -DCMAKE_INSTALL_PREFIX=/share/apps/gromacs/gromacs4.6_single -DGMX_EXTERNAL_BLAS=/share/apps/openblas/lib ../gromacs-4.6 make make install
Double precision:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib:/share/apps/openblas/lib export LDFLAGS="-L/share/apps/openblas/lib -lopenblas" export CPPFLAGS="-I/share/apps/openblas/include" export CC=/usr/bin/gcc44 export CXX=/usr/bin/g++44 cmake -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=On -DGMX_DOUBLE=on -DCMAKE_INSTALL_PREFIX=/share/apps/gromacs/gromacs4.6_double -DGMX_EXTERNAL_BLAS=/share/apps/openblas/lib ../gromacs-4.6 make make install
In my particular case I've got all users as members of the compchem group:
chown $USER:compchem /share/apps/gromacs -R 
chmod g+rwx /share/apps/gromacs -R