wiki:InstallMacHardWay

Version 6 (modified by toby, 10 years ago) (diff)

--

Installing GSAS-II on Mac OS X

Prerequisite: Before GSAS-II can be used on your computer, you must have python installed with a number of required Python packages (see below.)

GSAS-II has only been run on Intel (i386) Macs running 10.5 (Leopard) and 10.6 (Snow Leopard). We expect no problems with 10.7 (Lion) or 10.8 (Mountain Lion). Getting GSAS-II to run on 10.4 or PPC (G4/G5) Macs is likely possible, but will require considerable work since you would need to build python and its packages from source code, subversion and compile the GSAS-II Fortran code; this is not recommended except to the cognoscenti.

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 come with python installed, but not with all the Python packages required by GSAS-II that are not distributed within Python, so some software installation is required. Note the required WxPython package at present runs only in 32-bit python on Macs.

We use the Enthought Python Distribution (EPD) package for our code development (Argonne has a site license). We have done some testing with a free version of this package, called EPDFree that will run GSAS-II with addition of one small package (see below). Note that the versions of python supplied with OS X seem pretty old, 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 for GSAS-II; older versions of Python (particularly 2.5 or earlier) may not work. GSAS-II does not yet support Python 3.0+.

  • The freely distributed EPDFree package provides everything one needs to run GSAS-II, except the interface needed for OpenGL graphics (PyOpenGL) which can be added. GSAS-II will attempt to install this package for you when first started. EPDFree for the Mac is a ~72Mb .dmg file that requires admin privs to install. Installation 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
    
  • 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.

Compiling Fortran Code

You can probably skip this step: GSAS-II requires a small number of Fortran routines that are incorporated as Python packages (.so files). GSAS-II is distributed with these files compiled for Python 2.7 and Mac OS X 10.5 and 10.6+, but if you are using something that does not match this, 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.

Installation

We prefer that GSAS-II be installed using subversion so that it is easy to get updates (which are frequent). Fortunately, since 10.5, Macs come with subversion installed. This procedure loads GSAS-II using subversion:

  1. Create a folder where you want to install GSAS-II.
  1. Download file bootstrap.py file using this link:

https://subversion.xor.aps.anl.gov/trac/pyGSAS/browser/install/bootstrap.py?format=txt

or use this command:

curl https://subversion.xor.aps.anl.gov/pyGSAS/install/bootstrap.py > bootstrap.py

  1. Move the bootstrap.py file into the newly created GSAS-II folder
  1. Run the bootstrap.py file by double-clicking on it or using the command "python bootstrap.py"
  1. This creates a GSASII.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.

Errors from GSASII.app

The error messages from the GSASII.app are placed in a file named GSASIIerrors in the user's home directory


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)

Download all attachments as: .zip