vrijdag 14 augustus 2009

upgrade, reinstall scipy

So I jumped on the upgrade wagon again with ubuntu, but now I need to obtain last versions of scipy again. All is now python2.6, and only gfortran is supported anymore. Make sure g77 is completely removed, and gfortran latest distro package

The workflow:

NOTE: use the --prefix /usr flag if setup.py installs in the wrong directory.

1. make sure you do not have the repository stuff installed or old versions:
sudo apt-get remove python-scipy python-numpy python-matplotlib python-gnuplot
sudo rm -rf /usr/lib/python2.6/site-packages
sudo rm -rf /usr/lib/python2.6/dist-packages/numpy
sudo rm -rf /usr/lib/python2.6/dist-packages/scipy
sudo rm -rf /usr/lib/python2.6/dist-packages/matplotlib
sudo rm -rf /usr/lib/python2.6/dist-packages/scikits*
2. obtain source code if you do not have it yet:
svn co http://svn.scipy.org/svn/numpy/trunk numpy
svn co http://svn.scipy.org/svn/scipy/trunk scipy
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib
svn co https://gnuplot-py.svn.sourceforge.net/svnroot/gnuplot-py/trunk gnuplot-py
svn co http://svn.scipy.org/svn/scikits/trunk/odes odes

3. Make sure you have the dependencies, eg
sudo apt-get install python-dev python-setuptools
For matplotlib, gtk backend, see build depend of the ubuntu package.
I used:

sudo apt-get install libpng-dev libgtk2.0-dev python-gtk2-dev python-imaging python-qt4 python-qt4-dev python-tz python-wxgtk2.8 zlib1g-dev libfreetype6-dev


4. go to numpy, update, compile, and install. Normally you need to remove /usr/lib/python2.6/site-packages/scipy or /usr/lib/python2.6/dist-packages/scipy and same for numpy first, but as python2.6 is new, those are not present.

cd numpy
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb

cd scipy
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb

cd matplotlib
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb

3. Now I can reinstall my own module in scikits

cd programs/odes
sudo rm -rf build
svn up
sudo python setup.py install --install-layout=deb
Above works only on first install. Afterwards I obtain an error with zip files?? To resolve
rm -rf /usr/lib/python2.6/dist-packages/scikits/odes
sudo rm -rf build
sudo python setup.py install --single-version-externally-managed --root / --install-layout=deb
And then it is time to test if all is working again.
Interesting resource: python distutils

donderdag 28 mei 2009

Jaunty, ati/radeon and a big desktop with xrandr

Buggers, my ati card is no longer supported by the fglrx driver of ati. Full 3D support is present though in the open source driver. Big desktop over two screens? Well 'man radeon' claims it is present. However, I noticed also bug 348332

So I waited with the upgrade, but today, I felt lucky and did the upgrade. Not a good idea.

First, although the upgrade manager said fglrx would not be installed, it did not regenerate my xorg file. So X crashed on startup. Alt+F1, a login and a "sudo dpkg-reconfigure -phigh xorg-server" later, I had my X back.

I got bit by bug 348332 very quickly though, so disabled desktop effects in the system settings for now. No option to make a big desktop in these settings though, so apparently that will be a manual install.

But first getting my effects back. A trip to http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.29.4/ and then install of the relevant components:
sudo dpkg -i linux-headers-2.6.29-02062904_2.6.29-02062904_all.deb linux-headers-2.6.29-02062904-generic_2.6.29-02062904_amd64.deb linux-image-2.6.29-02062904-generic_2.6.29-02062904_amd64.deb


After restart things looked ok:
$ uname -a Linux bmwork 2.6.29-02062904-generic #02062904 SMP Sat May 23 23:35:48 UTC 2009 x86_64 GNU/Linux
And re-enabling desktop effects was ok too. Still waiting for a crash, but all looks good so far.

So, now, how to get my big desktop back. My setup is using the default xorg.conf the radeon driver. My xorg.conf:

Section "Device"
Identifier "Configured Video Device"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection
Apparently we are supposed to use xrandr (see good intel guide) now for enabling a big desktop. First let's see if it is enabled:
$ xrandr -q
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 1280 x 1280
VGA-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 340mm x 270mm
1280x1024 60.0 + 75.0 60.0
1024x768 75.0 70.1 60.0*
800x600 75.0 60.3
640x480 75.0 59.9
720x400 70.1
DVI-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 304mm x 228mm
1024x768 60.0*+ 75.0 60.0*
800x600 75.0 60.3
640x480 75.0 59.9
720x400 70.1
OK, my VGA and DVI output are both recognized and correctly enabled, one with identifier VGA-0 and one with DVI-0. The default is clone mode though, which is what I indeed am seeing. To set my VGA left of the DVI I do:

$ xrandr --output VGA-0 --left-of DVI-0
xrandr: screen cannot be larger than 1280x1280 (desired size 2048x768)
It did not work. We need to make sure we can have a virtual screen of 2048x768 before above will work. The graphics card should be capable of this. My /var/log/Xorg.0.log file says:
(II) RADEON(0): Max desktop size set to 2560x1600
(II) RADEON(0): For a larger or smaller max desktop size, add a Virtual line to your xorg.conf
(II) RADEON(0): If you are having trouble with 3D, reduce the desktop size by adjusting the Virtual line to your xorg.conf
So add a Virtual line (see xorg.conf below), and all works.
Next, as given in the guides, you need to use xrandr commands to see if it works. Well, I can say it does not work 100% via the xrandr command in my case. The desktop got bigger indeed, but both screens kept showing the same thing. Fortunately, changing the xorg.conf file to do the xrandr settings worked like a charm. My new xorg.conf file is:

Section "Monitor"
Identifier "VGA"
EndSection

Section "Monitor"
Identifier "DVI"
Option "RightOf" "VGA"
EndSection

Section "Device"
Identifier "Configured Video Device"
Option "Monitor-VGA-0" "VGA"
Option "Monitor-DVI-0" "DVI"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"

SubSection "Display"
Depth 24
Virtual 2048 768
EndSubSection
EndSection
Things to note in the above:
  1. The options in the Device section you see, must have the identifier as given by the xrandr -q output, so Option "Monitor-VGA-0" "VGA" works but not Option "Monitor-VGA" "VGA"
  2. The Virtual 2048 768 line in Display is where the maximum virtual size is set (see xrandr error above) you need for your display. Take it as low as possible, so you can have as much as possible depth (it eats memory on the card!)
Good. Half a day to get a working set-up. Perhaps I should not upgrade so often. Fortunately, 3D does seem to work like a charm on my dual head setup :-)