Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

25 May 2012

163. Long rant over LaTeX problems caused by my own stupidity: tex.pro


25 May 2012.
I'm having problems turning dvi into ps
latex test.tex
works fine.
dvips test.dvi
however gives
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com) dvips: ! Couldn't find header file: tex.pro Process exited with error(s)
Solution:
Diagnosis: PEBKAC
I was being a bloody idiot.
cat ~/.bashrc|grep TEX
export TEXINPUTS=/usr/share/texmf/tex/latex/prosper/prosper.cls:$TEXINPUTS
export TEXMFMAIN=/usr/share/texmf/

Once I commented those lines out and did
export TEXINPUTS=""
export TEXMFMAIN=""

everything was fine.

I wasted 1h30 min of prime working time on THIS. Anyway, I'm putting it all up here in case someone is having a similar problem. The moral of the story is:
always begin by checking your ~/.bashrc, ~/.cshrc and ~/.profile.

The other reason for posting it online is because the troubleshooting steps may be useful to have in the future.

Troubleshooting
kpsewhich tex.pro
gave nothing

locate tex.pro
/usr/share/texlive/texmf/dvips/base/tex.pro /usr/share/texlive/texmf-dist/dvips/gastex/gastex.pro

neither
sudo texconfig
or
sudo mktexlsr
or
sudo texhash
helped (they pretty much do the same thing).

dpkg -S tex.pro
texlive-science: /usr/share/texlive/texmf-dist/dvips/gastex/gastex.pro texlive-base: /usr/share/texlive/texmf/dvips/base/tex.pro

show dpkg is aware of the files.
kpsewhich -path /usr/share/texlive/texmf/dvips/base tex.pro
/usr/share/texlive/texmf/dvips/base/tex.pro
obviously works.
dvips -d 2 draft_1.dvi
[..]
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com) input file draft_1.dvi output file draft_1.ps swmem 180000 kdebug:Search path for PostScript header files (from texmf.cnf) kdebug: = .:/usr/share/texlive/texmf/dvips/base//dvips//:/usr/share/texlive/texmf/dvips/base//fonts/enc//:/usr/share/texlive/texmf/dvips/base//fonts/type1//:/usr/share/texlive/texmf/dvips/base//fonts/type42//:/usr/share/texlive/texmf/dvips/base//fonts/type3// kdebug: before expansion = .:$TEXMF/{dvips,fonts/{enc,type1,type42,type3}}// kdebug: application override path = (none) kdebug: application config file path = (none) kdebug: texmf.cnf path = .:$TEXMF/{dvips,fonts/{enc,type1,type42,type3}}// kdebug: compile-time path = /nonesuch kdebug: environment variables = TEXPSHEADERS PSHEADERS [..] dvips: ! Couldn't find header file: tex.pro
export TEXMF=/usr/share/texlive/texmf
solves the tex.pro problem, but gives this instead:
tex.dvips: Can't open font metric file cmr10.tfm dvips: I will use cmr10.tfm instead, so expect bad output. dvips: ! I can't find cmr10.tfm; please reinstall me with proper paths
locate cmr10.tfm
/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr10.tfm
export TEXMF=$TEXMF:/usr/share/texlive/texmf-dist/fonts/tfm/public/cm
and we're back to
dvips: ! Couldn't find header file: tex.pro
sudo dpkg-reconfigure texlive-base
didn't do anything for me.
Solution
aptitude search texlive|grep ^i|gawk '{print $2,$3}>texlive.list
I then edited texlive.list and remove all the initial A on the relevant rows.

Then
sudo apt-get purge texlive

followed by
cat texlive.list|xargs >list
I the took the list there
sudo apt-get install `cat list`
which did
sudo apt-get install feynmf latex-beamer latex-xcolor pgf prosper texlive texlive-base texlive-bibtex-extra texlive-binaries texlive-common texlive-doc-base texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended texlive-latex-recommended-doc texlive-luatex texlive-metapost texlive-metapost-doc texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc texlive-publishers texlive-publishers-doc texlive-science texlive-science-doc texpower tipa

It still doesn't [censored] work!

It's the same shit with

dvipdfm draft_1.dvi
** WARNING ** Could not open config file "dvipdfmx.cfg". draft_1.dvi -> draft_1.pdf [1] 22057 bytes written

locate dvipdfmx.cfg
/usr/share/texlive/texmf/dvipdfmx/dvipdfmx.cfg /usr/share/texlive/texmf-dist/tex/generic/pstricks/config/xdvipdfmx.cfg
sudo texhash and sudo texconfig do nothing.
cat /usr/share/texlive/texmf/ls-R|egrep "tex.pro|dvipdfmx.cfg"
dvipdfmx.cfg dvipdfmx.cfg.ucf-dist tex.pro
So what the bloody hell is the effing problem?
locate ls-R
/usr/share/texlive/texmf/ls-R /usr/share/texlive/texmf-dist/ls-R /usr/share/texmf/ls-R /var/lib/texmf/ls-R /var/lib/texmf/ls-R-TEXLIVE /var/lib/texmf/ls-R-TEXLIVEDIST /var/lib/texmf/ls-R-TEXLIVEMAIN /var/lib/texmf/ls-R-TEXMFMAIN
So which ones have tex.pro in them?
/usr/share/texlive/texmf/ls-R -- yes /usr/share/texlive/texmf-dist/ls-R -- no /usr/share/texmf/ls-R -- no /var/lib/texmf/ls-R -- no /var/lib/texmf/ls-R-TEXLIVE -- yes /var/lib/texmf/ls-R-TEXLIVEDIST -- no /var/lib/texmf/ls-R-TEXLIVEMAIN -- yes/var/lib/texmf/ls-R-TEXMFMAIN -- no

05 May 2012

136. Compiling GIMP 2.8 on Debian Wheezy/Testing

EDIT 14/12/2012: To use an ugly approach to running gimp 2.8 on debian stable/squeeze, look here:
http://verahill.blogspot.com.au/2012/12/running-gimp-28-in-chroot-on-debian.html
It ain't pretty...

EDIT 27/05/2012: GIMP 2.8 is now in the debian testing repos.

GIMP 2.8 is out -- and it's got the fabled single-window mode: http://www.phoronix.com/scan.php?page=news_item&px=MTA5NjA

First you need to install babl >=0.1.10, and gegl-0.2 >= 0.2.0,  then you can compile and install GIMP 2.8. The versions of babel and gegl in the debian testing/wheezy repos are too old, so you will need to compile tboth babel and gegl yourself -- luckily it is very easy to do so (see below).

Building with python script support needed a ton of packages (it requires PyGTK which depends on pygobject which depends on glib and gobject-introspection etc.), so here I passed --disable-python during build. It just means you can't script gimp with python. No python.

As always, I only spot what packages are missing on my system. If you find that other packages are missing, let me know in the comment section and I'll expand the post. At a minimum, you will need build-essential

LMDE MINT USERS: it seems like you need to add a single line to your /etc/ld.so.conf file:
/usr/local/lib
Then do
sudo ldconfig 

ldconfig is in the package libc-bin

Both babl and gegl are gimp specific, so not giving install prefixes is probably ok. Just don't try to uninstall the pre-existing versions or gnome will disappear on you. See here http://forums.linuxmint.com/viewtopic.php?f=190&t=101253 for more LMDE discussions. See here http://cloudplasma.co.uk/2012/05/gimp-2-8-on-linux-mint-debian-edition/ for a compile based on this post.

START HERE
0. sudo apt-get install build-essential libatk1.0-dev libfontconfig1-dev libcairo2-dev libgudev-1.0-0 libdbus-1-dev libdbus-glib-1-dev liblcms1-dev libexif-dev libxfixes-dev libgtk2.0-dev python2.7-dev libtiff4-dev libpango1.0-dev

1. babl 0.1.10
wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2
tar xvf babl-0.1.10.tar.bz2
cd babl-0.1.10/
./configure
make
sudo make install

2. gegl 0.2.0
sudo apt-get install libglib2.0-dev zlib1g-dev
wget ftp://ftp.gtk.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2
tar xvf gegl-0.2.0.tar.bz2 
cd gegl-0.2.0/
./configure
make
sudo make install

3. gimp 2.8.0
sudo apt-get install intltool
wget ftp://ftp.gimp.org/pub/gimp/v2.8/gimp-2.8.0.tar.bz2
tar xvf gimp-2.8.0.tar.bz2 
cd gimp-2.8.0/
./configure --prefix=/home/me/.gimp --disable-python
make
make install

3. ~/.bashrc
Chuck the following in your ~/.bashrc
alias gimp28='/home/me/.gimp/bin/gimp-2.8'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

and source it. (source ~/.bashrc)

Start from the terminal using
gimp28

Done!

You can turn on single-window mode, by going to Windows and checking Single-Window Mode.


Edit: posted the how-to above eight hours ago, and already linked to by Debian-facile :-)


Links to this post:
http://forums.linuxmint.com/viewtopic.php?t=101253&f=190
http://cloudplasma.co.uk/2012/05/gimp-2-8-on-linux-mint-debian-edition/
http://linuxmint-fr.org/forum/graphisme/92501-installation-de-gimp-28.html

23 February 2012

72. Building maxima from source on Debian Testing


The version of maxima in the debian repos is the same as in the sourceforge archives. There's only one good reason to compile your own version from what I can see -- to get around the dependency of maxima on gnuplot.

Let me explain: the gnuplot version in the debian repos has problems handling small numbers (<10**(-9)). Uninstalling gnuplot and replacing it with your a version you've compiled yourself removes maxima.

Luckily it's easy to build:

wget http://sourceforge.net/projects/maxima/files/latest/download?source=files
mv download\?source\=files maxima-5.26.0.tar.gz
./configure
make -j5

where 5 is the number of cores +1 (I have four cores). Change as needed.

sudo checkinstall

Checkinstall may or may not exit successfully if you have compiled your own version of gnuplot -- see below. Chances are that it built the package correctly.

or 

sudo make install


Error:
If you get
dpkg: error processing maxima_5.26.0-1_amd64.deb (--install):
trying to overwrite '/usr/local/share/info/dir', which is also in package gnuplot 4.4.4-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

Solution: 
sudo dpkg --force-overwrite -i maxima_5.26.0-1_amd64.deb

You can see that the dir file is ok (GNUPlot is still referred to):

This is the file .../info/dir, which contains the
topmost node of the Info hierarchy, called (dir)Top.
The first time you invoke Info you start off looking at this node.

File: dir, Node: Top This is the top of the INFO tree
  This (the Directory node) gives a menu of major topics.
  Typing "q" exits, "?" lists all Info commands, "d" returns here,
  "h" gives a primer for first-timers,
  "mEmacs<Return>" visits the Emacs manual, etc.
  In Emacs, you can click mouse button 2 on a menu item or cross reference
  to select it.
* Menu:
Emacs
* Imaxima: (imaxima).           Image support for the computer algebra system
                                  Maxima. Interactive math minor mode.
Math
* GNUPLOT: (gnuplot).           An Interactive Plotting Program
* Maxima: (maxima).             A computer algebra system.
* Xmaxima: (xmaxima).           Graphical interface for Maxima.

16 December 2011

31. Update flash -- chrome on debian wheezy/testing 64 bit

You may have had problems playing flash videos recently and have been presented with a message saying that your player is out of date, and that you can either play (just this time) or upgrade. Clicking on upgrade takes you to the adobe website -- downloading the file is easy enough, but then what?

Well, here's how to upgrade.
Download the file install_flash_player_11_linux.x86_64.tar.gz
extract the libflashplayer.so file from the root of the compressed file

Figure out what files to replace:

locate libflashplayer.so
yields
/usr/lib/chromium-browser/plugins/libflashplayer.so
/usr/lib/flashplugin-nonfree/libflashplayer.so

So, in the directory where you put your new libflashplayer.so
sudo cp libflashplayer.so usr/lib/chromium-browser/plugins/libflashplayer.so
and
sudo cp libflashplayer.so /usr/lib/flashplugin-nonfree/libflashplayer.so


Restart your browser, and you should be good to go.

15 December 2011

29. Compiling/Building nwchem with mpich on debian testing 64 bit (Wheezy -- 15/12/2011)

So, as seen in the previous post, mpich2 ver 1.4 and nwchem 6.0 don't play nicely together.

Continuing with the virtual machine in the previous post, I added a line referencing the stable version to /etc/apt/sources.list:
deb ftp://ftp.au.debian.org/debian/ stable main contrib non-free

Important: I ADDED that line -- all lines referencing the testing version (or wheezy) are left untouched.
Do
sudo apt-get update
Since the versions in stable are older adding that line won't affect your system.

Now,
apt-cache showpkg mpich2

Under provides it should say:
1.4.1-1+b1
1.2.1.1-5

Now,
sudo apt-get install mpich2=1.2.1.1-5

You'll get a warning that you're about to downgrade, which is what we're trying to do.

sudo apt-get autoremove (will downgrade dependent packages. Just go with it)
aptitude search mpich2
check what's installed and what version
aptitude show libmpich2-dev
If it's 1.4.1 or not installed, make sure to set it to 1.2.1.1-5 just like for mpich2

Run sh myconfig.sh (see here for the script). Seems to build ok. All the mpd tools are where they should be.
NOTE: according to this post mpd isn't needed in newer (>=1.3) versions.

In summary, this seems to be the way to build nwchem on wheezy -- by downgrading the mpich2 and mpich2-dev packages. Since downgrading those packages may affect other packages as well, it may cause problems, but so far so good.

Testing the built binary:
mpd --ncpus=4 &
mptrace -l
mpdrun -n 4 ./nwchem ../../examples/dirdyvtst/h3/h3tr1.nw

All is good

EDIT (16/12/2011):
So, you've installed an older version of a package. apt-get will want to upgrade it, so you should put the packages on 'hold'. Every time you upgrade your system apt-get will warn you that there are packages on hold, so don't worry about forgetting about it

sudo su
echo "mpich2 hold"|dpkg --set-selections
echo "libmpich2-dev hold"|dpkg --set-selections

(taken from http://forums.debian.net/viewtopic.php?f=20&t=71448&start=15)

As an aside, you may want to downgrade gromacs-mpich to use mpich2-1.2 as well:
sudo apt-get install gromacs-mpich=4.0.7-3