Skip to content

Commit

Permalink
For IQTREE library file
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaskf authored May 22, 2024
1 parent c8be3c3 commit 41d8cc2
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test_scripts/iqtree2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef LIBIQTREE2_FUN
#define LIBIQTREE2_FUN

#include <string>

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 */
34 changes: 34 additions & 0 deletions test_scripts/unify-static-libs.sh
Original file line number Diff line number Diff line change
@@ -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."

0 comments on commit 41d8cc2

Please sign in to comment.