FASTlib

FAQs


Datasets

If you have problems with reading a dataset, we recommend you remove all whitespace from it (unless it is a whitespace-separated data file). To allow both whitespace-separated and comma separated, we consider any sequence of whitespace or commas to be a delimeter -- that means if you have a comma-separated file with whitespace within any particular field, it will be treated as two separate columns. Rather than autodetecting the file type we treat both as delimeters throughout. Make sure the first row of a CSV file doesn't have whitespace within the column names if you intend for commas to be the separator.
this , is , four , columns
but , this , is five , columns
We hope to find a way to autodetect the file type and read it as such in the next few weeks.

Installation

  •   Q: I'm having trouble setting the PATH environment variable. Or, the fl-build command is not found when I type it.
  • A: Ask a friend who knows Unix how to add $FASTLIBPATH/script into your $PATH variable. If you are not using the bash shell, we highly recommend you do (type echo $0and it will tell you if you are using bash, ksh, csh, or tcsh). We may shortly have instructions for these shells (googling may also yield fruitful). Keep in mind also:
    • In Unix, absolute paths start with the "/" character, such as /home/garryb/fastlib/script.
    • When we say $FASTLIBPATH, we don't literally mean a dollar-sign followed by FASTLIBPATH. We rely on you to do the textual substitution.

Code features

Statistical functions

  • Q: I need to use F-test or betainc function in C++. Which library should I use?
  • A: FASTlib currently doesn't have these features, but you should be able to rip Java-based sources for BSD-licensed code in Weka's core/Statistics, which is adapted from CERN's JET Java. You would need a copy of the license statement at the top.

Math

  • Q: How to calculate exponential, square root or perform power operation? Have they been implemented in FASTlib? Can we use the functions in Math Library or C++ Standard Library ( math.h and stdlib.h)?
  • A: Math and stdlib have excellent math functions, and there is absolutely nothing wrong with these. We recommend you include math.h rather than cmath because we've found the latter to be problematic on some platforms. For a full list, see http://en.wikipedia.org/wiki/Math.h. Also, for gamma function, use "tgamma" or "lgamma_r" -- there are man pages for these functions.

Linear Algebra

  • Q: I need some matrix algebra such as determinant, inverse, transpose etc. When will the complete linear algebra tookit be available to use?
  • A: It should be part of the build system now. Before starting, make sure you have the g77 FORTRAN compiler -- type g77 in the command line and hopefully it should say "no input files". Then, in $FASTLIBPATH, type: svn update. Then, type cd la && fl-build uselapack_test && ./uselapack_test. This will take about 10 mintues -- it will automatically download a reference version of BLAS/LAPACK, compile about 800 FORTRAN files, and run some sanity tests. "ALL TESTS PASSED!" is the proper output. The linear algebra functions are in la/uselapack.h. In the Doxygen documentation, look at "Namespaces" and choose "la". Read the description at the top of the "la" namespace before you get too far with the long list of functions.
  • Q: Are there optimized precompiled versions of LAPACK/BLAS available?
  • A: We're putting together a few by just combining some existing packages. There are two advantages to having a precompiled version: (1) the pure FORTRAN reference implementation is not the fastest, and (2) maybe you don't have a FORTRAN compiler. To install one of these, download it and bunzip2 it. Go into the bin_keep directory of FASTlib, and replace the proper libblaspack.a file in the proper directory. (If you're one of the people without FORTRAN, go through the motions of trying to install the automated build, and it will create a directory with a "workspace" in it -- for instance, if you have the directory i686_Linux_COMMON_gcc, store it as i686_Linux_COMMON_gcc/libblaspack.a).
  Machine Source File
  Linux Intel P4, Core ATLAS+LAPACK http://www.cc.gatech.edu/~garryb/fastlib/libblaspack-pentium4.a.bz2
 Linux x86 64-bit ATLAS+LAPACK http://www.cc.gatech.edu/~garryb/fastlib/libblaspack-amd64.a.bz2

If you want to donate one, it's pretty simple to make. First, build the relevant binaries for the architecture. Then use "ar x libname.a" for each .a file to extract all the .o files into a single directory, making sure to extract the most fine-tuned libraries last to overwrite the less optimized versions extracted first. Finally use "ar r libblaspack.a *.o" to make a consolidated blas/lapack distribution. Bzip2 -9 will make it about ten times smaller.

Others

  • Q: How to write a test suite and how to build and run it?
  • A: Internally, we write tests using the DEBUG_ASSERT framework and building it like a separate executable, and running it. (For convenience, we also use a little bit of macro magic defined in base/test.h. This is by no means a unit testing framework because it fails on first error, and is likely to go through a lot of changes in the near -- it is just our set of sanity tests). An example would be like this:
----- (in build.py) -------
binrule(name = "mylib_test", sources = ["mylib_test.cc"], linkables = [":mylib"])
----- (in mylib_test.cc) -------
#include "mylib.h"
#include "fastlib/fastlib.h"
int main(int argc, char*argv[]) {
DEBUG_ASSERT(MyFactorial(1) == 1);
DEBUG_ASSERT(MyFactorial(2) == 2);
DEBUG_ASSERT(MyFactorial(3) == 6);
DEBUG_ASSERT(MyFactorial(4) == 24);
}
The bad thing about this style is if one test breaks, you only find out about the first error. You can pass a command-line parameter to tell it which tests to run if this is a problem.

FASTlib group

For reporting bugs or asking questions or having discussions, go to this group:
Google Groups
FASTlib_forum
Visit this group

Documentation

For the current documentation of the whole library follow this link
Doxygen

Recent site activity