Difference between revisions of "Installation mac"
(→Check out a relax branch: Transclusion of the {{historical svn}} template.) |
|||
(37 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | How to install relax on Mac OS X systems. | ||
+ | |||
== Installing the relax dependencies == | == Installing the relax dependencies == | ||
Line 4: | Line 6: | ||
The [http://plasma-gate.weizmann.ac.il/Grace/ Grace] software is used for visualisation of 2D data sets. | The [http://plasma-gate.weizmann.ac.il/Grace/ Grace] software is used for visualisation of 2D data sets. | ||
− | === The official | + | == The official way == |
+ | The most reliable way to install relax on your system is to use the official Python releases. The steps are: | ||
+ | |||
+ | === Python === | ||
+ | First check if you have the latest Python 2.7 installed, before installing the newest. Search in Spotlight for '''Terminal''', and write here | ||
+ | <source lang="bash"> | ||
+ | which python | ||
+ | python --version | ||
+ | </source> | ||
+ | If needed, download the latest 2.7 version from the [http://www.python.org/download/ Official Python website].<br> | ||
+ | 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)'''.<br> | ||
+ | Open the DMG file, double click on the '''Python.mpkg''' file, and follow the instructions.<br> | ||
+ | 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'''. | ||
+ | |||
+ | === Check out a relax branch === | ||
+ | {{historical svn}} | ||
+ | You can see the different relax branches [http://svn.gna.org/viewcvs/relax/ here.]. '''Subversion''' is necessary, and should be shipped with [ http://subversion.apache.org/packages.html#osx OS X]. | ||
+ | <source lang="bash"> | ||
+ | which svn | ||
+ | svn --version | ||
+ | cd $HOME/Downloads | ||
+ | </source> | ||
+ | To check out trunk using the subversion client, simply type: | ||
+ | <source lang="bash"> | ||
+ | svn co svn://svn.gna.org/svn/relax/trunk relax_trunk | ||
+ | </source> | ||
+ | If this svn command does not work, try: | ||
+ | <source lang="bash"> | ||
+ | svn co http://svn.gna.org/svn/relax/trunk relax_trunk | ||
+ | </source> | ||
+ | |||
+ | === SCons - building relax=== | ||
+ | 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'''. <br> | ||
+ | ** Open this through the Finder to unpackage the archive into the '''~/Downloads/scons-2.x.x/''' directory. <br> | ||
+ | ** Open a terminal and type, replacing the x's with the current version, the following to get into the correct directory: | ||
+ | <source lang="bash"> | ||
+ | cd $HOME/Downloads/scons-2.x.x | ||
+ | </source> | ||
+ | Then compile by: | ||
+ | <source lang="bash"> | ||
+ | sudo python setup.py install | ||
+ | </source> | ||
+ | If you have several Python versions, then compile with the wished python interpreter by typing: | ||
+ | <source lang="bash"> | ||
+ | sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install | ||
+ | </source> | ||
+ | This should install scons into '''/usr/local/bin/scons'''. <br> | ||
+ | <source lang="bash"> | ||
+ | which scons | ||
+ | </source> | ||
+ | |||
+ | === First try to build relax === | ||
+ | To compile the C modules in relax, several packages must be in place, including the minfx package.<br> | ||
+ | But we can just try to build relax now, and then solve the dependencies. | ||
+ | <source lang="bash"> | ||
+ | cd $HOME/Downloads/relax_trunk | ||
+ | # Then build | ||
+ | scons | ||
+ | </source> | ||
+ | You should get the message: '''The dependency 'minfx' has not been installed''' | ||
− | + | === Minfx and Bmrblib === | |
+ | |||
+ | # [[Minfx#Install | Minfx]] | ||
+ | # [[Bmrblib#Install | Bmrblib]] | ||
+ | |||
+ | Let's try to build again | ||
+ | <source lang="bash"> | ||
+ | cd $HOME/Downloads/relax_trunk | ||
+ | scons | ||
+ | </source> | ||
+ | If you get the message '''-bash: gcc: command not found''', you need to install [https://developer.apple.com/xcode/ Apple Xcode]. | ||
+ | |||
+ | === Numpy === | ||
+ | First check if you have numpy installed in the current python installation. | ||
+ | <source lang="bash"> | ||
+ | python | ||
+ | import numpy | ||
+ | numpy.__version__; numpy.__file__ | ||
+ | # Exit python with: Ctrl+d | ||
+ | </source> | ||
+ | If needed, download the latest Numpy DMG file from the [http://sourceforge.net/projects/numpy/files/NumPy/ sourceforge download site].<br> | ||
+ | This should be the DMG file '''numpy-1.x.x-py2.7-python.org-macosx10.x.dmg'''.<br> | ||
+ | Open the DMG file, double click on the '''numpy-1.x.x-py2.7.mpkg''' file, and follow the instructions. | ||
+ | |||
+ | === Scipy === | ||
+ | First check if you have scipy installed in the current python installation. | ||
+ | <source lang="bash"> | ||
+ | python | ||
+ | import scipy | ||
+ | scipy.__version__; scipy.__file__ | ||
+ | # Exit python with: Ctrl+d | ||
+ | </source> | ||
+ | If needed, download the latest Scipy DMG file from the [http://sourceforge.net/projects/scipy/files/scipy/ sourceforge download site].<br> | ||
+ | This should be the DMG file '''scipy-0.xx.x-py2.7-python.org-macosx10.3.dmg'''.<br> | ||
+ | Open the DMG file, double click on the '''scipy-0.xx.x-py2.7.mpkg''' file or equivalent, and follow the instructions. | ||
+ | |||
+ | === wxPython === | ||
+ | First check if you have wxPzthon installed in the current python installation. | ||
+ | <source lang="bash"> | ||
+ | python | ||
+ | import wx | ||
+ | wx.__version__; wx.__file__ | ||
+ | # Exit python with: Ctrl+d | ||
+ | </source> | ||
+ | If needed, download the wxPython Development 2.9 DMG file from the [http://wxpython.org/download.php#unstable official wxPython website].<br> | ||
+ | The link should be called '''wxPython2.9-osx-cocoa-py2.7'''.<br> | ||
+ | Open the DMG file, double click on the '''wxPython2.9-osx-cocoa-py2.7.pkg''' file, and follow the instructions. | ||
− | + | === Mpi4py === | |
− | + | {{note|This will require an up to date version of XCode installed on your system, as the code will be compiled.}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | This is for running on multi-processor machines, for the analyses in relax which support it. | |
− | + | # [[Mpi4py#Install | Mpi4py]] | |
− | |||
<source lang="bash"> | <source lang="bash"> | ||
− | $ sudo / | + | $ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install |
− | |||
− | |||
− | |||
− | |||
</source> | </source> | ||
− | + | ||
+ | == Use of repositories == | ||
=== macports === | === macports === | ||
Line 87: | Line 145: | ||
pip install numpy | pip install numpy | ||
− | == Minfx and Bmrblib == | + | === Minfx and Bmrblib === |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | # [[Minfx#Install | Minfx]] | |
− | + | # [[Bmrblib#Install | Bmrblib]] | |
− | |||
− | |||
− | |||
− | |||
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: | 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: | ||
Line 119: | Line 164: | ||
>>> import wx | >>> import wx | ||
− | >>> wx.__file__ | + | >>> wx.__version__; wx.__file__ |
'...' | '...' | ||
>>> import bmrblib | >>> import bmrblib | ||
− | >>> bmrblib.__file__ | + | >>> bmrblib.__version__; bmrblib.__file__ |
'...' | '...' | ||
>>> import minfx | >>> import minfx | ||
− | >>> minfx.__file__ | + | >>> minfx.__version__; minfx.__file__ |
'...' | '...' | ||
</source> | </source> | ||
− | == | + | == Test Installation == |
− | + | {{tip|After an installation you should really run an [[Installation_test]]}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Trouble shooting == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | === Multiple Python versions === | ||
+ | For more details, see [[Multiple Python versions]]. | ||
− | + | 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: | |
<source lang="bash"> | <source lang="bash"> | ||
− | + | $ sudo /usr/libexec/locate.updatedb | |
− | + | $ which python | |
− | + | $ locate python | grep '\/python$\|\/python...$' | grep bin | xargs ls -alh | |
− | + | $ which scons | |
− | + | $ locate scons | grep '\/scons$' | grep bin | xargs ls -alh | |
− | |||
− | |||
− | |||
</source> | </source> | ||
+ | The first command updates 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. | ||
− | + | You may still have 'minfx' installation problems when compiling the C modules if multiple Python version are present. <br> | |
− | + | So it is recommended to open the '''/usr/local/bin/scons''' file and change the first line from '''/usr/bin/env python''' to '''/usr/local/bin/python''' so that the correct Python version is used.<br> | |
+ | Alternatively you change your PATH environmental variable to have '''/usr/local/bin/''' at the start. SCons is always an issue when multiple Python versions are installed. | ||
== See also == | == See also == | ||
[[Category:Installation]] | [[Category:Installation]] |
Latest revision as of 11:49, 27 October 2017
How to install relax on Mac OS X systems.
Contents
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:
Python
First check if you have the latest Python 2.7 installed, before installing the newest. Search in Spotlight for Terminal, and write here
which python
python --version
If needed, 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.
Check out a relax branch
Caution The information in this section is out of date but is kept for historical reasons. The relax source code is now hosted in a git rather than svn repository. |
You can see the different relax branches here.. Subversion is necessary, and should be shipped with [ http://subversion.apache.org/packages.html#osx OS X].
which svn
svn --version
cd $HOME/Downloads
To check out trunk using the subversion client, simply type:
svn co svn://svn.gna.org/svn/relax/trunk relax_trunk
If this svn command does not work, try:
svn co http://svn.gna.org/svn/relax/trunk relax_trunk
SCons - building relax
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:
- Download the file called scons-2.x.x.tar.gz.
cd $HOME/Downloads/scons-2.x.x
Then compile by:
sudo python setup.py install
If you have several Python versions, then compile with the wished python interpreter by typing:
sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
This should install scons into /usr/local/bin/scons.
which scons
First try to build relax
To compile the C modules in relax, several packages must be in place, including the minfx package.
But we can just try to build relax now, and then solve the dependencies.
cd $HOME/Downloads/relax_trunk
# Then build
scons
You should get the message: The dependency 'minfx' has not been installed
Minfx and Bmrblib
Let's try to build again
cd $HOME/Downloads/relax_trunk
scons
If you get the message -bash: gcc: command not found, you need to install Apple Xcode.
Numpy
First check if you have numpy installed in the current python installation.
python
import numpy
numpy.__version__; numpy.__file__
# Exit python with: Ctrl+d
If needed, 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.x.dmg.
Open the DMG file, double click on the numpy-1.x.x-py2.7.mpkg file, and follow the instructions.
Scipy
First check if you have scipy installed in the current python installation.
python
import scipy
scipy.__version__; scipy.__file__
# Exit python with: Ctrl+d
If needed, 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.
wxPython
First check if you have wxPzthon installed in the current python installation.
python
import wx
wx.__version__; wx.__file__
# Exit python with: Ctrl+d
If needed, 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.
Mpi4py
Note This will require an up to date version of XCode installed on your system, as the code will be compiled. |
This is for running on multi-processor machines, for the analyses in relax which support it.
$ sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
Use of repositories
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
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.__version__; wx.__file__
'...'
>>> import bmrblib
>>> bmrblib.__version__; bmrblib.__file__
'...'
>>> import minfx
>>> minfx.__version__; minfx.__file__
'...'
Test Installation
Tip After an installation you should really run an Installation_test |
Trouble shooting
Multiple Python versions
For more details, see Multiple Python versions.
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 scons | grep '\/scons$' | grep bin | xargs ls -alh
The first command updates 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.
You may still have 'minfx' installation problems when compiling the C modules if multiple Python version are present.
So it is recommended to open the /usr/local/bin/scons file and change the first line from /usr/bin/env python to /usr/local/bin/python so that the correct Python version is used.
Alternatively you change your PATH environmental variable to have /usr/local/bin/ at the start. SCons is always an issue when multiple Python versions are installed.