diff --git a/README b/README index 5e07592374..19766d9046 100644 --- a/README +++ b/README @@ -6,6 +6,8 @@ Requirements: http://gmplib.org/ - (optional) gperftools https://code.google.com/p/gperftools/ +- cmake + http://www.cmake.org Instructions for installing gcc-4.8 (C++11 compatible) on Ubuntu Execute: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..73ca4cbce7 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required (VERSION 2.8.7) +project (LEAN CXX) +set (LEAN_VERSION_MAJOR 0) +set (LEAN_VERSION_MINOR 1) +set (CMAKE_CXX_COMPILER "g++-4.8") +set (CMAKE_CXX_FLAGS_DEBUG "-DLEAN_DEBUG -DLEAN_TRACE -g") +set (CMAKE_CXX_FLAGS_RELEASE "-O3") +set (CMAKE_COLOR_MAKEFILE ON) +add_definitions(-std=c++11 -Wall) + +add_subdirectory(util) +add_subdirectory(shell) + diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt new file mode 100644 index 0000000000..43ff828c2c --- /dev/null +++ b/src/shell/CMakeLists.txt @@ -0,0 +1,12 @@ +configure_file ( + "${LEAN_SOURCE_DIR}/shell/version.h.in" + "${LEAN_BINARY_DIR}/version.h" + ) + +include_directories("${LEAN_BINARY_DIR}") + +include_directories (${LEAN_SOURCE_DIR}/util) +set (EXTRA_LIBS ${EXTRA_LIBS} util gmp) + +add_executable(lean lean.cpp) +target_link_libraries (lean ${EXTRA_LIBS}) diff --git a/src/shell/lean.cpp b/src/shell/lean.cpp new file mode 100644 index 0000000000..80f71f005b --- /dev/null +++ b/src/shell/lean.cpp @@ -0,0 +1,23 @@ +#include +#include "version.h" +#include "name.h" +#include "mpq.h" + +void tst1() { + lean::name n1("foo"); + lean::name n2(n1, 1); + std::cout << n2 << "\n"; +} + +void tst2() { + lean::mpq n1("10000000000000000000000000000000000000000"); + lean::mpq n2(317, 511); + std::cout << n1*n2 << "\n"; +} + +int main() { + std::cout << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR << ")\n"; + tst1(); + tst2(); + return 0; +} diff --git a/src/shell/version.h.in b/src/shell/version.h.in new file mode 100644 index 0000000000..7b8ef2dc21 --- /dev/null +++ b/src/shell/version.h.in @@ -0,0 +1,3 @@ +// the configured options and settings for Tutorial +#define LEAN_VERSION_MAJOR @LEAN_VERSION_MAJOR@ +#define LEAN_VERSION_MINOR @LEAN_VERSION_MINOR@ diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt new file mode 100644 index 0000000000..30055bda06 --- /dev/null +++ b/src/util/CMakeLists.txt @@ -0,0 +1 @@ +add_library(util trace.cpp debug.cpp name.cpp exception.cpp gmp_init.cpp mpz.cpp mpq.cpp mpbq.cpp)