1

Topic: Linux install script for V 5.4.1

For fast install of mmass V 5.4.1

We use the enthought python distribution, to solve dependencies.
Includes wxPython and numpy.

If you have a uni mail, it is free of charge.
[url]http://www.enthought.com[/url]/. The EPD, and not the Canopy thing. ([url]https://www.enthought.com/repo/epd/installers/[/url])

That have solved all my dependency problems since then, and the packages I need more, I install with pip, or github.

This script gets the source, and then compiles it.
The "which python2.7" finds the enthought python distribution, since my machine has python2.6 locally installed.

---------------
#!/bin/tcsh
set version=v5.4.1
set mfile=mmass_v5.4.1_source.zip
wget [url]http://www.mmass.org/download/files/$version/$mfile[/url]
unzip $mfile
rm $mfile

echo "You need these packages to compile mMass. (Names related to CentOS)"
echo "sudo yum install python"
echo "sudo yum install python-devel"
echo "sudo yum install numpy"
echo "sudo yum install wxPython"
echo ""
### To compile
cd ./mMass/mspy
python2.7 setup.py build
find ./build -iname 'calculations.so' -type f | xargs -I '{}' mv '{}' .
cd ..
# Group writing to config files
chmod g+w ./configs/*
### Make execution shell script
rm -f mMass.sh
set shellpath=`which bash`
set pythonpath=`which python2.7`
set mmasspath=`echo $PWD/mmass.py`
echo "#!""${shellpath}" >> mMass.sh
echo 'if [ -n "$1" ]' >> mMass.sh
echo 'then' >> mMass.sh
echo 'abspath=`readlink -f $1`' >> mMass.sh
echo "${pythonpath} ${mmasspath} "'$abspath' >> mMass.sh
echo 'else' >> mMass.sh
echo "${pythonpath} ${mmasspath}" >> mMass.sh
echo 'fi' >> mMass.sh
sed -i "s/mMass/mmass$version/" mMass.sh
chmod +x mMass.sh

cd ..
mv mMass mmass$version

### To make link to bin
#mkdir -p ~/bin
#ln -s $PWD/mMass.sh ~/bin/mmass

#./mMass.sh