Changes

From Genome Analysis Wiki
Jump to navigationJump to search
no edit summary
Line 32: Line 32:     
= Using the Library =
 
= Using the Library =
 +
In the following instructions/comments:
 +
* replace STATGEN_DIR with the path to where the statgen directory is located (does not include statgen/).
 +
* replace MY_CODE_DIR with the path where you want your code located.
 +
 
To use the StatGen Library, first download and compile via [[StatGen Download | StatGen Download Instructions]] and [[StatGen Repository#Compile.2FBuild | StatGen Compile/Build Instructions]]
 
To use the StatGen Library, first download and compile via [[StatGen Download | StatGen Download Instructions]] and [[StatGen Repository#Compile.2FBuild | StatGen Compile/Build Instructions]]
This creates the library: statgen/lib/libStatGen.a
     −
== Creating programs ==
+
This creates the library: STATGEN_DIR/statgen/lib/libStatGen.a, where STATGEN_DIR is the path to where you dec
After the statgen repository has been created:
+
 
 +
== Creating programs using the Default Makefile ==
 +
# Create a directory for your own code.
 +
#* <code>mkdir MY_CODE_DIR</code>
 +
# Move into your directory.
 +
#* <code>cd MY_CODE_DIR</code>
 +
# Copy the Makefile from the statgen directory.
 +
#* <code>cp STATGEN_DIR/statgen/src/Makefile.src Makefile
 +
#* You could instead link the Makefile, but then be careful not to modify it for your program because that may break any other programs that link to it (including those with the statgen repository).
 +
# Create <code>Makefile.tool</code>
 +
#* See [[Makefile.tool]] for what to put into Makefile.tool.
 +
# Compile your program
 +
#* For optimal performance (be sure you also compiled statgen for optimal performance):
 +
#** <code>make</code>
 +
#* For debug (be sure that you also compiled statgen for debug):
 +
#** <code>make OPTFLAG="-ggdb -O0"</code>
    +
NOTE: When you compile, all of your '.o' files will go in a directory called obj that will be created by the Makefile if it does not already exist.
   −
''' THIS IS IN THE PROCESS OF BEING UPDATED - CHECK BACK SOON'''
+
== Creating programs ==
 +
You can also use your own Makefile or method of building.
   −
If you are creating a program, you can start with Makefile.src found at statgen/src/.
+
Just be sure to add -ISTAGEN_DIR/statgen/lib/include to your compile line to pull in the library header files.
   −
(If you are creating a program in a directory outside of statgen/src, you may need additional modifications.)
+
Add <code>STATGEN_DIR/stagen/lib/libStatGen.a STATGEN_DIR/statgen/lib/samtools/libbam.a -lm -lz -lssl</code> in that order to the end of your compile line to pull in the necessary libraries.
   −
'''Example: creating statgen/src/myprog/'''
+
NOTE: These are all handled for you if you use Makefile.src from the statgen repository.
# cd statgen/src/myprog
  −
# ln -s ../Makefile.src Makefile
  −
# cp ../bam/Makefile.tool .
  −
# Update Makefile.tool for your specific program.
  −
#* You may need settings beyond were set in statgen/src/bam/Makefile.tool.  See Makefile.src for what settings you can use.
     −
== Recently Added Capabilities ==
+
= Recently Added Capabilities =
 
* [[SAM/BAM Convert Sequence|SAM/BAM support conversion between '=' and the base in a sequence]]
 
* [[SAM/BAM Convert Sequence|SAM/BAM support conversion between '=' and the base in a sequence]]

Navigation menu