A note on versions…

Installation of XtalOpt itself is a trivial task once the proper dependencies are in place. XtalOpt requires development versions of several other packages -- If a development package is specifed below, do not try to use non-development versions; they will not work. The instructions on this page walk through the steps of installing XtalOpt on your Linux system.


Dependencies

"Easy" Dependencies

The following dependencies can be installed from the package manager of most linux distributions:

  • cmake (and optionally the ncurses GUI, ccmake) >= 2.6
  • Qt >= 4.6.0
  • Eigen >= 2
  • git, any version
  • svn, or subversion, any version

Source Dependencies

The following must be built from the development sources:

Remember to uninstall any non-development installations of OpenBabel and Avogadro before installing the development versions.


Instructions

"Easy" Dependencies

Using the package manager for your linux distribution, install the dependencies listed above. For example, on Arch Linux, one can use the command

pacman -S cmake qt eigen git subversion openssh

Source Installations


OpenBabel

First, the development version of OpenBabel must be installed from source. These instructions will build and install the packages in your user's $HOME directory.

Remember to uninstall any non-development installations of OpenBabel and Avogadro before installing the development versions.

Change to your users home directory:

cd ~

Make a directory to hold the source code and then enter it:

mkdir src
cd src

Check out the OpenBabel trunk sources:

svn co https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk openbabel-trunk

Once the above command completes, make a build subdirectory and enter it:

mkdir openbabel-trunk/build
cd openbabel-trunk/build

Configure OpenBabel:

cmake .. -DCMAKE_INSTALL_PREFIX=$HOME

Compile and install:

make -j3
make install

Note: If for some reason OpenBabel fails to build, try the following:

cd ..
svn up -r r4474
cd build

and then perform the make steps again. If it still fails, see the troubleshooting section.


OpenBabel should now be installed.


Avogadro

Next, Avogadro must be installed. The dlonie GitHub fork of Avogadro is used below, and is recommended to ensure that XtalOpt and Avogadro work together.

Remember to uninstall any non-development installations of OpenBabel and Avogadro before installing the development versions.

First, change to the source directory created earlier:

cd $HOME/src

Check out the dlonie Avogadro branch from GitHub:

git clone git://github.com/dlonie/avogadro.git avogadro

Just like with OpenBabel, make a build directory and enter it:

mkdir avogadro/build
cd avogadro/build

Configure, build, and install Avogadro:

cmake .. -DOPENBABEL2_INCLUDE_DIR=$HOME/include/openbabel-2.0 -DOPENBABEL2_LIBRARIES=$HOME/lib/libopenbabel.so \
  -DOPENBABEL2_VERSION_MET=true -DOPENBABEL_IS_NEWER_THAN_2_2_99=true -DENABLE_PYTHON=false -DCMAKE_INSTALL_PREFIX=$HOME
make -j3
make install

You now have a working avogadro executable at $HOME/bin/avogadro.


XtalOpt

Installing XtalOpt from source is very similar to installing OpenBabel and Avogadro. Once again, change to your source directory:

cd $HOME/src

Check out the stable branch of the XtalOpt sources:

git clone -b stable git://github.com/dlonie/XtalOpt.git xtalopt

Make a build directory and enter it:

mkdir xtalopt/build
cd xtalopt/build

Configure, build, and install:

cmake .. -DOPENBABEL2_INCLUDE_DIR=$HOME/include/openbabel-2.0 -DOPENBABEL2_LIBRARIES=$HOME/lib/libopenbabel.so \
  -DOPENBABEL2_VERSION_MET=true -DOPENBABEL_IS_NEWER_THAN_2_2_99=true -DCMAKE_INSTALL_PREFIX=$HOME
make -j3
make install

Note: if you see errors like

/usr/bin/ld: cannot find -lbsdyengine
/usr/bin/ld: cannot find -lnavigatetool
/usr/bin/ld: cannot find -lelementcolor

during the compiliation, follow the instructions here.

XtalOpt is now installed.

Test the installation

To use XtalOpt, you need to run the avogadro executable installed above. There are two ways to do this:

  1. Run $HOME/bin/avogadro from a terminal, or
  2. Add $HOME/bin to your $PATH environment variable and then just run avogadro.

Once Avogadro is running, check for "Crystal Optimization..." in the Extensions menu. If you see it, the installation completed successfully.

Troubleshooting