Difference between revisions of "Installation mac"

From relax wiki
Jump to navigation Jump to search
(→‎The official way: Better list formatting.)
Line 9: Line 9:
  
 
# '''Python:'''  First download the latest 2.7 version from the [http://www.python.org/download/ Official Python website].
 
# '''Python:'''  First download the latest 2.7 version from the [http://www.python.org/download/ Official Python website].
#* This should be the DMG file labelled as '''Python 2.7.x Mac OS X 64-bit/32-bit x86-64/i386 Installer (for Mac OS X 10.6 and later)'''.
+
** This should be the DMG file labelled as '''Python 2.7.x Mac OS X 64-bit/32-bit x86-64/i386 Installer (for Mac OS X 10.6 and later)'''.
#* Open the DMG file, double click on the '''Python.mpkg''' file, and follow the instructions.
+
** Open the DMG file, double click on the '''Python.mpkg''' file, and follow the instructions.
#* The Python binary should now be located at '''/usr/local/bin/python'''.  This is actually a symbolic link pointing to '''/Library/Frameworks/Python.framework/Versions/2.7/bin/python'''.
+
** The Python binary should now be located at '''/usr/local/bin/python'''.  This is actually a symbolic link pointing to '''/Library/Frameworks/Python.framework/Versions/2.7/bin/python'''.
 
# '''wxPython:'''  Download the wxPython Development 2.9 DMG file from the [http://wxpython.org/download.php#unstable official wxPython website].
 
# '''wxPython:'''  Download the wxPython Development 2.9 DMG file from the [http://wxpython.org/download.php#unstable official wxPython website].
#* The link should be called '''wxPython2.9-osx-cocoa-py2.7'''.
+
** The link should be called '''wxPython2.9-osx-cocoa-py2.7'''.
#* Open the DMG file, double click on the '''wxPython2.9-osx-cocoa-py2.7.pkg''' file, and follow the instructions.
+
** Open the DMG file, double click on the '''wxPython2.9-osx-cocoa-py2.7.pkg''' file, and follow the instructions.
 
# '''Numpy:'''  Download the latest Numpy DMG file from the [http://sourceforge.net/projects/numpy/files/NumPy/ sourceforge download site].
 
# '''Numpy:'''  Download the latest Numpy DMG file from the [http://sourceforge.net/projects/numpy/files/NumPy/ sourceforge download site].
#* This should be the DMG file '''numpy-1.x.x-py2.7-python.org-macosx10.3.dmg'''.
+
** This should be the DMG file '''numpy-1.x.x-py2.7-python.org-macosx10.3.dmg'''.
#* Open the DMG file, double click on the '''numpy-1.x.x-py2.7.mpkg''' file, and follow the instructions.
+
** Open the DMG file, double click on the '''numpy-1.x.x-py2.7.mpkg''' file, and follow the instructions.
 
# '''Scipy:'''  Download the latest Scipy DMG file from the [http://sourceforge.net/projects/scipy/files/scipy/ sourceforge download site].
 
# '''Scipy:'''  Download the latest Scipy DMG file from the [http://sourceforge.net/projects/scipy/files/scipy/ sourceforge download site].
#* This should be the DMG file '''scipy-0.xx.x-py2.7-python.org-macosx10.3.dmg'''.
+
** This should be the DMG file '''scipy-0.xx.x-py2.7-python.org-macosx10.3.dmg'''.
#* Open the DMG file, double click on the '''scipy-0.xx.x-py2.7.mpkg''' file or equivalent, and follow the instructions.
+
** Open the DMG file, double click on the '''scipy-0.xx.x-py2.7.mpkg''' file or equivalent, and follow the instructions.
 
# '''Mpi4py:'''  This is for running on multi-processor machines, for the analyses in relax which support it.  Download the file from the [https://code.google.com/p/mpi4py/downloads/list mpi4py download site].
 
# '''Mpi4py:'''  This is for running on multi-processor machines, for the analyses in relax which support it.  Download the file from the [https://code.google.com/p/mpi4py/downloads/list mpi4py download site].
#* Note, this will require an up to date version of XCode installed on your system, as the code will be compiled.
+
** Note, this will require an up to date version of XCode installed on your system, as the code will be compiled.
#* Download the file labelled as '''mpi4py-1.x.x.tar.gz'''.
+
** Download the file labelled as '''mpi4py-1.x.x.tar.gz'''.
#* Open this through the Finder to unpackage the archive into the '''~/Downloads/mpi4py-1.x.x/''' directory.
+
** Open this through the Finder to unpackage the archive into the '''~/Downloads/mpi4py-1.x.x/''' directory.
#* Open a terminal and type, replacing the x's with the current version, the following to get into the correct directory:
+
** Open a terminal and type, replacing the x's with the current version, the following to get into the correct directory:
 
<source lang="bash">
 
<source lang="bash">
 
$ cd Downloads/mpi4py-1.x.x
 
$ cd Downloads/mpi4py-1.x.x
 
</source>
 
</source>
#* Then to be sure the correct Python version is being used, type:
+
** Then to be sure the correct Python version is being used, type:
 
<source lang="bash">
 
<source lang="bash">
 
$ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
 
$ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
 
</source>
 
</source>
 
# '''SCons:'''  This is required to build the relax C modules.  Download the file form the [http://www.scons.org/download.php SCons download site].
 
# '''SCons:'''  This is required to build the relax C modules.  Download the file form the [http://www.scons.org/download.php SCons download site].
#* Download the file called '''scons-2.x.x.tar.gz'''.
+
** Download the file called '''scons-2.x.x.tar.gz'''.
#* Open this through the Finder to unpackage the archive into the '''~/Downloads/scons-2.x.x/''' directory.
+
** Open this through the Finder to unpackage the archive into the '''~/Downloads/scons-2.x.x/''' directory.
#* Open a terminal and type, replacing the x's with the current version, the following to get into the correct directory:
+
** Open a terminal and type, replacing the x's with the current version, the following to get into the correct directory:
 
<source lang="bash">
 
<source lang="bash">
 
$ cd Downloads/scons-1.x.x
 
$ cd Downloads/scons-1.x.x
 
</source>
 
</source>
#* Then to be sure the correct Python version is being used, type:
+
** Then to be sure the correct Python version is being used, type:
 
<source lang="bash">
 
<source lang="bash">
 
$ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
 
$ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
 
</source>
 
</source>
#* This will install scons into '''/usr/local/bin/scons'''.
+
** This will install scons into '''/usr/local/bin/scons'''.
#* To compile the C modules, the minfx package must be installed first.  Please see below.
+
** To compile the C modules, the minfx package must be installed first.  Please see below.
  
  

Revision as of 16:01, 8 August 2013

Installing the relax dependencies

The python-devel and scons packages are only required if the C modules need to be compiled for your system.
The Grace software is used for visualisation of 2D data sets.

The official way

The most reliable way to install relax on your system is to use the official Python releases. The steps are:

  1. Python: First download the latest 2.7 version from the Official Python website.
    • This should be the DMG file labelled as Python 2.7.x Mac OS X 64-bit/32-bit x86-64/i386 Installer (for Mac OS X 10.6 and later).
    • Open the DMG file, double click on the Python.mpkg file, and follow the instructions.
    • The Python binary should now be located at /usr/local/bin/python. This is actually a symbolic link pointing to /Library/Frameworks/Python.framework/Versions/2.7/bin/python.
  1. wxPython: Download the wxPython Development 2.9 DMG file from the official wxPython website.
    • The link should be called wxPython2.9-osx-cocoa-py2.7.
    • Open the DMG file, double click on the wxPython2.9-osx-cocoa-py2.7.pkg file, and follow the instructions.
  1. Numpy: Download the latest Numpy DMG file from the sourceforge download site.
    • This should be the DMG file numpy-1.x.x-py2.7-python.org-macosx10.3.dmg.
    • Open the DMG file, double click on the numpy-1.x.x-py2.7.mpkg file, and follow the instructions.
  1. Scipy: Download the latest Scipy DMG file from the sourceforge download site.
    • This should be the DMG file scipy-0.xx.x-py2.7-python.org-macosx10.3.dmg.
    • Open the DMG file, double click on the scipy-0.xx.x-py2.7.mpkg file or equivalent, and follow the instructions.
  1. Mpi4py: This is for running on multi-processor machines, for the analyses in relax which support it. Download the file from the mpi4py download site.
    • Note, this will require an up to date version of XCode installed on your system, as the code will be compiled.
    • Download the file labelled as mpi4py-1.x.x.tar.gz.
    • Open this through the Finder to unpackage the archive into the ~/Downloads/mpi4py-1.x.x/ directory.
    • Open a terminal and type, replacing the x's with the current version, the following to get into the correct directory:
$ cd Downloads/mpi4py-1.x.x
    • Then to be sure the correct Python version is being used, type:
$ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
  1. SCons: This is required to build the relax C modules. Download the file form the SCons download site.
    • Download the file called scons-2.x.x.tar.gz.
    • Open this through the Finder to unpackage the archive into the ~/Downloads/scons-2.x.x/ directory.
    • Open a terminal and type, replacing the x's with the current version, the following to get into the correct directory:
$ cd Downloads/scons-1.x.x
    • Then to be sure the correct Python version is being used, type:
$ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
    • This will install scons into /usr/local/bin/scons.
    • To compile the C modules, the minfx package must be installed first. Please see below.


Now you will need to check that the correct Python and SCons versions are used when running relax or compiling the C modules. This can be checked by typing the following:

$ sudo /usr/libexec/locate.updatedb
$ which python
$ locate python | grep '\/python$\|\/python...$' | grep bin | xargs ls -alh
$ which scons
$ locate python | grep '\/python$\|\/python...$' | grep bin | xargs ls -alh

The first command updated the locate database, the which commands show which version of Python and SCons will be executed if python or scons are typed at the prompt, and the locate commands will show all installed versions of Python and SCons.


If you still have 'minfx' installation problems when compiling the C modules, you may also need open the /usr/local/bin/scons file and change the first line from /usr/bin/env python to /usr/local/bin/python so that it uses the correct Python version.

macports

Not explained yet. Please provide your solution, if you know it.

fink

Not explained yet. Please provide your solution, if you know it

homebrew

See this email thread.

Download and install Apple's Xcode. Install the "Command Line Tools" from inside Xcode. Install Homebrew by typing into your Terminal:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Install python 2.7 including pip package manager, scons for relaxation compiling and wxPython for a native Mac GUI:

brew install python scons wxmac

Install numpy via pip (don't install scipy, as it causes problems with scons!)

pip install numpy

Minfx and Bmrblib

Remember to check if there are newer versions of minfx and bmrblib.
The minfx and bmrblib libraries can be installed on all Linux systems by typing:

wget http://download.gna.org/minfx/minfx-1.0.5.tar.gz
tar -xzf minfx-1.0.5.tar.gz
cd minfx-1.0.5
python setup.py install
cd ..

wget http://download.gna.org/bmrblib/bmrblib-1.0.3.tar.gz
tar -xzf bmrblib-1.0.3.tar.gz
cd bmrblib-1.0.3
python setup.py install
cd ..

Note that if you have multiple Python versions, the correct one must be specified. It is best to use the full Python path, for example:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install

Testing the Python installation

Before installing relax, it is best to be sure that the Python modules are functional by importing them:

$ python
Python 2.6.6 (r266:84292, Oct 12 2012, 14:23:48)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2

>>> import wx
>>> wx.__file__
'...'

>>> import bmrblib
>>> bmrblib.__file__
'...'

>>> import minfx
>>> minfx.__file__
'...'

Checking out a relax branch

If you would like to play with relax branch rather than the main relax downloads, the Subversion program should first be installed.
You can see the different branches here.
First the relax sources can be checked out of the source code repository and the C modules compiled:

cd /usr/local/
svn co svn://svn.gna.org/svn/relax/branches/relax_disp relax_disp
cd relax_disp
scons

# Optional building of the user manual, if a LaTeX installation is available.
scons user_manual_pdf

If the svn command does not work, try:

svn co http://svn.gna.org/svn/relax/branches/relax_disp relax_disp


Add relax to path

cd /usr/local/bin
ln -s /usr/local/relax_disp/relax .

Restart the terminal, to load the new variables.

Start relax in GUI mode

relax -g

TEST INSTALLATION

After an installation you should really run an Installation_test

See also