diff --git a/test_scripts/iqtree2.h b/test_scripts/iqtree2.h new file mode 100644 index 000000000..75f33fc68 --- /dev/null +++ b/test_scripts/iqtree2.h @@ -0,0 +1,17 @@ +#ifndef LIBIQTREE2_FUN +#define LIBIQTREE2_FUN + +#include + +using namespace std; + +// Calculates the RF distance between two trees +int calculate_RF_distance(const string& tree1, const string& tree2); + +// Generates a random phylogenetic tree +void generate_random_tree_file(int numtaxa, int seed, string tree_gen_mode, string outfile); + +// perform phylogenetic analysis on the input alignment file +void phylogenetic_analysis(string& align_file, int ncpus = 1); + +#endif /* LIBIQTREE2_FUN */ diff --git a/test_scripts/unify-static-libs.sh b/test_scripts/unify-static-libs.sh new file mode 100644 index 000000000..cbdefb3d4 --- /dev/null +++ b/test_scripts/unify-static-libs.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# +# Creates one static library from several. +# +# Usage: copy all your libs to a single directory and call this script. +# +if [[ $# -ne 2 ]]; then + echo "Usage: unify-static-libs.sh output-name path-to-libs" + exit 2 +fi +# Inputs +LIBNAME=$1 +LIBSDIR=$2 +# Tmp dir +OBJDIR=/tmp/unify-static-libs +# Command to evaluate +cmd="ar -crs $LIBNAME" +mkdir -p ${OBJDIR} +# Extract .o +echo "Extracting objects to ${OBJDIR}..." +for i in ${LIBSDIR}/*.a +do + echo $i + mkdir -p ${OBJDIR}/$i + ar --output ${OBJDIR}/$i -x $i + cmd="${cmd} ${OBJDIR}/$i/*.o" +done +# Link objects into a single lib +echo "Creating $LIBNAME from objects..." +eval "$cmd" +# ar -crs $LIBNAME $OBJDIR/*.o +# Clean up +# rm -rf ${OBJDIR} +echo "Done."