Skip to content
SPAGeDi: Spatial Pattern Analysis of Genetic Diversity
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


SPAGeDi: Spatial Pattern Analysis of Genetic Diversity
Copyright © 2002–2009 Olivier Hardy ( and Xavier Vekemans

Portable/Unix source code maintained by Reed A. Cartwright (



This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see


Hardy OJ & Vekemans X (2002) SPAGeDi: a versatile computer program to analyse spatial genetic structure at the individual or population levels. Molecular Ecology Notes 2: 618–620.

Nota Bene

SPAGeDi has been tested on several data sets and results were checked for consistency with alternative softwares whenever possible. It may nevertheless still contain bugs (corrected bugs are listed at the end of the manual). Some of these bugs are probably easy to detect by causing the program to crash or leading to obvious erroneous results for particular data sets and analyses. But others, more critical, may just cause biased results that appear plausible. Hence, it is advised to take much care checking the consistency of the information from the results file. The authors would appreciate being informed of any detected bug. The authors claim no responsibility if or whenever a bug causes a misinterpretation of the results given by SPAGeDi.

Using SPAGeDi

See manual.pdf for detailed instructions on using SPAGeDi.

Downloading and Installing

Source code for SPAGeDi can be downloaded from

Compiling from Source Code

SPAGeDi requires CMake ( to build it from sources. Many Unix-like operating systems can install CMake through their package systems.

Download the SPAGeDi source code (from and issue the following commands:

tar xvzf spagedi-*.tar.bz2
cd spagedi-*/build
cmake ..
make install

You may have to adjust the first two commands to fit the archive that you download.

The '-G' option to cmake is used to specify different build systems, e.g. Unix Makefiles versus KDevelop3 project. The '-D' option to cmake can be used to set different cmake variables from the command line:

make install

This will build an optimized version of SPAGeDi and install it to '/usr/bin'. To specify your own build flags you need to set the environment variables CFLAGS and LDFLAGS as necessary. Then specify


See CMake's manual for additional information.

Compiling from Source Code (alternative)

If you are having trouble getting CMake to work, you can try to compile manually.

cd spagedi-*/src
gcc -O2 -o ./spagedi *.c -lm

You will then have a spagedi-*/src/spagedi binary that you can copy wherever is useful to you.

You can’t perform that action at this time.