|
| 1 | +# The smithlab_cpp library |
| 2 | + |
| 3 | +This library contains code that has been used in the Smith lab for |
| 4 | +several years, and that we now depend on for several of our data |
| 5 | +analysis tools. Many of those tools use older versions of this source |
| 6 | +code in subdirectories of other repos. |
| 7 | + |
| 8 | +## Requirements |
| 9 | + |
| 10 | +- A C++ compiler that knows C++11. The GNU `g++` compiler works well |
| 11 | + for this after version 5.3. |
| 12 | +- The GNU Scientific Library, GSL, which is likely already on your |
| 13 | + system, or easily installed through a package manager. |
| 14 | +- The [zlib library](https://zlib.net), which we use for I/O of files |
| 15 | + in gzip format. You likely have this on your system. |
| 16 | +- Optional: The [HTSLib library](http://htslib.org), which we use for |
| 17 | + I/O of SAM and BAM format files. |
| 18 | + |
| 19 | +## Building and installing the smithlab_cpp library |
| 20 | + |
| 21 | +Assuming you downloaded the release X.X the tarball |
| 22 | +`libsmithlab_cpp-X.X.tar.gz`, you would do the following: |
| 23 | +``` |
| 24 | +$ tar -xvf libsmithlab_cpp-X.X.tar.gz |
| 25 | +$ cd libsmithlab_cpp-X.X |
| 26 | +$ ./configure |
| 27 | +$ make |
| 28 | +$ make install |
| 29 | +``` |
| 30 | +If you do not want to contaminate your system's directories with |
| 31 | +our code, you can modify the 3rd step above to: |
| 32 | +``` |
| 33 | +$ ./configure --prefix=/some/unimportant/directory |
| 34 | +``` |
| 35 | +It is also a very good idea to run the `configure` script as follows: |
| 36 | +``` |
| 37 | +$ ./configure CXXFLAGS='-O3 -Wall' |
| 38 | +``` |
| 39 | +This will make the resulting library code faster and much smaller, as |
| 40 | +the defaults compile with `-g` for debugging. |
| 41 | + |
| 42 | +## Using the source directly from the repo |
| 43 | + |
| 44 | +If you clone the repo and attempt to use the source directly, you are |
| 45 | +likely to run into more problems than if you use a release. I will do |
| 46 | +everything I can to provide support for the releases, but I may not |
| 47 | +help if you have problems using the source repo directly. |
| 48 | + |
| 49 | +This README.md file is written just as we are turning `smithlab_cpp` |
| 50 | +into a library and not a collection of source files. If you want to |
| 51 | +use it the way it has been used from 2010-2019, then you can use the |
| 52 | +`original_makefile.mk` which should still be in this repo. Just like |
| 53 | +this: |
| 54 | +``` |
| 55 | +$ make -f original_makefile.mk OptionParser.o |
| 56 | +g++ -Wall -std=c++11 -c -o OptionParser.o OptionParser.cpp |
| 57 | +``` |
| 58 | +Now that we are using both the Zlib and HTSLib libraries, it is more |
| 59 | +important that we have a build system that can check for these. So |
| 60 | +this repo no longer contains a `Makefile` but instead you must |
| 61 | +generate one. If you want |
0 commit comments