wiki:InstallLinux-prev

Version 4 (modified by toby, 11 years ago) (diff)

--

Installing GSAS-II on Linux systems

To date we have done a bit of testing with Linux, but there are a lot of different Linux releases out there and we don't have a lot of experience yet. (Contributions to this page are welcome).

Overview

Before you can install or use GSAS-II you will need two software packages installed: python and subversion. Installation of subversion is usually trivial with the distributed package managers, but python may be more complex, since we require several additional Python packages for GSAS-II. Instructions are provided below for Ubuntu on how to do this. An alternative to this is to install a package with Python and a bunch of commonly needed packages. We are recommending the Free Enthought Python Distribution (EPD Free), but we develop ourselves using the commercially supported version, the Enthought Python Distribution (EPD). Alternative to this include Python(x,y) or ActiveState ActivePython. We simply have not tried the latter two.

Simplified Installation

  1. Install subversion
  1. Install Python and required packages
  1. Create a directory where GSAS-II will be installed
  1. Download the installation script (bootstrap.py) by using this URL:

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

or by using this command:

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

  1. Move the bootstrap.py file into the directory where GSAS-II will be installed
  1. Run the bootstrap.py script using the python package you have installed with command

<path1>python <path2>bootstrap.py

Where <path1> is the location where python has been installed (may be omitted if in your path) and <path2> is the directory you created for GSAS-II

  1. The installation script will attempt to create a desktop icon for running GSAS-II, but this may not be appropriate for your linux configuration. If you want to create a shortcut, have it run <path1>python <path2>GSASII.py where the paths are defined as in step 6, above.

Note there are many other ways that python & GSAS-II can be installed, etc., depending on how well you understand the process. The above steps are simply a suggestion.

Compiling Fortran Code

Normally you will not need to do this, since GSAS-II comes with Linux binaries, but if you are a source-code purist or your system is unusually configured you may find that the binaries we provide do not work for you. In this case follow the next paragraph for building the binaries:

GSAS-II requires a small number of Fortran routines that are incorporated as Python packages (.so files). You will need the NumPy f2py routine and the compiler of your choice to build the code yourself. Both G77 (32-bit Python only) and GFortran have been successful on the platforms we have tried. 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 window,

(2) use the cd command to set your working directory to <path2>/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.

Ubuntu Install

from Dr. Thomas Malcherek (July 25, 2012)

Getting GSAS-II to run on a Linux Ubuntu installation (12.04 LTS) was actually quite simple and did not require the EPD packages. I had to install the following packages using apt-get:

python-scipy

python-wxgtk2.8

python-wxtools

wx2.8-i18n

python-opengl

Optional steps:

install scons with apt-get and recompile the fortran modules using that scons command

The latest WX packages can be obtained from apt.wxwidgets.org after adding their repository to /etc/apt/sources.list