| 1 |
# Swig |
| 2 |
|
| 3 |
Make sure you have swig installed and included in your path. |
| 4 |
|
| 5 |
To build a Perl5 module (run in swig/): |
| 6 |
``` |
| 7 |
preinst-swig -Wall -c++ -perl5 BloomFilter.i |
| 8 |
g++ -std=c++11 -c BloomFilter_wrap.cxx -I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -fPIC |
| 9 |
g++ -std=c++11 -Wall -shared BloomFilter_wrap.o -o BloomFilter.so |
| 10 |
``` |
| 11 |
|
| 12 |
On mac you may need to instead run: |
| 13 |
``` |
| 14 |
preinst-swig -Wall -c++ -perl5 BloomFilter.i |
| 15 |
g++ -std=c++11 -c `perl -MConfig -e 'print join(" ", @Config{qw(ccflags optimize cccdlflags)}, "-I$Config{archlib}/CORE")'` BloomFilter_wrap.cxx -Wno-reserved-user-defined-literal |
| 16 |
g++ -std=c++11 `perl -MConfig -e 'print $Config{lddlflags}'` BloomFilter_wrap.o -o BloomFilter.so |
| 17 |
``` |
| 18 |
|
| 19 |
To run tests: |
| 20 |
``` |
| 21 |
# To test insertions: |
| 22 |
./writeBloom_rolling.pl |
| 23 |
Usage: ./writeBloom_rolling.pl |
| 24 |
-f sequences to scaffold (Multi-FASTA format, required) |
| 25 |
-k k-mer value (default -k 15, optional) |
| 26 |
-p Bloom filter false positive rate (default -p 0.0001, optional - increase to prevent memory allocation errors) |
| 27 |
|
| 28 |
# To test queries: |
| 29 |
./testBloom_rolling.pl |
| 30 |
Usage: ./testBloom_rolling.pl |
| 31 |
-f sequences to test (Multi-FASTA format, required) |
| 32 |
-k k-mer value (default -k 15, optional) |
| 33 |
-b Bloom filter (required) |
| 34 |
``` |
| 35 |
|
| 36 |
In order to compile, swig needs the following Perl5 headers: |
| 37 |
```C++ |
| 38 |
#include "Extern.h" |
| 39 |
#include "perl.h" |
| 40 |
#include "XSUB.h" |
| 41 |
``` |
| 42 |
If they are not located in /usr/lib64/perl5, you can run "perl -e 'use Config; print $Config{archlib};" to locate them. |