Version 21 (modified by toby, 7 years ago) (diff) |
---|
Installing GSAS-II on Mac OS X
Try this First: A new single-step installer has been developed for GSAS-II on Macs. Please try this first using the instructions here? and report any problems.
Detailed installation information
Prerequisite: Before GSAS-II can be used on your computer, you must have Python 2.7.x installed with a number of required Python packages (see below.)
GSAS-II has been tested by us on Intel (i386) Macs running 10.5-10.11. Getting GSAS-II to run on Macs running 10.4 or with a PPC (G4/G5) processor is likely possible, but will require considerable work since you would need to build Python and its packages from source code and compile the GSAS-II Fortran code; this is not recommended except to the cognoscenti.
10.9 Users, please see these notes (probably appropriate for 10.8, too) before reading farther.
Overview for Step-by-step Installation
Note that we are now recommending the new procedure here? rather than the instructions below.
- We have made extensive use of the older 32-bit EPDfree Python distribution; download the EPDfree 32-bit Mac installer from web page https://www.enthought.com/repo/free/.) Alternates are the 64-bit Canopy Express from Enthought downloads and Anaconda from Continuum. Be sure to download Python 2.7. GSAS-II does not yet support Python 3.x. At present, both EPDfree and Canopy Express require administrator privileges to install.
- (For 10.7 or earlier, skip this step.) Install Subversion, if running Mountain Lion (OS X 10.8+) or later type svn in at a terminal window to get a prompt from OS X to download and install this directly from Apple.
- Download file bootstrap.py file from https://subversion.xray.aps.anl.gov/trac/pyGSAS/browser/install/bootstrap.py?format=txt and move it to the location where you want GSAS-II to be installed.
- Start a terminal window and run the previous file by typing <path1>python <path2>bootstrap.py, where <path1> is the location where the full python has been loaded. If you are not sure, you can type python on a line by itself and see if you are running EPD python. <path2>` will be where you have installed the bootstrap.py file. Simply clicking on that file might work.
- Run GSAS-II with the GSASII.app file created by the bootstrap procedure.
Background Information on Installation
Python
Python is a computer scripting language, which means that one must have the Python interpreter installed on your Mac to run a Python program. Macs do come with python installed, but not with all the Python packages required by GSAS-II, so some Python software installation is required. You must use a 2.7 version of Python. GSAS-II will not run under Python 3.x. Note that we are seeing some minor GUI bugs with wxPython 2.9 and later, which is the first Mac release to support 64-bit Python. Please report them.
We mostly use the Enthought Python Distribution (EPD) package for our code development, but most users seem to be using Continuum Inc's Anaconda Python package (Note: be sure to use the Python 2.7 version) and do some testing with that. We have also done just a bit of testing with Enthought's newer product, Canopy. The free versions of EPD and Canopy packages will run GSAS-II, with addition of one small package that is self-installed (see below). While OS X does come with installed versions of Python, they are pretty old and do not contain all the packages GSAS-II needs, so adding the missing packages is probably not a good idea. Use of the Fink or DarwinPorts versions of Python is also not the best choice -- the GUI and graphics will be shown in X-windows rather than in Mac style.
Note that at this time, Python 2.7 is recommended and probably required for GSAS-II. GSAS-II does not yet support Python 3.0+.
- See Continuum Inc's web page to download and install Anaconda Python. You will need to use the conda command to download wxpython and possibly other packages.
- The freely distributed Enthought Canopy Express Python package and its precursor, the older EPDfree 32-bit Mac installer, provides everything one needs to run GSAS-II, except the interface needed for OpenGL graphics (PyOpenGL) which is distributed with GSAS-II; GSAS-II will attempt to install this package for you when first started. The paid subscription versions of Canopy/EPD do contain this package and also work fine.
To get Canopy Express, use the "Get Canopy Express" button on http://www.enthought.com/downloads. See these notes for installation details.
For EPD free use the older EPDfree 32-bit Mac installer from web page https://www.enthought.com/repo/free/. Installation of EPD free from the .dmg is easy: click on the file to open it (that might happen automatically when you download it). In that new volume, you will see the EPD_free.mpkg installer. Click on that to start the installation process. It works best to run this from the account where you will run GSAS-II and supply the name of the admin account and its password when requested, as this will cause your login shell setup file to be updated so that directory /Library/Frameworks/Python.framework/Versions/Current/bin is in your path. (This is done by adding lines like this to file ~/.profile:
# Setting PATH for EPD-7.2-2 PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" export PATH
Note on OS X 10.9 (and perhaps with prior versions), when first starting GSAS-II under EPD free, one will get a warning "to open fc-list, you need to install X11..." you can ignore that warning and press Cancel. (This warning occurred twice for me.) It then seems to go away.
- ActiveState ActivePython is a possible alternative to EPD. This is also commercial licensed software, where there is a free version with no support. We have not tried this yet. If it works for you, please let us know.
Subversion
If you are running 10.7 (Lion) or earlier, skip this step. For 10.8 (Mountain Lion) you must install the subversion (svn) package. To do this, type svn in a terminal window.
Alternately, install one of the following: Apple's Command Line Tools, or Apple's Xcode development environment, a 3rd party SVN package, or build from source code, see http://subversion.apache.org/download/. The Command Line Tools and Xcode can be downloaded from the Apple Developer's web site (https://developer.apple.com/) or can possibly be found on the OS X install DVD. A free 3rd party version of Subversion from WANdisco is here: http://www.wandisco.com/get/?f=subversion-binaries/1.7/Subversion-1.7.7_10.8.x.pkg.
GSAS-II Installation
We prefer that GSAS-II be installed using subversion so that it is easy to get updates (which are frequent). Fortunately, with OS X 10.5, 10.6 or 10.7, Macs come with subversion installed. (10.8 see above.) This procedure loads GSAS-II using subversion:
- Create a folder where you want to install GSAS-II.
- Download file bootstrap.py file using this link:
https://subversion.xray.aps.anl.gov/trac/pyGSAS/browser/install/bootstrap.py?format=txt
or use this command:
curl https://subversion.xray.aps.anl.gov/pyGSAS/install/bootstrap.py > bootstrap.py
- Move the bootstrap.py file into the newly created GSAS-II folder
- Run the bootstrap.py file by double-clicking on it or using the command <path>python <path>bootstrap.py
- This creates a GSAS-II.app file that can be used to start GSAS-II either by clicking on the app or by dragging a file onto the app. Note that the app file can be dragged to the doc, but it cannot be moved to another folder. Instead, create an alias and move the alias where desired.
Note that GSAS-II can be updated at any time by reusing the bootstrap.py file. This will download any newly created and modify any updated program files.
Updated GSAS-II.app
As of GSAS-II version 983 (July 7, 2013), a new app builder is used. This can be rerun using the supplied makeMacApp.py file manually (be sure to use the Python needed for GSAS-II with a command like <path>python <path>makeMacApp.py)
Compiling Fortran Code
Please skip this step, unless you have an older computer running OS X 10.4 or a PPC (G4, etc.) CPU or are not using Python 2.7.
GSAS-II requires a small number of Fortran routines that are incorporated as Python packages (.so files). If you use Python 2.7 and OS X 10.5 and 10.6+, GSAS-II should run with distributed files. If you are using less common options, you may need to compile the Fortran routines yourself using the NumPy f2py routine and the compiler of your choice. Both G77 and GFortran have worked on the Mac.
To help with compiling the programs, use the python scons routine inside the GSASII/fsource directory. If you are lucky, this routine will find the needed compiler and python program, set all options correctly for you and run all steps needed to prepare the .so files. This is done by
(1) opening a Terminal or xterm window,
(2) using the cd command to set your working directory to .../GSASII/fsource and
(3) simply typing "scons" in the window.
If you need to change any options, type "scons help" to see a list of the possible command-line arguments and the values for the options. For testing, help can be used with command-line options to see how they will change the variables.
If you can help expand any of these instructions, discover new mechanisms for installing Python, or have problems getting this to work, please let me know.
Attachments (2)
- EPDerror.png (125.6 KB) - added by toby 9 years ago.
-
svn.png
(102.6 KB) -
added by toby 3 years ago.
OS X message to install subversion
Download all attachments as: .zip