2013-07-22 17:25:49 +00:00
|
|
|
[![Build Status](https://travis-ci.org/leodemoura/lean.png?branch=master)](https://travis-ci.org/leodemoura/lean)
|
2013-08-12 23:23:35 +00:00
|
|
|
Ubuntu 12.04 LTS 64bit, g++-4.8 | clang++-3.3
|
|
|
|
|
|
|
|
[![Build Status](https://travis-ci.org/soonhokong/lean-osx.png?branch=master)](https://travis-ci.org/soonhokong/lean-osx)
|
2013-09-04 21:21:08 +00:00
|
|
|
Mac OS X 10.8.2, g++-4.9
|
2013-07-22 13:36:19 +00:00
|
|
|
|
2013-08-22 23:48:05 +00:00
|
|
|
[![Build Status](https://travis-ci.org/soonhokong/lean-windows.png?branch=master)](https://travis-ci.org/soonhokong/lean-windows)
|
2013-08-22 21:16:20 +00:00
|
|
|
Windows, x86_64-w64-mingw32-g++-4.8.1
|
|
|
|
|
2013-09-04 04:55:40 +00:00
|
|
|
[[Result of Build/UnitTest/Coverage/Dynamic Analysis]][cdash]
|
|
|
|
|
2013-09-04 12:12:10 +00:00
|
|
|
[cdash]: http://cmacslab2.modck.cs.cmu.edu/CDash-2-0-2/index.php?project=Lean
|
2013-09-04 04:55:40 +00:00
|
|
|
|
2013-07-18 21:31:17 +00:00
|
|
|
Requirements
|
|
|
|
============
|
|
|
|
|
|
|
|
- C++11 compatible compiler
|
|
|
|
- GMP (GNU multiprecision library)
|
|
|
|
http://gmplib.org/
|
2013-08-06 00:58:54 +00:00
|
|
|
- MPFR (GNU MPFR Library)
|
|
|
|
http://www.mpfr.org/
|
2013-07-18 21:31:17 +00:00
|
|
|
- (optional) gperftools
|
|
|
|
https://code.google.com/p/gperftools/
|
|
|
|
- cmake
|
|
|
|
http://www.cmake.org
|
|
|
|
|
2013-09-03 00:07:40 +00:00
|
|
|
Install Packages on Ubuntu 12.04 LTS
|
|
|
|
------------------------------------
|
2013-07-18 21:31:17 +00:00
|
|
|
|
2013-07-19 00:52:56 +00:00
|
|
|
Instructions for installing gperftools on Ubuntu
|
|
|
|
|
|
|
|
sudo add-apt-repository ppa:agent-8131/ppa
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get dist-upgrade
|
|
|
|
sudo apt-get install libgoogle-perftools-dev
|
|
|
|
|
2013-07-18 21:31:17 +00:00
|
|
|
Instructions for installing gcc-4.8 (C++11 compatible) on Ubuntu
|
|
|
|
|
|
|
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
|
|
|
sudo update-alternatives --remove-all gcc
|
|
|
|
sudo update-alternatives --remove-all g++
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install g++-4.8 -y
|
|
|
|
sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
|
|
|
|
|
|
|
|
Instructions for installing clang-3.3 (C++11 compatible) on Ubuntu
|
|
|
|
|
|
|
|
sudo add-apt-repository ppa:h-rayflood/llvm
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get dist-upgrade
|
|
|
|
sudo apt-get install clang-3.3 clang-3.3-doc
|
|
|
|
|
2013-09-04 04:55:40 +00:00
|
|
|
Note that you [still need][clang_cxx_status] to have g++-4.8's C++
|
|
|
|
runtime library to support some C++11 features that we are using.
|
2013-07-18 21:31:17 +00:00
|
|
|
|
|
|
|
You can specify the C++ compiler to use by using ``-DCMAKE_CXX_COMPILER``
|
|
|
|
option. For example
|
|
|
|
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_CXX_COMPILER=clang++-3.3 ../../src
|
|
|
|
|
2013-09-04 04:55:40 +00:00
|
|
|
[clang_cxx_status]: http://clang.llvm.org/cxx_status.html
|
2013-07-25 07:20:39 +00:00
|
|
|
|
2013-09-03 00:07:40 +00:00
|
|
|
Install Packages on Fedora 19
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
Instructions for installing git, cmake, mpfr, gmp, gperftools on Fedora
|
|
|
|
|
|
|
|
sudo yum install -y git cmake mpfr-devel gmp-devel gperftools-devel
|
|
|
|
|
|
|
|
Instructions for installing gcc-4.8 (C++11 compatible) on Fedora
|
|
|
|
|
|
|
|
sudo yum install -y gcc-c++
|
|
|
|
|
|
|
|
Instructions for installing clang-3.3 (C++11 compatible) on Fedora
|
|
|
|
|
|
|
|
sudo yum install -y clang-devel
|
|
|
|
|
|
|
|
Install Packages on OS X 10.8
|
|
|
|
-----------------------------
|
2013-07-25 07:20:39 +00:00
|
|
|
We assume that you are using [homebrew][homebrew], "The missing package manager for OS X".
|
|
|
|
|
|
|
|
[homebrew]: http://brew.sh
|
|
|
|
|
|
|
|
Instructions for installing gperftools on OS X 10.8
|
|
|
|
|
|
|
|
$ brew install gperftools
|
|
|
|
|
|
|
|
Instructions for installing gcc-4.8 (C++11 compatible) on OS X 10.8
|
|
|
|
|
|
|
|
$ brew tap homebrew/versions
|
|
|
|
$ brew install gcc48
|
|
|
|
|
|
|
|
Instructions for installing clang-3.3 (C++11 compatible) on OS X 10.8
|
|
|
|
|
|
|
|
$ brew install llvm --with-clang --with-asan
|
|
|
|
|
2013-08-10 21:32:42 +00:00
|
|
|
Install Packages on Cygwin
|
|
|
|
--------------------------
|
|
|
|
Just run cygwin setup.exe (http://cygwin.com/install.html) and make sure that you have installed g++ 4.8.1 (or greater), cmake, gmp and libmpfr.
|
|
|
|
We have tested Lean using Cygwin for 64-bit versions of Windows.
|
|
|
|
|
2013-07-25 07:20:39 +00:00
|
|
|
Build Instructions
|
|
|
|
==================
|
|
|
|
|
|
|
|
Using [CMake][cmake] + Make
|
|
|
|
---------------------
|
|
|
|
Instructions for DEBUG build
|
|
|
|
|
|
|
|
mkdir -p build/debug
|
|
|
|
cd build/debug
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=DEBUG ../../src
|
|
|
|
make
|
|
|
|
|
|
|
|
Instructions for RELEASE build
|
|
|
|
|
|
|
|
mkdir -p build/release
|
|
|
|
cd build/release
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=RELEASE ../../src
|
|
|
|
make
|
|
|
|
|
|
|
|
Using [CMake][cmake] + [Ninja][ninja]
|
|
|
|
-------------------------------
|
|
|
|
[CMake 2.8.11][cmake] supports [Ninja][ninja] build system using
|
2013-09-04 04:55:40 +00:00
|
|
|
``-G`` option. [Some people report][ninja_work] that using
|
|
|
|
[Ninja][ninja] can reduce the build time, esp when a build is
|
|
|
|
incremental.
|
2013-07-25 07:20:39 +00:00
|
|
|
|
2013-09-04 04:55:40 +00:00
|
|
|
[ninja_work]: https://plus.google.com/108996039294665965197/posts/SfhrFAhRyyd
|
2013-07-25 07:20:39 +00:00
|
|
|
|
|
|
|
Instructions for DEBUG build
|
|
|
|
|
|
|
|
mkdir -p build/debug
|
|
|
|
cd build/debug
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=DEBUG -G Ninja ../../src
|
|
|
|
ninja
|
|
|
|
|
|
|
|
Instructions for RELEASE build
|
|
|
|
|
|
|
|
mkdir -p build/release
|
|
|
|
cd build/release
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=RELEASE -G Ninja ../../src
|
|
|
|
ninja
|
|
|
|
|
|
|
|
[cmake]: http://www.cmake.org/
|
|
|
|
[ninja]: http://martine.github.io/ninja/
|
2013-08-18 03:51:26 +00:00
|
|
|
|
|
|
|
Instructions for Testing and Measuring Code Coverage
|
|
|
|
====================================================
|
|
|
|
|
|
|
|
To measure [code coverage][cover], compile TESTCOV build using g++:
|
|
|
|
|
|
|
|
mkdir -p build/testcov
|
|
|
|
cd build/testcov
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=TESTCOV -DCMAKE_CXX_COMPILER=g++-4.8 -G Ninja ../../src
|
|
|
|
ninja
|
|
|
|
|
|
|
|
and run test cases:
|
|
|
|
|
|
|
|
ctest
|
|
|
|
|
|
|
|
and collect coverage data using [lcov][lcov] and [gcov][gcov]:
|
|
|
|
|
|
|
|
lcov -c -b ../../src -d . -o cov.info --no-external --gcov-tool gcov-4.8
|
|
|
|
|
|
|
|
and generate HTML output:
|
|
|
|
|
|
|
|
genhtml cov.info --output-directory lcov
|
|
|
|
|
|
|
|
Note: make sure that the version of ``gcov`` matches with the one of
|
|
|
|
``g++``. Also try to use the latest ``lcov`` if you have a problem
|
|
|
|
with the existing one.
|
|
|
|
|
|
|
|
[gcov]: http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
|
|
|
|
[lcov]: http://ltp.sourceforge.net/coverage/lcov.php
|
|
|
|
[cover]: https://dl.dropboxusercontent.com/u/203889738/lcov/index.html
|
|
|
|
|
|
|
|
Instructions for Building Doxygen Documentation
|
|
|
|
===============================================
|
|
|
|
|
|
|
|
doxygen src/Doxyfile
|