AFLOW Installation and Source Code
Preparing the AFLOW Installation
MacOS
AFLOW requires xcode
to compile. xcode
can be installed from the App Store.
Windows
AFLOW does not run natively on Windows. However, it is possible to run AFLOW on a Windows machine using emulators.
Ubuntu/Debian for Windows (Windows 10)
- Open
Windows PowerShell
with Administrator rights (right-click → Run as administrator). - Execute the command
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
. - Restart the computer.
- Install
Ubuntu 20.04 LTS
orDebian
from the Microsoft Store and launch it. Follow the instructions to finish the setup.
Cygwin (Windows 7/8/8.1)
- Download Cygwin.
- Run the installer until you get to "Select Your Internet Connection" and choose "Direct Connection". On the next screen, choose any server to continue.
- Continue until you reach the "Select Packages" screen. Select the package
wget
. You also need to select a text editor such asvim
,emacs
, ornano
. - Click "Next" to install.
Installing AFLOW
Installing AFLOW is fully automated and should not require user intervention besides entering passwords and answering prompts. Please read this entire section carefully before running the installation script.
Running the Installation Script
- Open a terminal (Linux, Mac), Ubuntu or Debian for Windows (Windows 10), or Cygwin (other Windows).
- Run the command
wget http://aflow.org/install-aflow/install-aflow.sh
orcurl http://aflow.org/install-aflow/install-aflow.sh -o install-aflow.sh
(Mac) to download the installation script. - Make the script executable with
chmod 555 install-aflow.sh
. - Use
./install-aflow.sh
to start the installation. - Follow the prompts on the screen if necessary. You may be asked for your password and/or confirm the installation of additional packages.
Note that some packages required for plotting (such as texlive) are very large. To install AFLOW without plotting capabilities, run ./install-aflow.sh --slim
.
The AFLOW binaries will be installed into ~/bin
and the AFLOW source code will be downloaded and stored into ~/src/AFLOW
. If ~/src/AFLOW
already exists, it will be overwritten in the process. See Customizing the AFLOW Installation to change these locations.
Linux users: Root privileges are required if packages are missing. The installation script was tested on Debian, *Ubuntu, Arch, and Fedora. It will not run on other Linux flavors. For the other flavors, AFLOW will need to be compiled from source.
Mac users: If a required package is not found, the script will use homebrew to install them. If homebrew is not present, it will try to install it first.
Windows 10 users: There will be multiple prompts about installing packages and restarting services. They can all be answered with yes. After installing the required packages, you may be asked to enter your password again.
Installing Python Packages
The script can install a python3 virtual environment into ~/virtualenv
along with all AFLOW python modules. To do this, run ./install-aflow.sh --venv
(can be combined with --slim
). See Customizing the AFLOW Installation to change the location of the virtual environment or to use an already existing one.
If you do not wish to use a virtual environment at all, run the script without --venv and use the file aflow_python_packages.txt to install the missing prerequisites. This file can also be generated by calling install-aflow.sh --pip_modules
. Then, run aflow --python_modules -D modules_path
where modules_path
is the path in which the modules are installed. To make the modules globally available, modules_path
should point to the site-packages or dist-packages directory.
Cygwin users: The script will not install a virtual Python environment because of issues with compiling jupyter. However, --venv
can still be used to install the Python modules. The installation of numpy may require a restart of the Cygwin terminal.
Customizing the AFLOW Installation
The following parameters can be customized:
- The AFLOW source code location can be changed by adding
--compile_dir=desired_path
to theinstall-aflow.sh
command. Default is~/src/AFLOW/
. Note that this directory will be completely overwritten upon installation. - The AFLOW binary location can be changed by adding
--install_dir=desired_path
to theinstall-aflow.sh
command. Default is~/bin/
. - The location of the Python virtual environment can be changed by adding
--venv=desired_path
to theinstall-aflow.sh
command. Default is~/virtualenv
. If a virtual environment is already present in that path, the existing environment will be used instead.
Upgrading AFLOW to the Newest Version
To upgrade AFLOW, simply run xaflow
. It will automatically download and compile the newest version. The parameter install_dir
should be the same as for the initial installation.
AFLOW Source Code
AFLOW can also be compiled from source. A helper script to download and compile the newest version is also available. To use it:
- Download xaflow.
- Make the script executable using
chmod 555 xaflow
. - Run
xaflow
. This will download AFLOW into~/src/AFLOW/
. To change the location, runxaflow AWD=PATH
where PATH is the path to the desired source code location. Note that this will overwrite the directory. - Run
xaflow install
. This will install the aflow binaries into~/bin/
. To change the location, runxaflow install ULB=PATH
where PATH is the path to the desired binary location.
Older versions of AFLOW can be found at materials.duke.edu/AFLOW/.