Spglib is a C library for finding and handling crystal symmetries.
Unzip, configure, and make:
% tar xvfz spglib-1.4.tar.gz % cd spglib-1.4 % ./configure % make
Copy the libraries where you want using OpenMP. The libraries may be in src/.libs if you don’t make install,
Bottle neck of symmetry operation search may be eased using the OpenMP threading. In the case of gcc (> 4.2), set the following environment variables before running configure script:
% export LIBS='-lgomp' % export CFLAGS='-fopenmp'
Overhead of threading is relatively large when the number of atoms is small. Therefore the threading is activated when the number of atoms >= 1000.
A few examples are stored in example directory. The fortran interface
The ruby code symPoscar.rb in test directory reads a VASP POSCAR formatted file and finds the space-group type. The -l option refines a slightly distorted structure within tolerance spacified with the -s option. The -o option gives the symmetry operations of the input structure.
ruby symPoscar.rb POSCAR -s 0.1 -o -l
How to compile is found in the README file.
Python extension for ASE is prepared in the python/ase directory. See http://spglib.sourceforge.net/pyspglibForASE/
Fortran interface spglib_f08.f90 is found in example directory. This fortran interface is the contribution from Dimitar Pashov. The older versions of gfortran may have compilation problem, and may be solved by applying a patch. See http://sourceforge.net/p/spglib/mailman/message/32181136/. spglib_f.c is obsolete and is not recommended to use.
For questions, bug reports, and comments, please visit following mailing list:
Spglib project acknowledges Yusuke Seto for the Crystallographic database and Dimitar Pashov for the fortran interface.