Showing posts with label wine. Show all posts
Showing posts with label wine. Show all posts

19 February 2014

557. Briefly: Drawing Molecules on Linux: ACD/ChemSketch in Wine

This is another post where I'm cheating a bit -- this is a windows program running in wine.

Let me explain. Sometimes you absolutely need to get a task done -- I use linux at work and I can't not do something just because I can't write/find a piece of software that does it for me. Science is the goal, and the route there is immaterial. So sometimes you need to be pragmatic about your software choices.

I much prefer to use free and open source software since it allows me to keep a copy of the source code which I can recompile in case the prebuilt binary suddenly won't work with a future version of debian. Having the source makes me feel more secure in the assertion that it's worth my time learning how to use that piece of software.

Second to that, I prefer native linux software -- although unfortunately 'native' here often means 'written in java', and -- while not knowing too much about java -- from a user point of view java software tends to be comparatively slow to load and run. Certainly it appears slower than a comparable C/C++ program.

As a last resort, I can accept having to run a windows binary in wine. It doesn't make me happy, and often there are small, niggling issues associated with it -- but if it can get the job done, so be it.

Note that I'm unwilling to actually run a native windows program on a native windows installation -- one has to have some standards...

Either way, this is why I look at windows programs as well for drawing structures and processing NMR spectra.

So I recently tested marvinsketch (linux), bkchem (linux), easychem (linux), chemtool (linux), gchempaint (linux), ISISDraw (wine) and ChemSketch (wine). Out of those I prefer MarvinSketch. However, I'm still exploring the alternatives.

ACD/ChemSketch for Linux is really just an older (2006) version of ACD/LABS free ChemSketch (the windows version is from 2013). To get it, go to http://www.acdlabs.com/resources/freeware/index.php and click on Download. I tried the version 'for linux', and not the windows one. I'm making the presumption that the newer binary won't play well with wine.

You don't need to be an academic to qualify for the free version.

wine ~/Downloads/chemsk50.exe

Once it's installed you can explore ChemSketch. Overall it's fairly similar to e.g. ISISDraw.







18 February 2014

553. Briefly: Drawing molecules on Debian Wheezy: ISISDraw under wine (very briefly)

I'm cheating here: this isn't a program for linux. Instead we're running a windows program under wine, which is not ideal. On the other hand, it's so easy to do that it's worth exploring as an option to 'pure' linux offerings.

I'll be posting about native linux offerings later.

Either way, I've kept a copy of ISISDraw 2.5 around since the early 2000s. Luckily, other people are mirroring the installation file for it as well. See e.g. http://fc.smcdsb.on.ca/~rszerminski/addl_files_for_web/DRAW24.EXE for ISISDraw 2.4

 You'll need to install wine:i386 and for that you'll need to enable multiarch if you're on amd64:
sudo dpkg --add-architecture
sudo apt-get update
sudo apt-get install wine:i386
wget http://fc.smcdsb.on.ca/~rszerminski/addl_files_for_web/DRAW24.EXE
wine DRAW24.EXE

As always, if you have problems with e.g. weird fonts, use winetricks to install at least corefonts, or ideally allfonts:
wget http://winetricks.org/winetricks
sudo mv winetricks /usr/bin/winetricks
chmod +x /usr/bin/winetricks 
winetricks allfonts

Then run ISISDraw:
A blank slate
 ISISDraw has a lot of options, including templates and journal settings.
Chem Inspector
 There's a bug under wine: to get the menus for the buttons on the left side to show up, click on the button on the left panel, and then move the mouse left while still holding the button down.
To get the menus to work, click and while still holding the left button down move right
 ISISDraw is not going to blow you away, but it's free and it works under wine.

31 January 2014

546. NMR on Debian Wheezy: ACD/LABS NMR under Wine

I'm currently exploring options for processing NMR data on linux (see e.g. here for nmrnotebook). There are four categories of programs:
* proprietary/for-cost running natively on linux

* proprietary/non-open source but gratis running natively on linux
* gratis and open source running natively on linux

* windows programs that happen to run ok in wine

ACD/LABS belongs to the last category, and as such is not an ideal solution. However, at this point I'm willing to try just about anything.

So yes, this relies on you having wine installed, but sometimes we need to be pragmatic like Torvalds rather than dogmatic like Stallman (the world needs both of them).


Either way:

First register at http://www.acdlabs.com/account/register.php?redirect=/account/logout.php


Then download



Installation:

Install by running
wine ~/Downloads/nmrproc_academia12.exe

Go through the installation steps:











Running the software

For most of the steps below there's little need to provide a commentary:










I could only get it to fit by hitting 'Auto'

However, 'Auto' did respect my choice of function e.g. lorentzian vs mixed.


You can export the data as simple ascii files


In conclusion I must say that I'm fairly happy with this piece of software. I haven't used it for production purposes, so I can't vouch for it spitting out reliable data though. It's definitely worth exploring though.

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

12 July 2013

474. MS data, part I: Exporting data as csv from wsearch32, and generating MS assignments using Matt Monroe's molecular weight calculator

NOTE: I've heard rumours about problems with wsearch on Windows 7 Home, and on Windows 8. I've heard reports of it working on Windows 7 Professional. Curiously, it works just fine on linux under wine.

This post is written with two particular students in mind. I could put this in a pdf and email it, but why not share with the wider world since other people may encounter the same issues?

See here for part II: http://verahill.blogspot.com.au/2013/07/480-ms-data-part-ii-plotting-and.html


1. Exporting data from wsearch32
To install wsearch32 under wine, see here: http://verahill.blogspot.com.au/2013/01/321-wsearch32-in-wine.html

In order to export data from wsearch so that you can plot it in e.g. gnuplot, octave, origin or excel, do the following:

Open a spectrum (chromatogram) and pick a slice, then click on the M/I icon in the bottom right:

 Pick Save As

 And save as e.g. csv (comma separated file)

Done.

2. Using formula finder in Matthew Monroe's Molecular Weight Calculator
To install the molecular weight calculator in wine, see here: http://verahill.blogspot.com.au/2012/09/matt-monroes-molecular-weight.html

Open the molecular weight calculator and go to edit abbreviations.

 Add an abbreviation for MeO. We'll call it Methx, and it has a charge of -1:
 Methanol:
 Nitrate:
 Hit OK to save the changes.

 Go to formula finder:

We'll be looking for Ga, NO3, MeOH, O, H, MeO. Then click on Formula Finder Options:
 Limit the charge to 1:
 And search:

You can do fancier stuff, e.g. searching directly for the m/z and bound the search to min/max amounts of different elements:
 As shown here:




14 June 2013

452. Briefly: Wine and MIME nuisance: MS Modelling is associated with everything...

I've battled with this on and off for a long time.

And it's not problem unique to me: http://wiki.winehq.org/FAQ#head-c847a3ded88bac0e61aae0037fa7dbd4c7ae042a. The problem with that particular solution is that it's no good once the damage has happened. It's also a blanket method.

So, in a weak moment some winters ago I installed MS Modelling in Wine. I actually never use it, because there are better tools, but that's besides the point.

Unfortunately, MS Modelling has associated itself with most common (and uncommon) file types, such as .dat, .txt and .pgp:

I decided it was time to explore it in greater detail and remove all MS Modelling associations

The first step is to see how deep the rabbit hole goes:

grep "MS Modeling" $HOME/.local/share/applications/*.desktop
/home/verahill/.local/share/applications/wine-extension-3cam.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-accin.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-acx.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-arc.desktop:Name=MS Modeling [..] /home/verahill/.local/share/applications/wine-extension-xsd.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-xtd.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-xyd.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-xyz.desktop:Name=MS Modeling

85 file types. Not acceptable.

grep "MS Modeling" $HOME/.local/share/applications/*.desktop|sed 's/:/\t/g'|gawk '{print $1}'| xargs -I {} rm {}
grep "Materials Studio" $HOME/.local/share/mime/application/*.xml|sed 's/:/\t/g'|gawk '{print $1}'| xargs -I {} rm {}
update-mime-database ~/.local/share/mime

I also remove mime.cache, although I'm not sure whether that's a good idea. I haven't suffered for it yet though:
rm ~/.local/share/applications/mimeinfo.cache
update-mime-database ~/.local/share/mime

That solves the problem - temporarily.

Here's the issue: the files in $HOME/.local/share/mime/application/ get re-created when you start a wine program though.

And I think the problem is this: http://wiki.winehq.org/FileTypesIntegration

In other words, whatever associations are listed in the wine windows registry pollutes Gnome. And that's not acceptable. Anyway, let's put a stop to it using the method recommended on the Wine FAQ:

echo '[HKEY_CURRENT_USER\Software\Wine\DllOverrides] "winemenubuilder.exe"=""'> ~/.wine/disable-winemenubuilder.reg
regedit ~/.wine/disable-winemenubuilder.reg 

It seems to have worked. Opening a program in wine no longer recreates any of the files in ~/.local/share/mime/application.