Minimal Example

From PLL Documentation
Jump to: navigation, search
#include <stdio.h>
#include <pll/pll.h>
 
int main (int argc, char * argv[])
{
  pllInstance * inst;
  pllInstanceAttr attr;
  pllAlignmentData * alignmentData;
 
  /* set PLL instance attributes */
  attr.rateHetModel     = PLL_GAMMA;
  attr.fastScaling      = PLL_FALSE;
  attr.saveMemory       = PLL_FALSE;
  attr.useRecom         = PLL_FALSE;
  attr.randomNumberSeed = 0x12345;
 
  inst = pllCreateInstance (&attr);                  /* Create the PLL instance */
 
  char *names[6] = {NULL, "a", "b", "c", "d", "e"};  /* first is never used */
  pllTreeInitTopologyRandom(inst, 5, names);         /* create five-tip tree from indices 1-5 */
 
  pllDestroyInstance (inst);                         /* Destroy the PLL instance */
}

To compile the library run

gcc example.c -lpll-SSE3 -lm -o example