1.1. How to install SPEX

1.1.1. Download

SPEX install files can be downloaded from our Zenodo page.

We provide several options for installing SPEX. They all have their own install file:

Download type

Linux

Mac OS

Binary (Administrator)

SPEX-3.06.01-MacOS.dmg

Binary (Non-Administrator)

SPEX-3.06.01-Linux-x86_64.tar.gz

SPEX-3.06.01-MacOS.tar.gz

Windows 10

SPEX Ubuntu 20.04 gfortran

Source code

SPEX-3.06.01-Source.tar.bz2

Docker image

SPEX-3.06.01-Docker.tar.gz

1.1.2. Linux

Unpack the tar file in the destination directory (for example /usr/local/):

tar xvfz spex-3.06.01-Linux-x86_64.tar.gz

The tar file will create a directory called SPEX-3.05.00-Linux in which the program will be installed.

Set the environment variable SPEX90 to the installation directory (for example /usr/local/SPEX-3.06.01-Linux):

export SPEX90=/usr/local/SPEX-3.06.01-Linux (bash shell)
setenv SPEX90 /usr/local/SPEX-3.06.01-Linux (C-type shell)

Source the script provided by the distribution:

source $SPEX90/spexdist.sh (bash shell)
source $SPEX90/spexdist.csh (C-type shell)

Remove the tar file: rm SPEX-3.06.01-Linux-x86_64.tar.gz

Note

In some cases the csh script fails because either PATH, LD_LIBRARY_PATH or PYTHONPATH are not defined. This can be temporarily fixed by defining an empty variable using setenv, for example: setenv PATH "" and run the script again. This will be fixed in the next SPEX release.

1.1.3. Mac OS

1.1.3.1. Administrator install

If you have administrator rights on your Mac, this option is the easiest one. Download the DMG file from Zenodo (SPEX-3.06.01-MacOS.dmg), open it in Mac OS and follow the instructions on the screen.

MacOS may complain about not being able to verify the developer of the software. Please close this dialog and go to the MacOS System Preferences >> Security & Privacy. In that dialog, you are offered to open the SPEX package anyway. Accept the offer and make sure the SPEX package is unblocked. Now, you can open the SPEX DMG installer again and proceed with the installation.

1.1.3.2. Non-administrator install

Unpack the tar file in the destination directory (for example /usr/local/):

tar xvfz spex-3.06.01-MacOS.tar.gz

The tar file will create a directory called SPEX-3.06.01-Darwin in which the program will be installed.

Set the environment variable SPEX90 to the installation directory (for example /usr/local/SPEX-3.06.01-Darwin):

export SPEX90=/usr/local/SPEX-3.06.01-Darwin (bash shell)
setenv SPEX90 /usr/local/SPEX-3.06.01-Darwin (C-type shell)

Source the script provided by the distribution:

source $SPEX90/spexdist.sh (bash shell)
source $SPEX90/spexdist.csh (C-type shell)

Remove the tar file: rm SPEX-3.06.01-MacOS.tar.gz

Note

In some cases the csh script fails because either PATH, DYLD_LIBRARY_PATH or PYTHONPATH are not defined. This can be temporarily fixed by defining an empty variable using setenv, for example: setenv PATH "" and run the script again. This will be fixed in the next SPEX release.

1.1.4. Windows 10

SPEX can be installed in Windows 10 using the new linux subsystem in Windows. SPEX can run in an Ubuntu Linux environment that can be installed through the Microsoft Store.

How to install Ubuntu in Windows 10

In addition to the Ubuntu terminal, you also need a graphical X server. We recommend the Vcxsrv server. Otherwise, the XMING server is an alternative. This will make sure that you can plot in SPEX.

1.1.4.1. Install SPEX in the Ubuntu environment

  1. On the Ubuntu terminal, first install the OpenBlas library: apt-get install libopenblas-base

  2. Download SPEX-3.06.01-Ubuntu20.04-gfortran.tar.gz from our FTP server. This file is not (yet) available on Zenodo. Unpack the tar file in the destination directory (for example /usr/local/):

    tar xvfz spex-3.06.01-Ubuntu20.04-gfortran.tar.gz
    

    The tar file will create a directory called SPEX-3.06.01-Linux in which the program will be installed.

  3. Set the environment variable SPEX90 to the installation directory (for example /usr/local/SPEX-3.06.01-Linux):

    export SPEX90=/usr/local/SPEX-3.06.01-Linux (bash shell)
    setenv SPEX90 /usr/local/SPEX-3.06.01-Linux (C-type shell)
    
  4. Source the script provided by the distribution:

    source $SPEX90/spexdist.sh (bash shell)
    source $SPEX90/spexdist.csh (C-type shell)
    
  5. Remove the tar file: rm spex-3.06.01-Ubuntu20.04-gfortran.tar.gz

  6. Set the DISPLAY variable in ~/.bashrc:

    echo "export DISPLAY=localhost:0.0" >> ~/.bashrc
    . ~/.bashrc
    
  7. Run SPEX:

    spex
    

If you get an error about a missing library when running SPEX, please run the following command:

sudo apt-get install libopenblas-base libreadline8 libncurses5 x11-common libx11-6 gfortran

The command above makes sure that all the packages that SPEX needs are installed.

The latest Ubuntu build also contains the python interface. To use it, make sure to install:

sudo apt-get install python3-numpy python3-matplotlib python3-future