Showing posts with label debian wheezy. Show all posts
Showing posts with label debian wheezy. Show all posts

09 January 2013

313. Which Office for linux users? Libreoffice, Openoffice, Lotus Symphony, Google Docs, Microsoft Live/Skydrive, Wine/Office2003 and Office2003 in Virtualbox, WPS Office

UPDATE 6 Apr 2013: I've added WPS Office

UPDATE 10 Feb 2013: I've tried Libreoffice 4.0 as well -- no improvement in terms of rendering vs Libreoffice 3.5.4 (below). The start-up times are greatly improved though.

UPDATE 4 Feb. 2013: Equation Editor in Office 2003 on Wine used to be supported -- however, while fixing the editor in office 2010 support for older office versions broke. This will (hopefully) be fixed in future versions and the codeweaver and wine devs are aware of the issue. Bug reports to that effect:
http://bugs.winehq.org/show_bug.cgi?id=32697 and http://www.codeweavers.com/support/tickets/browse/?ticket_id=931759

Most of my publications are via collaborations, and I'm more or less the only one who uses Linux. When I'm in charge, I use latex -- but you can be a zealot, or you can be a pragmatist. Life tends to be easier for the pragmatic. I draw the line at actually using a native installation of Windows though.

A few things are important: figures should render ok, endnote should render ok, I need to use track changes and I should be able to insert equations. Oh, and the templates from the major publishers (RSC, Wiley, ACS) should work.

So, once and for all (well, I should revise this for each major version I suppose) here's an evaluation of  where each solution on Linux falls short and where it does well.

I mocked up a simple article style doc file using Word 2003, Endnote X and Microsoft Equation Editor 3.0 and the Angewandte Chemie template, and then opened it in various alternative solutions.

I tried:

  • LibreOffice
  • OpenOffice
  • Lotus Symphony
  • Abiword
  • Google Docs/Drive
  • Microsoft Live/Skydrive


Here's what I found:

NOTE: when I say 'good' or 'bad' I mean how well they reproduce the look which is found in Word 2003. It's not a judgement on the quality of the word processor as such. I also recognise that for a developer it isnt much fun spending time working on reproducing someone else's crappy and poorly documented software, when you could be implementing new and wonderful things instead.

Outcome: all non-Word 2003 solutions at a minimum had the figure move slightly relative to the text. All solutions did the Endnote references ok, if not the location of them. Some solutions had issues with the greek letters in the equation. All non-MS solutions rendered the equation as an image which couldn't be edited.

See for yourself...


Office 2003/Virtualbox
This is the canonical version -- this is how it was created and how it should look.
Word 2003 in Virtualbox


Libreoffice 1:3.5.4+dfsg-4 
Looks fine, but
* The numbering for the equation (put it there using a tab stop) is too far left
* part of a paragraph now separates the figure from its caption -- the picture hasn't moved, but the first column on the first page seems to be one line shorter, which pushes the text of the previous paragraph past the figure.
* The last paragraph doesn't end on the first page, but in the first column of the second page..
* The second page also looks different, with the endnote bit moved to the second column.
LibreOffice


Openoffice 3.4.1-1
I grabbed the latest debs from http://www.openoffice.org/download/other.html#tested-full
On the second page the Endnote references are in the right place (c.f. Libreoffice).

* Greek letters in Equation replaced by squares (missing font?). (greek letters in text is ok)
* The numbering for the equation (put it there using a tab stop) is too far left
* part of a paragraph now separates the figure from its caption -- the picture hasn't moved, but the first column on the first page seems to be one line shorter, which pushes the text of the previous paragraph past the figure.
* The last paragraph doesn't end on the first page, but in the first column of the second page..


OpenOffice


Lotus Symphony 3.0.1
I downloaded the Lucid i386 deb and installed it in an Ubuntu Lucid virtual machine. Symphony is based on OpenOffice.

* Greek letters in Equation disappeared completely. (greek letters in text is ok)
* The numbering for the equation (put it there using a tab stop) is too far left
* part of a paragraph now separates the figure from its caption -- the picture hasn't moved, but the first column on the first page seems to be one line shorter, which pushes the text of the previous paragraph past the figure.
* The last paragraph doesn't end on the first page, but in the first column of the second page..
* The second page also looks different, with the endnote bit moved to the second column.


Lotus Symphony


Office 2003/Wine
See here for installation: http://verahill.blogspot.com.au/2013/01/307-installing-office-2003-in-wine-on.html
Everything looks fine with one pretty important exception:
* The equation is missing completely. Note that other people may have better luck installing Equation editor under wine -- I haven't managed to install it at all.
Word 2003 in Wine
Abiword
Plenty of issues:
* The author box has move to the top left corner.
* Can't find the table
* Greek letters missing in equation
* Greek letter in text missing
* Lots of stuff missing or misplaced (e.g. Keyword background picture)
Abiword


Google Docs
This was the big surprise -- I've always thought that google docs was essentially as 'good' as Microsoft Office. They have a financial incentive to be, after all. Turns out that the document was all but unrecognisable when opened in Google Docs. By far the worst solution. Note: the out-of-date warning is triggered by Chrome 18. Most similar to Abiword.
Google Docs

Microsoft Live 
Yes, that's right -- Microsoft Live works on Linux. This is the free version you get via Hotmail/Skydrive -- not their Office 365 or whatever they use now.
There are more surprises -- it doesn't render the document faithfully.

View:
* The numbering for the equation (put it there using a tab stop) is too far left. (like Libreoffice)
* part of a paragraph now separates the figure from its caption -- the picture hasn't moved, but the first column on the first page seems to be one line shorter, which pushes the text of the previous paragraph past the figure. (like Libreoffice)
* The last paragraph doesn't end on the first page, but in the first column of the second page. (like Libreoffice)
* The last paragraph doesn't end on the first page, but in the first column of the second page. (like Openoffice)
In other words -- Libreoffice/Openoffice do just as well as Microsoft Live


The interface for the View mode


full -- and no, you can't zoom in and out...


Editing:
In editing mode all it looks like a mess -- see figures.
In addition to the obvious formatting mess,
* greek letters in text show up as squares (problem with fonts on my computer or problems with live?)
* The equation cannot be edited.
However, once you go back to View mode the formatting is restored -- but it'd leave you flying blind while trying to make changes.

Editing mode


The full document -- yes, there's no Zoom...
WPS (Kingsoft)
I only discovered this by accident. Kingsoft (金山软件) is a legitimate Chinese company (Star Office was big in the 90s) and somehow there's a linux version (i386) of their Office suite: http://linux.wps.cn/. The bad news is that it's in Chinese, but that doesn't stop me from evaluating it -- it's such a close copy to Office 2007 that you can pretty much guess how to use it.

You can download it by clicking on this link: http://wdl.cache.ijinshan.com/wps/download/Linux/unstable/wps-office_8.1.0.3724~b1p2_i386.deb

It seems to be reproducing the file pretty well, with the exception of how it renders the equation and the missing stars in the author affiliation section. However, the location of the figure caption is correct, and the second page looks good.

And here's how it looks:




312. Tau + OpenMPI profiling on Debian Testing/Wheezy

Still searching for a way to easily look at the execution of parallel jobs I came across TAU: http://www.cs.uoregon.edu/Research/tau/home.php

You can download without registering, but please do register as the number of registered users tend to be important for funding and evaluation of software development in academia: http://www.cs.uoregon.edu/Research/tau/downloads.php

I'm not really sure about how to use PDT, and I've used Tau without it before without any problems.

The compilation order below is also important -- pdt won't build without libpdb.a which is generated by tau -- but you can't configure tau with -pdt if it doesn't exist.


Compiling
sudo mkdir /opt/tau
sudo chown $USER /opt/tau
cd /opt/tau

wget http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/software_werkzeuge_zur_unterstuetzung_von_programmierung_und_optimierung/otf/dateien/OTF-1.12.2salmon.tar.gz
tar xvf OTF-1.12.2salmon.tar.gz
cd /OTF-1.12.2salmon/
./configure --prefix=/opt/tau/OTF
make
make install
cd ../

wget http://tau.uoregon.edu/tau.tgz
tar xvf tau.tgz
cd tau-2.22-p1/
./configure -mpilib=/usr/lib/openmpi/lib -prefix=/opt/tau -openmp -TRACE -iowrapper -otf=/opt/tau/OTF -pthread
make install
cd ../

wget http://tau.uoregon.edu/pdt.tar.gz
tar xvf pdt.tar.gz
cd pdtoolkit-3.18.1/
./configure -prefix=/opt/tau/pdt
make
make install


cd ../tau-2.22-p1/
./configure -mpilib=/usr/lib/openmpi/lib -prefix=/opt/tau -openmp -TRACE -iowrapper -pthread -otf=/opt/tau/OTF -pdt=/opt/tau/pdt

make install


Testing
Time to try it out on something parallel.

First set the path

PATH=$PATH:/opt/tau/x86_64/bin

I used nwchem with this input file, co2.nw:
title "co nmr" geometry c 0 0 0 o 0 0 1.13 end basis * library "6-311+G*" end property shielding end dft direct grid fine mult 1 xc HFexch 0.05 slater 0.95 becke88 nonlocal 0.72 vwn_5 1 perdew91 0.81 end task dft property

and ran it using
mpirun -n 3 tau_exec nwchem co2.nw

which ends with
Total times cpu: 4.8s wall: 7.6s
It's obviously a bit too short, but will do for illustration purposes.

That generates a set of files, profile.*.0.0 -- one for each thread i.e. profile.1.0.0, profile.2.0.0 and profile.3.0.0 in this particular case. There are a lot of options for tracing, using hardware counters etc. -- see http://www.cs.uoregon.edu/Research/tau/docs/newguide/
pprof -s
Reading Profile files in profile.* FUNCTION SUMMARY (total): --------------------------------------------------------------------------------------- %Time Exclusive Inclusive #Call #Subrs Inclusive Name msec total msec usec/call --------------------------------------------------------------------------------------- 100.0 15,813 25,931 3 14276 8643959 .TAU application 18.8 4,870 4,870 10272 0 474 MPI_Barrier() 12.1 3,138 3,138 3 0 1046279 MPI_Init() 8.1 2,090 2,090 818 0 2556 MPI_Recv() 0.0 9 9 3 0 3173 MPI_Finalize() 0.0 3 3 24 0 128 MPI_Bcast() 0.0 2 2 6 0 463 MPI_Comm_dup() 0.0 1 1 790 0 2 MPI_Comm_size() 0.0 0.872 0.872 818 0 1 MPI_Send() 0.0 0.294 0.294 841 0 0 MPI_Comm_rank() 0.0 0.17 0.17 674 0 0 MPI_Get_count() 0.0 0.111 0.111 3 0 37 MPI_Comm_free() 0.0 0.026 0.026 3 0 9 MPI_Errhandler_set() 0.0 0.024 0.024 6 0 4 MPI_Group_rank() 0.0 0.02 0.02 6 0 3 MPI_Comm_compare() 0.0 0.015 0.015 4 0 4 MPI_Comm_group() 0.0 0.008 0.008 4 0 2 MPI_Group_size() 0.0 0.004 0.004 1 0 4 MPI_Group_translate_ranks() FUNCTION SUMMARY (mean): --------------------------------------------------------------------------------------- %Time Exclusive Inclusive #Call #Subrs Inclusive Name msec total msec usec/call --------------------------------------------------------------------------------------- 100.0 5,271 8,643 1 4758.67 8643959 .TAU application 18.8 1,623 1,623 3424 0 474 MPI_Barrier() 12.1 1,046 1,046 1 0 1046279 MPI_Init() 8.1 696 696 272.667 0 2556 MPI_Recv() 0.0 3 3 1 0 3173 MPI_Finalize() 0.0 1 1 8 0 128 MPI_Bcast() 0.0 0.926 0.926 2 0 463 MPI_Comm_dup() 0.0 0.436 0.436 263.333 0 2 MPI_Comm_size() 0.0 0.291 0.291 272.667 0 1 MPI_Send() 0.0 0.098 0.098 280.333 0 0 MPI_Comm_rank() 0.0 0.0567 0.0567 224.667 0 0 MPI_Get_count() 0.0 0.037 0.037 1 0 37 MPI_Comm_free() 0.0 0.00867 0.00867 1 0 9 MPI_Errhandler_set() 0.0 0.008 0.008 2 0 4 MPI_Group_rank() 0.0 0.00667 0.00667 2 0 3 MPI_Comm_compare() 0.0 0.005 0.005 1.33333 0 4 MPI_Comm_group() 0.0 0.00267 0.00267 1.33333 0 2 MPI_Group_size() 0.0 0.00133 0.00133 0.333333 0 4 MPI_Group_translate_ranks()

...which I can't pretend to understand. Reasonably, the first line would be the cpu time and the wall time (4.8 and 7.6 s vs 5,271 and 8,643 ms).

A visual representation can be had by launching paraprof:
paraprof


Now it's time to explore...

The one thing that doesn't seem to work is visualisation of the communication matrix...



Failed attempt to build with vampirtrace
sudo mkdir /opt/tau
sudo chown $USER /opt/tau
cd /opt/tau


wget http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/software_werkzeuge_zur_unterstuetzung_von_programmierung_und_optimierung/otf/dateien/OTF-1.12.2salmon.tar.gz
tar xvf OTF-1.12.2salmon.tar.gz
cd /OTF-1.12.2salmon/
./configure --prefix=/opt/tau/OTF
make
make install
cd ../


wget http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/software_werkzeuge_zur_unterstuetzung_von_programmierung_und_optimierung/vampirtrace/dateien/VampirTrace-5.14.1.tar.gz
tar xvf VampirTrace-5.14.1.tar.gz
cd VampirTrace-5.14.1/
./configure --prefix=/opt/tau/vampirtrace --with-mpi-dir=/usr/lib/openmpi/lib --with-extern-otf-dir=/opt/tau/OTF
make
make install


wget http://tau.uoregon.edu/tau.tgz
tar xvf tau.tgz
cd tau-2.22-p1/
./configure -mpilib=/usr/lib/openmpi/lib -prefix=/opt/tau -openmp -TRACE -iowrapper -otf=/opt/tau/OTF -vampirtrace=/opt/tau/vampirtrace
make install

It builds fine, but during execution of mpirun -n 2 tau_exec... I get
Error: No matching binding for 'mpi' in directory /opt/tau/x86_64/lib
Available bindings (/opt/tau/x86_64/lib):
Error: No matching binding for 'mpi' in directory /opt/tau/x86_64/lib
Available bindings (/opt/tau/x86_64/lib):
  /opt/tau/x86_64/lib/shared-disable
  /opt/tau/x86_64/lib/shared-disable

311. Compiling MPE for MPI profiling

I've been wanting to get an overview of how my parallel (nwchem, gamess, dalton, etc.) programs are running, and whether there are any obvious bottlenecks other than the network and slow harddrives that I can sort out.

The Australia high performance computer facility in Canberrra uses http://ipm-hpc.sourceforge.net/, but I'm not having much luck compiling it, and the lack of recent updates makes me somewhat less willing to invest too much effort into it.

So I stumbled across MPE instead: http://www.mcs.anl.gov/research/projects/perfvis/download/index.htm#MPE

The problem is that almost all of the links of that page are broken, including those pointing towards the documentation, so I don't actually know how to use it properly. The presence of mpecc in /opt/mpe/bin suggests that it's used as a stand-in for mpicc when compiling, which I'll test some day.


Installing/compiling
cd ~/tmp
wget ftp://ftp.mcs.anl.gov/pub/mpi/mpe/mpe2.tar.gz
tar xvf mpe2.tar.gz
cd mpe2-1.3.0/
./configure MPI_CC=mpicc MPI_F77=mpif77 --prefix=/opt/mpe
make
sudo make install

I found what I looked for in Tau instead: 
http://verahill.blogspot.com.au/2013/01/312-tau-mpi-profiling-on-debian.html

310. Remote mounting using sshfs

I've run out of USB ports on my work desktop, so I occasionally cheat and attach USB drives to one of my compute nodes and transfer the files across the network to my desktop. Since I've got a gigabit switch set up, the speeds are quite acceptable.

NFS isn't really a solution here. Instead, sshfs is the tool to use.

The local and remote computer will be referring to Desktop and Node, respectively. The specific example I'm using here is that of a USB drive manually mounted on the Node, which contains pictures that I want to transfer to my Desktop.

On the Node
The plugged in USB device is found as /dev/sdb, and holds only one partition, /dev/sdb1.

sudo mkdir /media/usbdrive
sudo mount /dev/sdb1 /media/usbdrive


On the Desktop

sudo apt-get install sshfs
sudo mkdir /media/remote
sudo sshfs $USER@Node:/media/usbdrive /media/remote -o allow_other

That's about it. To unmount do
sudo umount /media/remote

and
sudo umount /media/usbdrive

respectively.

08 January 2013

308. Compiling Wine 1.5.21 with multiarch on Debian Testing -- clean multiarch build

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

Another update (28/1/2013): It seems like your mileage in terms of how well Wine will work for you will vary using this method. It works fine for me and I suspect it's because I've built earlier Wine versions of my systems and have ia32-libs-dev installed. This package is no longer available in Testing. ia32-libs installs the libs you need, but does not provide symlinks between .so and .so.X files -- you can probably do that by hand if necessary though. It's not for beginners.

An additional thing to remember is that the 1.5 series of Wine is a development series -- 1.4 is the stable series which is meant for end users. Progress made in 1.5 will be included in 1.6.


Update2 (26 Jan 2013): there are a couple of issues, and they will depend on how your system is set up.
* libosmesa6-dev:i386 will require mesa-common-dev:i386 which will remove libosmesa6-dev:amd64 and more, which is bad.
* libglu1-mesa-dev:i386 depends on libgl1-mesa-dev:i386 which will remove libgl1-mesa-dev:amd64 and more, which is bad.
*  libgstreamer-plugins-base0.10-dev:i386 depends on libgstreamer0.10-dev:i386 which depends on gir1.2-gstreamer-0.10:i386 which depends on gir1.2-freedesktop:i386 which depends on gir1.2-glib-2.0:i386 which depends on libgirepository-1.0-1:i386 which will remove a whole lot of packages (132 on one of my systems, including gnome, gdm3 etc.)

I'm working on figuring out what's triggering this on some systems but not others. Be aware that that doesn't necessarily mean that I will be successful in doing so -- any help is appreciated.

In the mean time see http://verahill.blogspot.com.au/2013/01/308-compiling-wine-1521-on-debian.html to see how to build wine in a chroot, which is safe. You can then install that .deb package on your normal system and HOPEFULLY there won't be any broken dependencies. You won't need the -dev:i386 packages on the install target.


ldd `which wine` 
linux-gate.so.1 => (0x55573000) libwine.so.1 => /usr/local/lib/libwine.so.1 (0x55576000) libpthread.so.0 => /lib32/libpthread.so.0 (0x556ec000) libc.so.6 => /lib32/libc.so.6 (0x55705000) libdl.so.2 => /lib32/libdl.so.2 (0x55867000)
so you really don't seem to need much in the way of shared libs installed.



Old Update: This build is safe now, and there are no remaining errors (i.e. opencl has been taken care of) (see update2 above for more recent information)


I've been building wine (e.g. http://verahill.blogspot.com.au/2012/12/building-wine-1519-on-debian.html) on a system that was set up a few years ago.

Ergo, since ia32libs are on their way out and being replaced by multiarch libs it's time to have a look at what a build from scratch looks like, and what dependencies are needed.

This time we'll build wine the old-fashioned way using configure/make/make install. The biggest challenge was to overcome the annoying
configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.
error. The solution to that was simply to install gcc-multilib. 

To work everything out from scratch I've set up a an amd64 chroot of a clean debian testing/wheezy. , It's increasingly appearing as if this is the easiest and safest thing to do.  Hopefully the release of Jessie will get the develop/improvement of multiarch back on the road.

To follow what's new in wine, look here: http://linux.softpedia.com/progChangelog/Wine-Changelog-148.html

...and the obligatory screenshot


The chroot environment
Basically as I've shown before:

sudo apt-get install debootstrap coreutils
mkdir -p $HOME/tmp/architectures/wine
cd $HOME/tmp/architectures
sudo debootstrap --arch amd64 testing $HOME/tmp/architectures/wine/ http://ftp.au.debian.org/debian/
sudo chroot wine/
apt-get install locales sudo vim
echo 'export LC_ALL="C"'>>/etc/bash.bashrc
echo 'export LANG="C"'>>/etc/bash.bashrc
source /etc/bash.bashrc
adduser winebuild
usermod -g sudo winebuild
echo 'Defaults !tty_tickets' >> /etc/sudoers

Edit /etc/hosts and add your hostname (here beryllium) to the end of the line e.g.
127.0.0.1 localhost beryllium

Exit, and the log in again
exit
sudo chroot wine

Then change user:
su winebuild
cd ~

Change at the very least the country code for the repo above (n red) so that you're using the closest/fastest one.

Compiling Wine
Set up multiarch (we're using amd64 but also want to support i386). I'm setting this up from scratch.

sudo dpkg --add-architecture i386
sudo apt-get update

Get the wine dependencies:

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 liblcms-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 libcurl4-openssl-dev:i386

sudo apt-get install gettext prelink bzip2 bison flex oss4-dev checkinstall ocl-icd-libopencl1:i386 opencl-headers

sudo apt-get install gcc-multilib

mkdir ~/tmp/
wget http://mirrors.ibiblio.org/wine/source/1.5/wine-1.5.21.tar.bz2 -O wine-unstable_1.5.21.orig.tar.bz2
tar xvf wine-unstable_1.5.21.orig.tar.bz2
cd wine-1.5.21/
./configure
config.status: executing include/wine commands config.status: executing Makefile commands configure: Finished. Do 'make' to compile Wine.
time make -j4

where -j4 is the number threads to launch, normally number of cores+1 (see here). Took around 15 minutes on a 3 core AMD.

Next
sudo checkinstall

to build a .deb package and install it (preferred solution) or
sudo make install

to just install.
Done!


Note that while this build works without issue, the transition to multiarch in debian is not complete and you will likely encounter this problem:
p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory
If you try to fix it you get
sudo apt-get install gnome-keyring:i386 libcap-ng0:i386 libgck-1-0:i386 libgcr-3-1:i386 gcr:i386 libcap2-bin:i386
The following packages have unmet dependencies: libgcr-3-1:i386 : Depends: libgcr-3-common:i386 but it is not installable
This is known. The question is what the consequences of this are -- in this thread it's been suggested that it prevents any program needing to use SSL under wine from working. More at wine HQ here and here. More at Debian here. If I'm reading this right -- and I might not be -- we'll at the least have to wait for gnome-keyring 3.6 to make it out of experimental to sid, then from sid to testing (which is frozen).

 For no particular reason I think this may be what's causing issues with the installation of Office 2003 (and a few other programs, including Agilent HP Chemstation).

Links to this page:
http://linux.org.ru/forum/desktop/8571617/page1?lastmod=1358076186524

307. Burning audio CDs from the command line in debian testing/wheezy

I've got a CD burner on a headless box, so burning audio CDs from the command line is a necessity.

I also normally end up burning flash videos that I've converted to mp3s, so I'll show that too. This post is essentially covered (although not very well) already here: http://verahill.blogspot.com.au/2012/01/debian-testing-64-wheezy-small-fixes.html

First install the necessary programmes
sudo apt-get install ffmpeg wodim mpg123


Converting flv to mp3
To batch-convert flv files to mp3, do
ls *.flv|xargs -I {}  ffmpeg -i {} -ar 44100 -ab 160k -ac 2 {}.mp3


Preparing the files
Rename your files to 01.mp3, 02.mp3 etc. to make the songs burn in that order (since you're using *wav below).

Convert the mp3s to wav files (you could've gone straight from flv to wav above)
for i in *.mp3; do mpg123 --rate 44100 --stereo --buffer 3072 --resync -w "`basename "$i" .mp3`".wav "$i"; done

Burn
Burn with
wodim -v -pad speed=1 dev=/dev/cdrw1 -dao -swab *.wav

assuming that cdrw1 is the correct device.

Eject your cd when done.
eject cdrom1

Done.
[There's also no shortage of terminal music players, such as cplay.]

PS. You can burn anything you want from the command line using burn, e.g. an .iso file
sudo apt-get install burn
sudo burn -I -n myiso.iso

If the device you want to burn on is /dev/cdrom1 instead of /dev/cdrom, you can edit that in /etc/burn.conf

07 January 2013

306. Insync with Google Drive and Google Docs on Debian Testing/Wheezy

The problem:
1. It would be nice to be able to use Google Docs as a replacement for Microsoft Word until Libre/OpenOffice catch up (post about that later) or the world switches to LaTeX and
2. for that to happen there needs to be an easier way to sync documents between google docs and your harddrive than using email.

The closest thing to that is using Google Drive to keep documents synced, and opening them in Google Docs using your browser.

It's been more than half a year since promising that Google Drive would be available for linux, and Google has yet to actually release anything (here) and it almost looks like vaporware (here).

In lieu of an official solution, there are a few options. One is Grive -- which seems to work with Google Drive but not Google Docs -- and another one is Insync, which isn't open source as it is owned by a start-up. It's the most promising and full-featured solution though, so we'll go with that.


There used to be gdocsfs, but it doesn't seem to be maintained.

The usual caveats about installing things from outside the repos apply, and even more so in this case since the source code is not available.

Setting up Insync
sudo apt-get install xdotool python-nautilus libxdo2 gir1.2-nautilus-3.0
mkdir -p ~/tmp/insync
cd ~/tmp/insync
wget http://s.insynchq.com/builds/insync-beta-gnome-cinnamon-common_0.9.34_amd64.deb
wget http://s.insynchq.com/builds/insync-beta-gnome_0.9.34_all.deb
sudo dpkg -i *.deb

If all went well you'll find InSync installed (move mouse to top-right corner, type insync and it should be there). Clicking on it opens a browser tab, in which you're asked to select the gmail account you wish to use.

You're next asked to allow InSync to do various things:

Confirm (you'll then get an email) and associate your machine with the account.

You should now have a new set of folders in $HOME:
/home/me/Insync/
`-- me@gmail.com





If you create a directory either in ~/Insync/me@gmail or in google drive using your browser, the directory should show up in both places (i.e. it's synced) -- assuming that you've got insync running:
insync --headless > /dev/null &

will keep it running in the background. Any doc file copied to the insync folder will now be editable in Google docs by pointing your browser to https://drive.google.com/#my-drive


Simple as that.

06 January 2013

304. Getting started with Simon 0.4 on Debian Wheezy/Testing (very basic)

Here's how to get started with Simon 0.4 -- although be warned that I've never used Simon before, and that there are likely better resources out there.

In the few cases where I use the command line, I have presumed that you are using the same locations as shown in this post: http://verahill.blogspot.com.au/2013/01/303-building-simon-04-speech.html

In case you screw up, to wipe all previous settings, try:

find ~/.kde -name "simon*"|xargs -I {} rm {} -rf

If you're really desperate, nuke the entire ~/.kde folder, although that obviously has repercussions if you're actually using KDE and not GNOME. Also look under ~/tmp/$USER-kde -- I had simond put files there too.

Anyway.


Running simon
simond &
simon

If you need to kill simond you can do
kill %1

assuming that you don't have any other background procs in that terminal.

1. Scenarios:
Click on Open, select Download and pick the scenarios which you are interested in. To make sure that things are working I'm more or less following the video.
In Scenarios, select a couple of H4W scenarios  (e.g. keyboard, mouse etc.) -- BUT NOT THE FIREFOX ONE, which causes trouble.








2. Speech Models:
Click on Open model, select Download and pick the Speech Model which you want. Pick the  HUB4 model since from the Youtube video it appears that you should match your scenarios and Speech models e.g. VF with VF and H4W with HUB4.






3. Server
Nothing weird here:


4. Sound Devices
I run my stuff via pulseaudio -- i.e. whatever the input source is there, will be used.


5. Volume
Do a bit of talking and see how the volume pans out. Ideally you should have any amplification of your microphone turned off, since that causes higher noise levels.


Julius problem:
If after clicking Finish you see this, you will want to work out what went wrong:
Make sure that you
1. compiled Simon with -DPJULIUS correctly set, and
2. you export the directory:
export PATH=$PATH:$HOME/.simon/julius/bin

Then restart simond and simon e.g. quit simon and kill simond, then launch simond in the background and then simon. To test if it's working correctly, go to Actions/Synchronize. No error means that it's working.


6. Get dictionary
Do e.g.
cd ~/.simon/
mkdir files
cd files
wget http://www.repository.voxforge1.org/downloads/SpeechCorpus/Trunk/Lexicon/VoxForge.tgz
tar xvf VoxForge.tgz

then select e.g. Standard, and click on Open "Standard"



  Click on Import Dictionary:
Select Shadow Dictionary and Next:
Pick HTK lexicon:

Import your file:
You should now see it compile the model and there should be stuff under Shadow Dictionary:



Testing
At this point you should be able to test whether you're being recognised. Make sure that the button says 'Activated' and not 'Activate'. Try speaking a few commands e.g. 'One', 'Two', 'Three','Chaos','Control' etc.
'Chaos'

'Control'
You'll see if it works by looking at "Last recognition results:".


Thoughts
Stuff that doesn't work: Configure Audio from within simon, Configure Acoustic Model from within Simon. Adaptive training with the VoxForge base model (complaining about grammar)

Stuff that does work: speech recognition, adaptive training for the HUB4 base model (and beautifully so).

While it's easy enough to get started, it does appear that there's no easy way of running the wizard again in case you want to change e.g. the base model or install more scenarios via download.

Obviously such a piece of software is fairly complex, and will have a high error rate, yet this is the type of software which should ideally just sit in the background and not really be noticed by the user -- it should (ideally) not require more work than e.g. using a mouse or a keyboard.

We're not quite there yet -- hence why we're at 0.4 and 1.0. Anyway, it's still kind of neat when my garbled utterances are correctly (most of the time) recognised by Simon. Now, how to get it to actually do stuff for me?

A. Get Scenarios later
visit http://kde-files.org/index.php?xcontentmode=692&PHPSESSID=0e48f2edd26bf70e676459a5465ec675


B. Get Base models later
visit http://kde-files.org/index.php?xcontentmode=648

25 November 2012

283. gnome-shell-extension-common 3.0.2 and gnome-shell-extensions 3.4.0 conflict

Not sure how this came about but I might have downloaded and install an unsupported .deb (from here I think) at some point at the beginning of Gnome 3.
Following this post will get you back to a conflict-free system BUT it will also remove debs that depend on gnome-shell-extension-common (i.e. packages that you have have downloaded from the web as deb packages. It won't affect normal gnome shell extensions).

The problem:
Unpacking gnome-shell-extensions (from .../gnome-shell-extensions_3.4.0-2_all.deb) ...
dpkg: error processing /var/cache/apt/archives/gnome-shell-extensions_3.4.0-2_all.deb (--unpack):
 trying to overwrite '/usr/share/locale/fr/LC_MESSAGES/gnome-shell-extensions.mo', which is also in package gnome-shell-extension-common 3.0.2-2
Errors were encountered while processing:
 /var/cache/apt/archives/gnome-shell-extensions_3.4.0-2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
and
sudo apt-get remove gnome-shell-extension-common 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 gnome : Depends: gnome-shell-extensions (>= 3.4) but it is not going to be installed
 gnome-shell-extension-alternate-tab : Depends: gnome-shell-extension-common but it is not going to be installed
 gnome-shell-extension-alternative-status-menu : Depends: gnome-shell-extension-common but it is not going to be installed
 gnome-shell-extension-auto-move-windows : Depends: gnome-shell-extension-common but it is not going to be installed
 gnome-shell-extension-dock : Depends: gnome-shell-extension-common but it is not going to be installed
 gnome-shell-extension-gajim : Depends: gnome-shell-extension-common but it is not going to be installed
 gnome-shell-extension-user-theme : Depends: gnome-shell-extension-common but it is not going to be installed
 gnome-shell-extension-windows-navigator : Depends: gnome-shell-extension-common but it is not going to be installed
 gnome-shell-extension-xrandr-indicator : Depends: gnome-shell-extension-common but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

The solution:
sudo dpkg --force-overwrite -i /var/cache/apt/archives/gnome-shell-extensions_3.4.0-2_all.deb
sudo apt-get install -f
sudo apt-get autoremove gnome-shell-extension-common=3.0.2-1
sudo apt-get update && sudo apt-get upgrade

282. Mesa 9.0.1 (64 bit) on debian wheezy


This post is intended as a step towards building wine with libOSmesa. Apparently any version of libOSmesa lower than 9 is no good, and debian wheezy currently have version 8.

Unfortunately building the 32 bit version turns out to be more complex than just requesting it via --enable-32-bit, so I'll be making a post on a chrooted build of the missing wine libraries later. I've also noticed that libOSMesa is just a small part of Mesa -- this build overlaps a lot with mesa-common-dev as well.

Finally, I don't really have a good grasp over graphics on linux -- which means that I'm still confused by OpenGl, CL, Mesa etc.

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




As usual: I have a lot of packages installed on my standard compile node, so there are probably a lot of packages which are needed which I didn't notice. But here we go:


First you need to build e.g. libdrm 2.4.40 since wheezy and sid currently have v2.4.33 and you need 2.4.39 or newer.

sudo apt-get install libpciaccess-dev checkinstall
wget http://cgit.freedesktop.org/mesa/drm/snapshot/libdrm-2.4.40.tar.gz
tar xvf libdrm-2.4.40.tar.gz
cd libdrm-2.4.40/
./autogen 
make
sudo checkinstall


When you're asked for a description, type 'libdrm 2.4.40' and it should get the version number right.
(you could also build with --prefix and install it somewhere else but that makes things trickier later)

Make sure it installed correctly:
aptitude show libdrm
Package: libdrm                          
New: yes
State: installed
Automatically installed: no
Version: 2.4.40-1
Priority: extra
Section: checkinstall
Maintainer: root@beryllium
Architecture: amd64
Uncompressed Size: 733 k
Description: libdrm 2.4.40


Build OS mesa v.9.0.1.

sudo apt-get install flex bison libdrm-dev xutils-dev x11proto-gl-dev x11proto-dri2-dev libx11-xcb-dev libxcb-glx0-dev libxcb-dri2-0-dev libxcb-xfixes0-dev llvm automake
cd ~/tmp
wget ftp://ftp.freedesktop.org/pub/mesa/9.0.1/MesaLib-9.0.1.tar.gz
tar xvf MesaLib-9.0.1.tar.gz
cd Mesa-9.0.1/
./autogen.sh --enable-osmesa
make
sudo checkinstall
This package will be built according to these values: 

0 -  Maintainer: [ root@beryllium ]
1 -  Summary: [ Mesa 9.0.1 64 bit]
2 -  Name:    [ mesa ]
3 -  Version: [ 9.0.1 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ Mesa-9.0.1 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ mesa ]
12 - Conflicts: [  ]
13 - Replaces: [  ]

Some notes:
xutils-dev contains makedepend; x11proto-gl-dev is GLPROTO, x11proto-dri2-dev is DRI2PROTO
LLVM is needed for one step in the build process (gallium). I'm sure you can get around it, but I'm not too bothered.



Links to this post:
http://forums.linuxmint.com/viewtopic.php?f=190&p=696973

20 October 2012

262. chroot/jail your iceweasel (firefox)

Update: in my youth I thought that chroot=security. I now know better.
http://yarchive.net/comp/linux/chroot.html
http://pen-testing.sans.org/blog/2012/06/06/escaping-restricted-linux-shells

In other words, don't rely on chroot for security -- it's not meant to be a security tool. I personally use it to browse at work without leaving a too obvious a trail (nothing shady -- part of my job is to apply for permanent jobs, but it is not necessarily in the interest of my current employer to see me succeed. Academia is a weird place.)

Original post:
There are many reasons why you'd want to secure your browser -- ranging from paranoia to justifiable cautiousness (you're probably visiting the wrong kind of sites...).

A chroot environment doesn't make you anonymous -- it just helps sandbox your applications. To protect your anonymity you'll want to prevent your browser from setting cookies, and use a proxy via an ssh tunnel to encrypt your traffic and hide your true IP address. There's no silver bullet for these things.

I've chroot:d things in the past when compiling 32 bit applications on 64 bit machines, but for this guide I'm leaning heavily on this post: https://help.ubuntu.com/community/BasicChroot

sudo apt-get install coreutils debootstrap

Time to get rocking. Be aware that you should have a bit of free space on your target drive.


sudo debootstrap --arch amd64 wheezy /media/chroot/ http://ftp.au.debian.org/debian/

which gets stuff underway:


I: Retrieving InRelease
I: Checking Release signature
I: Valid Release signature (key id 9FED2BCBDCD29CDF762678CBAED4B06F473041FA)
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://ftp.au.debian.org/debian...
I: Retrieving libacl1
I: Validating libacl1
I: Retrieving apt
[..]
I: Configuring dpkg-dev...
I: Configuring build-essential...
I: Base system installed successfully.

So far, so good.

Create a shell script, e.g. chroot.sh, with the following in it:
xhost +
sudo mount -o bind /proc /media/chroot/proc
sudo cp /etc/resolv.conf /media/chroot/etc/resolv.conf
sudo chroot /media/chroot

Run it everytime you want to enter you chroot environment:
sh chroot.sh

In the chroot shell, do
apt-get install locales sudo vim
echo 'export LC_ALL="C"'>>/etc/bash.bashrc
echo 'export LANG="C"'>>/etc/bash.bashrc
echo 'DISPLAY=:0.0' >> /etc/bash.bashrc
source /etc/bash.bashrc
adduser sandbox
usermod -g sudo sandbox
echo 'Defaults !tty_tickets' >> /etc/sudoers
apt-get install iceweasel
su sandbox
cd ~

Launch iceweasel/firefox:

sandbox@beryllium:/$ firefox


And you're pretty much done.
Next time you want to launch a sandboxed version of firefox just do:

me@beryllium:~$ sh chroot.sh 
access control disabled, clients can connect from any host
root@beryllium:/# su sandbox
sandbox@beryllium:/$ firefox

17 June 2012

194. Wine 1.4.1 and Wine 1.5.6 on Debian Wheezy

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

There's great appetite for anything wine-related in Debian, as I can see from visitor numbers, so  here's how to build  Wine 1.4.1 and Wine 1.5.6 in Debian Testing/Wheezy. Enough talking -- let's get compilin'!

The builds take a little while, so be warned. Not all features are enabled in this particular build either -- see the configure output.

If you're interested in the missing development files seen below, this post might help: http://verahill.blogspot.com.au/2012/03/cross-compiling-eg-32-bit-binaries-on.html. Instinctively, I am suspicious as to whether that would work. I haven't explored it though, and my chief motivation is to make build instructions which anyone can easily follow and reproduce.

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


For both
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 lib32v4l-dev lib32ncurses5-dev lib32asound2-dev lib32z-dev ia32-libs-dev


Version 1.4.1
wget http://prdownloads.sourceforge.net/wine/wine-1.4.1.tar.bz2

tar xvf wine-1.4.1.tar.bz2
cd wine-1.4.1/
./configure
configure: OpenCL 32-bit development files not found, OpenCL won't be supported.
configure: gstreamer-0.10 base plugins 32-bit development files not found, gstreamer support disabled
configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported.
configure: libtiff 32-bit development files not found, TIFF won't be supported.
configure: WARNING: libjpeg 32-bit development files not found, JPEG won't be supported.
configure: Finished.  Do 'make' to compile Wine.
make
sudo checkinstall --install=yes

Note: To just make a .deb package, do ---install=no.

Version 1.5.6
wget http://prdownloads.sourceforge.net/wine/wine-1.5.6.tar.bz2
tar xvf wine-1.5.6.tar.bz2
cd wine-1.5.6/
./configure

configure: OpenCL 32-bit development files not found, OpenCL won't be supported.
configure: libsane 32-bit development files not found, scanners won't be supported.
configure: gstreamer-0.10 base plugins 32-bit development files not found, gstreamer support disabled
configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported.
configure: libtiff 32-bit development files not found, TIFF won't be supported.
configure: WARNING: libjpeg 32-bit development files not found, JPEG won't be supported.
configure: Finished.  Do 'make' to compile Wine.
make
sudo checkinstall --install=yes

Note: To just make a .deb package, do ---install=no.

12 June 2012

187. Thunderbird 13.0 from source on debian wheezy

First look here for dependencies:
http://verahill.blogspot.com.au/2012/05/thunderbird-1201-on-debian.html

In terms of building it's almost exactly the same as for the 12-series: the only difference is that you have to build outside the source tree.

cd ~/tmp
rm comm-release -rf
wget ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/13.0/source/thunderbird-13.0.source.tar.bz2
tar xvf thunderbird-13.0.source.tar.bz2
mkdir thunderbird13
cd thunderbird13
../comm-release/./configure --disable-necko-wifi

The next step takes a while (30-60 minutes)
make 

sudo make install

Done.

What's new: http://www.ghacks.net/2012/06/06/whats-new-in-thunderbird-13/

Errors
No rule to make target ../../../xpcom/idl-parser/xpidllex.py
Solution:
Build outside the source tree as shown above.

08 June 2012

183. Compiling OpenMM 4.1 on debian testing

OpenMM 4.0 is still somewhat of a traumatic memory. However, having gotten a question about the compilation of v4.1 I can't really resist giving the new version a go.

Having said that, I never ended up using the GPU-enabled gromacs for which I built openmm, so it was all an enormous waste of time -- for those of you thinking about GPU/Gromacs know this:
* not all graphics cards are supported or worth supporting
* there's no speed-up for explicit solvent molecules, and what else would you use gromacs or MD for?
* consumer-grade graphics cards get very hot

I make no attempt at ferreting out what packages are needed other than what I'm explicitly prompted for. Look at http://verahill.blogspot.com.au/2012/01/debian-testing-64-wheezy_20.html for an indication of what you might need.

Also, I already have openmm 4.0 installed, so e.g. paths and other things defined in the post above are still active.


Start here
Register with simtk.org and download the source file.
sudo apt-get install cmake-curses-gui libgccxml-dev gccxml nvidia-cuda-toolkit
unzip -x OpenMM4.1-Source.zipe
mkdir openmm_build
cd openmm_build/
ccmake -i ../OpenMM4.1-Source/

It'll say Empty Cache. Hit c which will populate the list.

I think we can ignore the EMU libs since they do device emulation. I never figured out what the CUT program was and it's not mentioned in the manual from what I can see.


These are the settings I chose -- I had problems before setting the OPENCL parts (in red) to off.

BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/home/verahill/.openmm
CUDA_BUILD_TYPE:STRING=Device
CUDA_INSTALL_PREFIX:PATH=/usr/bin
CUDA_NVCC:FILEPATH=/usr/bin/nvcc
DL_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libdl.so
FOUND_CUBLAS:FILEPATH=/usr/lib/x86_64-linux-gnu/libcublas.so
FOUND_CUBLASEMU:FILEPATH=FOUND_CUBLASEMU-NOTFOUND
FOUND_CUFFT:FILEPATH=/usr/lib/x86_64-linux-gnu/libcufft.so
FOUND_CUFFTEMU:FILEPATH=FOUND_CUFFTEMU-NOTFOUND
FOUND_CUT:FILEPATH=FOUND_CUT-NOTFOUND
FOUND_CUT_INCLUDE:PATH=FOUND_CUT_INCLUDE-NOTFOUND

GCCXML_EXTRA_ARGS:STRING=
GCCXML_PATH:FILEPATH=/usr/bin/gccxml
OPENMM_BUILD_AMOEBA_CUDA_LIB:BOOL=ON
OPENMM_BUILD_AMOEBA_PLUGIN:BOOL=ON
OPENMM_BUILD_CUDA_LIB:BOOL=ON
OPENMM_BUILD_CUDA_TESTS:BOOL=TRUE
OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS:BOOL=ON
OPENMM_BUILD_FREE_ENERGY_CUDA_LIB:BOOL=ON
OPENMM_BUILD_FREE_ENERGY_PLUGIN:BOOL=ON
OPENMM_BUILD_OPENCL_LIB:BOOL=OFF
OPENMM_BUILD_OPENCL_TESTS:BOOL=OFF
OPENMM_BUILD_PYTHON_WRAPPERS:BOOL=ON
OPENMM_BUILD_RPMD_OPENCL_LIB:BOOL=OFF
OPENMM_BUILD_RPMD_PLUGIN:BOOL=ON
OPENMM_BUILD_SERIALIZATION_SUPPORT:BOOL=ON
OPENMM_BUILD_STATIC_LIB:BOOL=ON
OPENMM_GENERATE_API_DOCS:BOOL=OFF
OPENMM_SVN_REVISION:STRING=exported
PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python
SVNVERSION_PROGRAM:FILEPATH=/usr/bin/svnversion
SWIG_EXECUTABLE:FILEPATH=/usr/bin/swig
SWIG_VERSION:STRING=2.0.7

Make your changes and hit c again, then hit g which brings you back to the terminal.



make -d|tee make.log
make test


If all goes well you'll see
126/126 Test #126: TestParser ......................................   Passed    0.02 sec
100% tests passed, 0 tests failed out of 126
Total Test time (real) = 345.83 sec
make install


[..]
-- Installing: /home/verahill/.openmm/examples/Makefile
-- Installing: /home/verahill/.openmm/examples/NMakefile
-- Installing: /home/verahill/.openmm/examples/MakefileNotes.txt
-- Installing: /home/verahill/.openmm/examples/Empty.cpp

And you are done!

tree ~/.openmm/ -L 4 -d
.openmm/
|-- bin
|-- docs
|   |-- api-c++
|   `-- api-python
|-- examples
|   `-- VisualStudio
|-- include
|   `-- openmm
|       |-- internal
|       `-- serialization
|-- lib
|   `-- plugins
`-- licenses


182. Oracle Java JDK (java, javac and javaws) in debian testing/wheezy

With ECCE I was having problems with getting the same version of java and javac on a computer where I was using sun java 6.0

Since I'm using SGE I (think I) need the closed source SUN java version.
Download (and click on the license agreement) here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html


(v7u4 is available here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html
)


Then follow this: http://verahill.blogspot.com.au/2012/04/installing-sunoracle-java-in-debian.html
sudo apt-get install java-package
make-jpkg jdk-6u32-linux-x64.bin

and follow the instructions. Once the package is built, install:
sudo dpkg -i oracle-j2sdk1.6_1.6.0+update32_amd64.deb

Unpacking oracle-j2sdk1.6 (from oracle-j2sdk1.6_1.6.0+update32_amd64.deb) ...
Setting up oracle-j2sdk1.6 (1.6.0+update32) ...
update-alternatives: using /usr/lib/jvm/j2sdk1.6-oracle/jre/bin/ControlPanel to provide /usr/bin/ControlPanel (ControlPanel) in auto mode.
update-alternatives: using /usr/lib/jvm/j2sdk1.6-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/iceweasel/plugins/libjavaplugin.so (iceweasel-javaplugin.so) in auto mode.
update-alternatives: using /usr/lib/jvm/j2sdk1.6-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/chromium/plugins/libjavaplugin.so (chromium-javaplugin.so) in auto mode.
sudo update-alternatives --config java
There are 6 choices for the alternative java (providing /usr/bin/java).
  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
  1            /usr/bin/gij-4.4                                 1044      manual mode
  2            /usr/bin/gij-4.6                                 1046      manual mode
* 3            /usr/lib/jvm/j2re1.6-oracle/bin/java             314       manual mode
  4            /usr/lib/jvm/j2sdk1.6-oracle/jre/bin/java        315       manual mode
  5            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
  6            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode
sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
  Selection    Path                                         Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      auto mode
  1            /usr/lib/jvm/j2sdk1.6-oracle/bin/javac        315       manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      manual mode
sudo update-alternatives --config javaws
There are 3 choices for the alternative javaws (providing /usr/bin/javaws).

  Selection    Path                                              Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      auto mode
* 1            /usr/lib/jvm/j2re1.6-oracle/bin/javaws             314       manual mode
  2            /usr/lib/jvm/j2sdk1.6-oracle/jre/bin/javaws        315       manual mode
  3            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      manual mode




While I was making the package this little guy popped up. Don't fret. I think it was meant to take me to the java.com website or something similar. I don't like the sight of that /root/ thingy though -- what's oracle thinking of us punters?





07 June 2012

181. Compiling openmpi on debian wheezy

There's nothing complicated about this compilation. It's not a terribly quick build though, and I'm not yet sure exactly what packages are necessary.

sudo apt-get install build-essential gfortran
wget http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.tar.bz2
tar xvf openmpi-1.6.tar.bz2
cd openmpi-1.6/

sudo mkdir /opt/openmpi/
sudo chown ${USER} /opt/openmpi/
./configure --prefix=/opt/openmpi/1.6/ --with-sge

make
make install

And you're done.

tree -L2 -d /opt/openmpi




Linking to the libs is done as before, although the path to e.g. libmpi.so is /opt/openmpi/1.6/lib/ and not /opt/openmpi/1.6/lib/openmpi/ like in the regular debian package.

.

└── 1.6
    ├── bin
    ├── etc
    ├── include
    │   ├── openmpi
    │   └── vampirtrace
    ├── lib
    │   ├── openmpi
    │   └── pkgconfig
    └── share
        ├── man
        ├── openmpi
        └── vampirtrace


You might also want to update the /etc/alternatives/libmpi.so symlink.

This is definitely one of those packages where it's worth doing ./configure --help to see what options are available.

Also, I imagine that on ROCKS there may well be a few packages which will have to be compile first and specified using --with-<> switches.

A sample:

  --with-blcr(=DIR)       Path to BLCR Installation
  --with-blcr-libdir=DIR  Search for BLCR libraries in DIR
  --with-hwloc(=DIR)      Build hwloc support. DIR can take one of three
  --with-hwloc-libdir=DIR Search for hwloc libraries in DIR. Should only be
  --with-valgrind(=DIR)   Directory where the valgrind software is installed
  --with-memory-manager=TYPE
  --with-libpicl(=DIR)    Build libpicl support, optionally adding
  --with-libpicl-libdir=DIR
  --with-timer=TYPE       Build high resolution timer component TYPE
  --with-portals=DIR      Specify the installation directory of PORTALS
  --with-portals-libs=LIBS
                          Libraries to link with for portals
  --with-alps             Build ALPS scheduler component (default: no)
  --with-lsf(=DIR)        Build LSF support
  --with-lsf-libdir=DIR   Search for LSF libraries in DIR
  --with-pmi              Build PMI support (default: no)
  --with-cray-pmi-ext     Include Cray PMI2 extensions (default: no)
  --with-slurm            Build SLURM scheduler component (default: yes)
  --with-tm(=DIR)         Build TM (Torque, PBSPro, and compatible) support,
  --with-ftb(=DIR)        Build FTB (Fault Tolerance Backplane) support,
  --with-ftb-libdir=DIR   Search for FTB (Fault Tolerance Backplane) libraries
  --with-esmtp(=DIR)      Build esmtp support, optionally adding DIR/include,
  --with-esmtp-libdir=DIR Search for the esmtp libraries in DIR
  --with-sge              Build SGE or Grid Engine support (default: no)
  --with-loadleveler      Build LoadLeveler scheduler component (default: yes)
  --with-elan(=DIR)       Build Elan (QsNet2) support, searching for libraries
  --with-elan-libdir=DIR  Search for Elan (QsNet2) libraries in DIR
  --with-mx(=DIR)         Build MX (Myrinet Express) support, optionally
  --with-mx-libdir=DIR    Search for MX (Myrinet Express) libraries in DIR
  --with-openib(=DIR)     Build OpenFabrics support, optionally adding
  --with-openib-libdir=DIR
  --with-portals(=DIR)    Build Portals support, optionally adding
  --with-portals-config   configuration to use for Portals support. One of
  --with-portals-libs=LIBS
                          Libraries to link with for portals
  --with-sctp(=DIR)       Build SCTP support, searching for libraries in DIR
  --with-sctp-libdir=DIR  Search for SCTP libraries in DIR
  --with-knem(=DIR)       Build knem Linux kernel module support, searching
  --with-udapl(=DIR)      Build uDAPL support, optionally adding DIR/include,
  --with-udapl-libdir=DIR Search for uDAPL libraries in DIR
  --with-fca(=DIR)        Build fca (Mellanox Fabric Collective Accelerator)
  --with-io-romio-flags=FLAGS
  --with-mxm(=DIR)        Build Mellanox Messaging support
  --with-mxm-libdir=DIR   Search for Mellanox Messaging libraries in DIR
  --with-psm(=DIR)        Build PSM (Qlogic InfiniPath) support, optionally
  --with-psm-libdir=DIR   Search for PSM (QLogic InfiniPath PSM) libraries in
  --with-contrib-vt-flags=FLAGS
  --with-event-rtsig      compile with support for real time signals
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot=DIR Search for dependent libraries within DIR