A compiler for BLOG probabilistic programming language (http://bayesianlogic.github.io/).
Proceeding of IJCAI 2016: http://www.ijcai.org/Proceedings/16/Papers/512.pdf
Arxiv: https://arxiv.org/abs/1606.09242
- double spaces for indentation
- use linux line terminator
- follow http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
- A C++ compiler (default GNU C++, VC++/Clang compatible)
- The armadillo package: http://arma.sourceforge.net/
- C++11 required
- (recommended) BLAS and LAPACK
- install armadillo library:
brew install armadillo
- link C++ libraries for OS X:
xcode-select --install
- install required dependencies:
apt-get install g++ cmake libopenblas-dev liblapack-dev
- download armadillo for linux from its webpage: http://arma.sourceforge.net/download.html
- unzip the tar.xz file, install armadillo according to section 5 and section 6 in README.txt
Download the VC++ solution config file from the armadillo webpage
- Compile the Swift compiler:
make compile
(see compile.bat for windows) - Generate target C++ code:
./swift -i <Model File> -o <Target C++ File> -e <Algorithm>
(swift.exe in Windows). Run./swift
to see all the command line options - Compile your target code:
g++ -o -O3 <target> <your C++ file> random/* -larmadillo
(see swifty.sh). - Run your final binary!
Note if you are using visual studio under Windows, please compile inside visual studio to obtain the final binary (step 3).
Check our release version v0.1 and the binary files: https://github.com/lileicc/swift/releases/tag/v0.1
Swift inherits all the syntax from BLOG with some extentions. Detailed documentations are under development. Please firstly check models under "example" directory to have a first impression. You can also check the documentations for BLOG for basic usage (http://bayesianlogic.github.io/pages/documentation.html).