Commit 905c9815 authored by Sergei Golubchik's avatar Sergei Golubchik

merge with git://github.com/Tokutek/ft-index.git up to tokudb-7.0.4

parents 9b933e3b a52b3259

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
project(TokuDB)
# suppress -rdynamic
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
include(TokuFeatureDetection)
include(TokuSetupCompiler)
include(TokuSetupCTest)
include(TokuThirdParty)
set(TOKU_CMAKE_SCRIPT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(TokuMergeLibs)
## need a way to change the name of libs we build
set(LIBTOKUPORTABILITY "tokuportability" CACHE STRING "Name of libtokuportability.so")
set(LIBTOKUDB "tokufractaltree" CACHE STRING "Name of libtokufractaltree.so")
include_directories(
${VALGRIND_INCLUDE_DIR}
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/toku_include
${CMAKE_CURRENT_SOURCE_DIR}/portability
${CMAKE_CURRENT_SOURCE_DIR} ## so you can include <ft/ft-ops.h> from inside src/
${CMAKE_CURRENT_BINARY_DIR} ## for logging code
)
## include where config.h will be generated
include_directories(${CMAKE_CURRENT_BINARY_DIR}/toku_include)
## build db.h and include where it will be generated
add_subdirectory(buildheader)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/buildheader)
## default includes and libraries
include_directories(SYSTEM
/usr/local/include
${ZLIB_INCLUDE_DIRS}
)
## add subdirectories
add_subdirectory(util)
add_subdirectory(portability)
add_subdirectory(ft)
add_subdirectory(locktree)
add_subdirectory(src)
add_subdirectory(utils)
## subdirectories that just install things
add_subdirectory(include)
add_subdirectory(toku_include)
add_subdirectory(examples)
install(
FILES README.md README-TOKUDB
DESTINATION .
)
## build tags
include(TokuBuildTagDatabases)
This diff is collapsed.
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "tokudb")
set(CTEST_NIGHTLY_START_TIME "23:59:00 EDT")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "lex1:8080")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=tokudb")
set(CTEST_DROP_SITE_CDASH TRUE)
cmake_policy(SET CMP0012 NEW)
## these tests shouldn't run with valgrind
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ft/bnc-insert-benchmark
ft/brt-serialize-benchmark
ft/ft_loader-test-extractor-1
ft/ft_loader-test-extractor-2
ft/ft_loader-test-extractor-3
ft/upgrade_test_simple
portability/test-cache-line-boundary-fails
portability/try-leak-lost
portability/try-leak-reachable
portability/try-leak-uninit
util/helgrind_test_circular_buffer
util/helgrind_test_partitioned_counter
util/helgrind_test_partitioned_counter_5833
ydb/diskfull.tdb
ydb/drd_test_4015.tdb
ydb/drd_test_groupcommit_count.tdb
ydb/filesize.tdb
ydb/helgrind_helgrind1.tdb
ydb/helgrind_helgrind2.tdb
ydb/helgrind_helgrind3.tdb
ydb/helgrind_test_groupcommit_count.tdb
ydb/hot-optimize-table-tests.tdb
ydb/insert-dup-prelock.tdb
ydb/loader-cleanup-test2.tdb
ydb/loader-cleanup-test3.tdb
ydb/loader-stress-test4.tdb
ydb/maxsize-for-loader-B.tdb
ydb/openlimit17.tdb
ydb/openlimit17-locktree.tdb
ydb/preload-db-nested.tdb
ydb/stress-gc.tdb
ydb/stress-gc2.tdb
ydb/stress-test.bdb
ydb/stress-test.tdb
ydb/test-5138.tdb
ydb/test-prepare.tdb
ydb/test-prepare2.tdb
ydb/test-prepare3.tdb
ydb/test-recover1.tdb
ydb/test-recover2.tdb
ydb/test-recover3.tdb
ydb/test-xa-prepare.tdb
ydb/test4573-logtrim.tdb
ydb/test_3645.tdb
ydb/test_groupcommit_perf.bdb
ydb/test_groupcommit_perf.tdb
ydb/test_large_update_broadcast_small_cachetable.tdb
ydb/test_update_broadcast_stress.tdb
ydb/test_update_stress.tdb
ydb/upgrade-test-4.tdb
)
if (NOT @RUN_HELGRIND_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
util/helgrind_test_circular_buffer
util/helgrind_test_partitioned_counter
util/helgrind_test_partitioned_counter_5833
ydb/helgrind_helgrind1.tdb
ydb/helgrind_helgrind2.tdb
ydb/helgrind_helgrind3.tdb
ydb/helgrind_test_groupcommit_count.tdb
)
endif ()
if (NOT @RUN_DRD_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
ydb/drd_test_groupcommit_count.tdb
ydb/drd_test_4015.tdb
)
endif ()
## osx's pthreads prefer writers, so this test will deadlock
if (@CMAKE_SYSTEM_NAME@ STREQUAL Darwin)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE portability/test-pthread-rwlock-rwr)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE portability/test-pthread-rwlock-rwr)
endif ()
## tests that are supposed to crash will generate memcheck failures
set(tests_that_should_fail
ft/test-assertA
ft/test-assertB
portability/try-assert-zero
portability/try-assert0
ydb/recover-missing-dbfile-2.abortrecover
ydb/recover-missing-dbfile.abortrecover
ydb/test_db_no_env.tdb
ydb/test_truncate_txn_abort.tdb
)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${tests_that_should_fail})
## don't run drd stress tests with valgrind either (because that would do valgrind twice)
set(stress_tests
test_stress0.tdb
test_stress1.tdb
test_stress2.tdb
test_stress3.tdb
test_stress4.tdb
test_stress5.tdb
test_stress6.tdb
test_stress7.tdb
test_stress_hot_indexing.tdb
test_stress_openclose.tdb
test_stress_with_verify.tdb
)
foreach(test ${stress_tests})
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
ydb/drd_tiny_${test}
ydb/drd_mid_${test}
ydb/drd_large_${test}
)
if(NOT @RUN_LONG_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
ydb/drd_large_${test}
)
endif()
if (NOT @RUN_DRD_TESTS@)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE
ydb/drd_tiny_${test}
ydb/drd_mid_${test}
ydb/drd_large_${test}
)
endif ()
endforeach(test)
## upgrade stress tests are 5 minutes long, don't need to run them always
if(NOT @RUN_LONG_TESTS@)
foreach(test ${stress_tests})
if (NOT ${test} MATCHES test_stress_openclose)
foreach(oldver 4.2.0 5.0.8 5.2.7 6.0.0 6.1.0 6.5.1 6.6.3)
foreach(p_or_s pristine stressed)
if (NOT (${test} MATCHES test_stress4 AND ${p_or_s} MATCHES stressed))
foreach(size 2000)
list(APPEND CTEST_CUSTOM_TESTS_IGNORE ydb/${test}/upgrade/${oldver}/${p_or_s}/${size})
endforeach(size)
endif ()
endforeach(p_or_s)
endforeach(oldver)
endif ()
endforeach(test)
endif()
set(tdb_tests_that_should_fail "ydb/${stress_tests}")
string(REGEX REPLACE ";" ";ydb/" stress_tests "${stress_tests}")
set(recover_stress_tests
ydb/recover-test_stress1.abortrecover
ydb/recover-test_stress2.abortrecover
ydb/recover-test_stress3.abortrecover
ydb/recover-test_stress_openclose.abortrecover
)
## we run stress tests separately, only run them if asked to
if(NOT @RUN_STRESS_TESTS@)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${stress_tests} ${recover_stress_tests})
list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${stress_tests} ${recover_stress_tests})
endif()
set(perf_tests
ydb/perf_checkpoint_var.tdb
ydb/perf_cursor_nop.tdb
ydb/perf_malloc_free.tdb
ydb/perf_nop.tdb
ydb/perf_ptquery.tdb
ydb/perf_ptquery2.tdb
ydb/perf_read_write.tdb
ydb/perf_xmalloc_free.tdb
)
## we also don't need to run perf tests every time
if(NOT @RUN_PERF_TESTS@)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${perf_tests})
list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${perf_tests})
endif()
## don't run perf tests with valgrind (that's slow)
file(GLOB perf_test_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/tests" perf_*.cc)
string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" perf_tests "${perf_test_srcs}")
set(tdb_tests_that_should_fail "ydb/${perf_tests}")
string(REGEX REPLACE ";" ";ydb/" perf_tests "${perf_tests}")
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${perf_tests})
## these tests fail often and aren't helpful
set(known_failing_tests
ydb/diskfull.tdb
)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${known_failing_tests})
list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${known_failing_tests})
## these tests take a long time, only run them if asked to
set(long_running_tests
ft/is_empty
ft/upgrade_test_simple
ydb/checkpoint_1.tdb
ydb/checkpoint_stress.tdb
ydb/hotindexer-with-queries.tdb
ydb/hot-optimize-table-tests.tdb
ydb/loader-cleanup-test0.tdb
ydb/loader-cleanup-test0z.tdb
ydb/loader-cleanup-test2.tdb
ydb/loader-cleanup-test2z.tdb
ydb/loader-stress-test4.tdb
ydb/loader-stress-test4z.tdb
ydb/manyfiles.tdb
ydb/preload-db-nested.tdb
ydb/recover_stress.tdb
ydb/root_fifo_1.tdb
ydb/root_fifo_2.tdb
ydb/root_fifo_31.tdb
ydb/root_fifo_32.tdb
ydb/stress-gc.tdb
ydb/stress-test.tdb
ydb/test3529.tdb
ydb/test_logmax.tdb
ydb/test_txn_nested2.tdb
ydb/test_update_broadcast_stress.tdb
ydb/test_update_stress.tdb
)
if(NOT @RUN_LONG_TESTS@)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${long_running_tests})
list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${long_running_tests})
endif()
## ignore log_print.cc in coverage report
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE "log_print.cc")
list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
# don't complain about warnings in xz source
"xz-4.999.9beta/src/liblzma"
# don't complain about clang missing warnings from xz code
"clang: warning: unknown warning option"
# don't complain about warnings in jemalloc source
"jemalloc/src"
"jemalloc/internal"
# don't complain about valgrind headers leaving things unused
"valgrind/valgrind.h"
"valgrind/memcheck.h"
# don't complain about ranlib or libtool on empty archive
"has no symbols"
"the table of contents is empty"
)
if(BUILD_TESTING)
if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
# Valgrind on OSX 10.8 generally works but outputs some warning junk
# that is hard to parse out, so we'll just let it run alone
set(MEMORYCHECK_COMMAND "${TokuDB_SOURCE_DIR}/scripts/tokuvalgrind")
endif ()
set(MEMORYCHECK_COMMAND_OPTIONS "--gen-suppressions=no --soname-synonyms=somalloc=*tokuportability* --quiet --num-callers=20 --leak-check=full --show-reachable=yes --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,grep,*/grep,date,*/date,test,*/tokudb_dump,*/tdb-recover --trace-children-skip-by-arg=--only_create,--test,--no-shutdown,novalgrind" CACHE INTERNAL "options for valgrind")
set(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_CURRENT_BINARY_DIR}/valgrind.suppressions" CACHE INTERNAL "suppressions file for valgrind")
set(UPDATE_COMMAND "svn")
endif()
COPYING CONDITIONS NOTICE:
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation, and provided that the
following conditions are met:
* Redistributions of source code must retain this COPYING
CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
PATENT MARKING NOTICE (below), and the PATENT RIGHTS
GRANT (below).
* Redistributions in binary form must reproduce this COPYING
CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
PATENT MARKING NOTICE (below), and the PATENT RIGHTS
GRANT (below) in the documentation and/or other materials
provided with the distribution.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
COPYRIGHT NOTICE:
TokuDB, Tokutek Fractal Tree Indexing Library.
Copyright (C) 2007-2013 Tokutek, Inc.
DISCLAIMER:
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
UNIVERSITY PATENT NOTICE:
The technology is licensed by the Massachusetts Institute of
Technology, Rutgers State University of New Jersey, and the Research
Foundation of State University of New York at Stony Brook under
United States of America Serial No. 11/760379 and to the patents
and/or patent applications resulting from it.
PATENT MARKING NOTICE:
This software is covered by US Patent No. 8,185,551.
PATENT RIGHTS GRANT:
"THIS IMPLEMENTATION" means the copyrightable works distributed by
Tokutek as part of the Fractal Tree project.
"PATENT CLAIMS" means the claims of patents that are owned or
licensable by Tokutek, both currently or in the future; and that in
the absence of this license would be infringed by THIS
IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
"PATENT CHALLENGE" shall mean a challenge to the validity,
patentability, enforceability and/or non-infringement of any of the
PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
Tokutek hereby grants to you, for the term and geographical scope of
the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to
make, have made, use, offer to sell, sell, import, transfer, and
otherwise run, modify, and propagate the contents of THIS
IMPLEMENTATION, where such license applies only to the PATENT
CLAIMS. This grant does not include claims that would be infringed
only as a consequence of further modifications of THIS
IMPLEMENTATION. If you or your agent or licensee institute or order
or agree to the institution of patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that
THIS IMPLEMENTATION constitutes direct or contributory patent
infringement, or inducement of patent infringement, then any rights
granted to you under this License shall terminate as of the date
such litigation is filed. If you or your agent or exclusive
licensee institute or order or agree to the institution of a PATENT
CHALLENGE, then Tokutek may terminate any rights granted to you
under this License.
TokuKV
======
TokuKV is a high-performance, transactional key-value store, used in the
TokuDB storage engine for MySQL and MariaDB.
TokuKV is provided as a shared library with an interface similar to
Berkeley DB.
To build the full MySQL product, see the instructions for
[ft-engine][ft-engine]. This document covers TokuKV only.
[ft-engine]: http://github.com/Tokutek/ft-engine
Building
--------
TokuKV is built using CMake >= 2.8.8. Out-of-source builds are
recommended. You need a C++11 compiler, though only GCC >= 4.7 and
Apple's Clang are tested. You also need zlib and valgrind development
packages (`yum install valgrind-devel zlib-devel` or `apt-get install
valgrind zlib1g-dev`).
You will also need the source code for jemalloc, checked out in
`third_party/`.
```sh
git clone git://github.com/Tokutek/ft-index.git ft-index
cd ft-index
git clone git://github.com/Tokutek/jemalloc.git third_party/jemalloc
mkdir build
cd build
CC=gcc47 CXX=g++47 cmake \
-D CMAKE_BUILD_TYPE=Debug \
-D USE_BDB=OFF \
-D BUILD_TESTING=OFF \
-D CMAKE_INSTALL_PREFIX=../prefix/ \
..
cmake --build . --target install
```
This will build `libtokudb.so` and `libtokuportability.so` and install it,
some header files, and some examples to `ft-index/prefix/`. It will also
build jemalloc and install it alongside these libraries, you should link
to that if you are planning to run benchmarks or in production.
### Platforms
TokuKV is supported on 64-bit Centos, should work on other 64-bit linux
distributions, and may work on OSX 10.8 and FreeBSD. TokuKV is not
supported on 32-bit systems.
[Transparent hugepages][transparent-hugepages] is a feature in newer linux
kernel versions that causes problems for the memory usage tracking
calculations in TokuKV and can lead to memory overcommit. If you have
this feature enabled, TokuKV will not start, and you should turn it off.
If you want to run with transparent hugepages on, you can set an
environment variable `TOKU_HUGE_PAGES_OK=1`, but only do this for testing,
and only with a small cache size.
[transparent-hugepages]: https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/s-memory-transhuge.html
Examples
--------
There are some sample programs that can use either TokuKV or Berkeley DB
in the `examples/` directory. Follow the above instructions to build and
install TokuKV, and then look in the installed `examples/` directory for
instructions on building and running them.
Testing
-------
TokuKV uses CTest for testing. The CDash testing dashboard is not
currently public, but you can run the tests without submitting them.
There are some large data files not stored in the git repository, that
will be made available soon. For now, the tests that use these files will
not run.
Many of the tests are linked with both TokuKV and Berkeley DB, as a sanity
check on the tests themselves. To build these tests, you will need
Berkeley DB and its header files installed. If you do not have Berkeley
DB installed, just don't pass `USE_BDB=ON`.
In the build directory from above:
```sh
cmake -D BUILD_TESTING=ON [-D USE_BDB=ON] ..
ctest -D ExperimentalStart \
-D ExperimentalConfigure \
-D ExperimentalBuild \
-D ExperimentalTest
```
Contributing
------------
Please report bugs in TokuKV here on github.
We have two publicly accessible mailing lists:
- tokudb-user@googlegroups.com is for general and support related
questions about the use of TokuDB.
- tokudb-dev@googlegroups.com is for discussion of the development of
TokuDB.
We are also available on IRC on freenode.net, in the #tokutek channel.
License
-------
TokuKV is available under the GPL version 2, with slight modifications.
See [README-TOKUDB][license].
[license]: http://github.com/Tokutek/ft-index/blob/master/README-TOKUDB
{
bash
Memcheck:Leak
...
obj:/bin/bash
}
# Suppress some warnings we get from jemalloc and lzma, they aren't our fault.
.*third_party/jemalloc/src/jemalloc.c : .*-Wattributes.*
.*third_party/jemalloc/src/ctl.c : .*-Wunused-but-set-variable.*
.*xz/src/build_lzma/src/liblzma/lz/lz_encoder.c : .*-Wunused-but-set-variable.*
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/bash
out=$1; shift
exec \"$@\" >$out")
add_executable(make_tdb make_tdb)
set_property(TARGET make_tdb APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db.h"
COMMAND bash runcat.sh "${CMAKE_CURRENT_BINARY_DIR}/db.h" $<TARGET_FILE:make_tdb>
DEPENDS make_tdb)
add_custom_target(install_tdb_h DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/db.h")
# detect when we are being built as a subproject
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/db.h"
DESTINATION include
RENAME tokudb.h
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/db.h"
DESTINATION include
)
endif ()
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
# Copyright (c) 2009 Sun Microsystems, Inc.
# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# This script merges many static libraries into
# one big library on Unix.
SET(TARGET_LOCATION "@TARGET_LOCATION@")
SET(TARGET "@TARGET@")
SET(STATIC_LIBS "@STATIC_LIBS@")
SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(TEMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET})
MAKE_DIRECTORY(${TEMP_DIR})
# Extract each archive to its own subdirectory(avoid object filename clashes)
FOREACH(LIB ${STATIC_LIBS})
GET_FILENAME_COMPONENT(NAME_NO_EXT ${LIB} NAME_WE)
SET(TEMP_SUBDIR ${TEMP_DIR}/${NAME_NO_EXT})
MAKE_DIRECTORY(${TEMP_SUBDIR})
EXECUTE_PROCESS(
COMMAND ${CMAKE_AR} -x ${LIB}
WORKING_DIRECTORY ${TEMP_SUBDIR}
)
FILE(GLOB_RECURSE LIB_OBJECTS "${TEMP_SUBDIR}/*.o")
SET(OBJECTS ${OBJECTS} ${LIB_OBJECTS})
ENDFOREACH()
# Use relative paths, makes command line shorter.
GET_FILENAME_COMPONENT(ABS_TEMP_DIR ${TEMP_DIR} ABSOLUTE)
FOREACH(OBJ ${OBJECTS})
FILE(RELATIVE_PATH OBJ ${ABS_TEMP_DIR} ${OBJ})
FILE(TO_NATIVE_PATH ${OBJ} OBJ)
SET(ALL_OBJECTS ${ALL_OBJECTS} ${OBJ})
ENDFOREACH()
FILE(TO_NATIVE_PATH ${TARGET_LOCATION} ${TARGET_LOCATION})
# Now pack the objects into library with ar.
EXECUTE_PROCESS(
COMMAND ${CMAKE_AR} -r ${TARGET_LOCATION} ${ALL_OBJECTS}
WORKING_DIRECTORY ${TEMP_DIR}
)
EXECUTE_PROCESS(
COMMAND ${CMAKE_RANLIB} ${TARGET_LOCATION}
WORKING_DIRECTORY ${TEMP_DIR}
)
# Cleanup
FILE(REMOVE_RECURSE ${TEMP_DIR})
# - Try to find BDB
# Once done this will define
# BDB_FOUND - System has BDB
# BDB_INCLUDE_DIRS - The BDB include directories
# BDB_LIBRARIES - The libraries needed to use BDB
# BDB_DEFINITIONS - Compiler switches required for using BDB
find_path(BDB_INCLUDE_DIR db.h)
find_library(BDB_LIBRARY NAMES db libdb)
include(CheckSymbolExists)
## check if the found bdb has DB_TXN_SNAPSHOT
set(CMAKE_REQUIRED_INCLUDES ${BDB_INCLUDE_DIR})
check_symbol_exists(DB_TXN_SNAPSHOT "db.h" HAVE_DB_TXN_SNAPSHOT)
if(HAVE_DB_TXN_SNAPSHOT)
set(BDB_INCLUDE_DIRS ${BDB_INCLUDE_DIR})
set(BDB_LIBRARIES ${BDB_LIBRARY})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set BDB_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(BDB DEFAULT_MSG
BDB_LIBRARY BDB_INCLUDE_DIR)
mark_as_advanced(BDB_INCLUDE_DIR BDB_LIBRARY)
endif()
# Find Valgrind.
#
# This module defines:
# VALGRIND_INCLUDE_DIR, where to find valgrind/memcheck.h, etc.
# VALGRIND_PROGRAM, the valgrind executable.
# VALGRIND_FOUND, If false, do not try to use valgrind.
#
# If you have valgrind installed in a non-standard place, you can define
# VALGRIND_PREFIX to tell cmake where it is.
find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h)
find_program(VALGRIND_PROGRAM NAMES valgrind)
find_package_handle_standard_args(VALGRIND DEFAULT_MSG
VALGRIND_INCLUDE_DIR
VALGRIND_PROGRAM)
mark_as_advanced(VALGRIND_INCLUDE_DIR VALGRIND_PROGRAM)
## set up lists of sources and headers for tags
file(GLOB_RECURSE all_srcs
buildheader/*.cc
db-benchmark-test/*.cc
ft/*.cc
include/*.cc
locktree/*.cc
portability/*.cc
src/*.cc
toku_include/*.cc
utils/*.cc
util/*.cc
db-benchmark-test/*.cc
)
list(APPEND all_srcs
${CMAKE_CURRENT_BINARY_DIR}/ft/log_code.cc
${CMAKE_CURRENT_BINARY_DIR}/ft/log_print.cc
)
file(GLOB_RECURSE all_hdrs
buildheader/*.h
db-benchmark-test/*.h
ft/*.h
include/*.h
locktree/*.h
portability/*.h
src/*.h
toku_include/*.h
utils/*.h
util/*.h
db-benchmark-test/*.h
)
list(APPEND all_hdrs
${CMAKE_CURRENT_BINARY_DIR}/toku_include/toku_config.h
${CMAKE_CURRENT_BINARY_DIR}/buildheader/db.h
${CMAKE_CURRENT_BINARY_DIR}/ft/log_header.h
)
option(USE_CTAGS "Build the ctags database." ON)
if (USE_CTAGS AND
# Macs by default are not case-sensitive, so tags and TAGS clobber each other. Do etags and not ctags in that case, because Emacs is superior. :P
(NOT APPLE OR NOT USE_ETAGS))
find_program(CTAGS "ctags")
if (NOT CTAGS MATCHES NOTFOUND)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/tags"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ctags-stamp"
COMMAND ${CTAGS} -o tags ${all_srcs} ${all_hdrs}
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/ctags-stamp"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h generate_log_code
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_ctags ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/tags" ctags-stamp)
endif ()
endif ()
option(USE_ETAGS "Build the etags database." ON)
if (USE_ETAGS)
find_program(ETAGS "etags")
if (NOT ETAGS MATCHES NOTFOUND)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/TAGS"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/etags-stamp"
COMMAND ${ETAGS} -o TAGS ${all_srcs} ${all_hdrs}
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/etags-stamp"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h generate_log_code
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_etags ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/TAGS" etags-stamp)
endif ()
endif ()
option(USE_CSCOPE "Build the cscope database." ON)
if (USE_CSCOPE)
find_program(CSCOPE "cscope")
if (NOT CSCOPE MATCHES NOTFOUND)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cscope.files" "")
foreach(file ${all_srcs} ${all_hdrs})
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/cscope.files" "${file}\n")
endforeach(file)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.out"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.in.out"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.po.out"
COMMAND ${CSCOPE} -b -q -R -i"${CMAKE_CURRENT_BINARY_DIR}/cscope.files" -I"${CMAKE_CURRENT_SOURCE_DIR}" -I"${CMAKE_CURRENT_SOURCE_DIR}/include" -I"${CMAKE_CURRENT_SOURCE_DIR}/toku_include" -I"${CMAKE_CURRENT_SOURCE_DIR}/portability" -I"${CMAKE_CURRENT_SOURCE_DIR}/ft" -I"${CMAKE_CURRENT_SOURCE_DIR}/src" -I"${CMAKE_CURRENT_SOURCE_DIR}/locktree" -I"${CMAKE_CURRENT_SOURCE_DIR}/utils" -I"${CMAKE_CURRENT_SOURCE_DIR}/db-benchmark-test" -I"${CMAKE_CURRENT_BINARY_DIR}" -I"${CMAKE_CURRENT_BINARY_DIR}/toku_include" -I"${CMAKE_CURRENT_BINARY_DIR}/buildheader"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h generate_log_code
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_cscope.out ALL DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/cscope.out"
"${CMAKE_CURRENT_SOURCE_DIR}/cscope.in.out"
"${CMAKE_CURRENT_SOURCE_DIR}/cscope.po.out")
endif ()
endif ()
option(USE_GTAGS "Build the gtags database." ON)
if (USE_GTAGS)
find_program(GTAGS "gtags")
if (NOT GTAGS MATCHES NOTFOUND)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/gtags.files" "")
foreach(file ${all_srcs} ${all_hdrs})
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/gtags.files" "${file}\n")
endforeach(file)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GTAGS"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GRTAGS"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GPATH"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GSYMS"
COMMAND ${GTAGS} -f "${CMAKE_CURRENT_BINARY_DIR}/gtags.files"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h generate_log_code
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_GTAGS ALL DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/GTAGS"
"${CMAKE_CURRENT_SOURCE_DIR}/GRTAGS"
"${CMAKE_CURRENT_SOURCE_DIR}/GPATH"
"${CMAKE_CURRENT_SOURCE_DIR}/GSYMS")
endif ()
endif ()
option(USE_MKID "Build the idutils database." ON)
if (USE_MKID)
find_program(MKID "mkid")
if (NOT MKID MATCHES NOTFOUND)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/ID"
COMMAND ${MKID} ${all_srcs} ${all_hdrs}
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h generate_log_code
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_MKID ALL DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/ID")
endif ()
endif ()
## feature detection
find_package(Threads)
find_package(ZLIB REQUIRED)
option(USE_BDB "Build some tools and tests with bdb (requires a proper BerkeleyDB include directory and library)." ON)
if(USE_BDB)
find_package(BDB REQUIRED)
endif()
option(USE_VALGRIND "Build to run safely under valgrind (often slower)." ON)
if(USE_VALGRIND)
find_package(Valgrind REQUIRED)
endif()
option(TOKU_DEBUG_PARANOID "Enable paranoid asserts." ON)
include(CheckIncludeFiles)
## check for some include files
check_include_files(alloca.h HAVE_ALLOCA_H)
check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
check_include_files(byteswap.h HAVE_BYTESWAP_H)
check_include_files(endian.h HAVE_ENDIAN_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(libkern/OSAtomic.h HAVE_LIBKERN_OSATOMIC_H)
check_include_files(libkern/OSByteOrder.h HAVE_LIBKERN_OSBYTEORDER_H)
check_include_files(limits.h HAVE_LIMITS_H)
check_include_files(machine/endian.h HAVE_MACHINE_ENDIAN_H)
check_include_files(malloc.h HAVE_MALLOC_H)
check_include_files(malloc/malloc.h HAVE_MALLOC_MALLOC_H)
check_include_files(malloc_np.h HAVE_MALLOC_NP_H)
check_include_files(pthread.h HAVE_PTHREAD_H)
check_include_files(pthread_np.h HAVE_PTHREAD_NP_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(string.h HAVE_STRING_H)
check_include_files(syscall.h HAVE_SYSCALL_H)
check_include_files(sys/endian.h HAVE_SYS_ENDIAN_H)
check_include_files(sys/file.h HAVE_SYS_FILE_H)
check_include_files(sys/malloc.h HAVE_SYS_MALLOC_H)
check_include_files(sys/prctl.h HAVE_SYS_PRCTL_H)
check_include_files(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_files(sys/statvfs.h HAVE_SYS_STATVFS_H)
check_include_files(sys/syscall.h HAVE_SYS_SYSCALL_H)
check_include_files(sys/sysctl.h HAVE_SYS_SYSCTL_H)
check_include_files(sys/syslimits.h HAVE_SYS_SYSLIMITS_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(unistd.h HAVE_UNISTD_H)
include(CheckSymbolExists)
## check whether we can set the mmap threshold like we can in gnu libc's malloc
check_symbol_exists(M_MMAP_THRESHOLD "malloc.h" HAVE_M_MMAP_THRESHOLD)
## check whether we have CLOCK_REALTIME
check_symbol_exists(CLOCK_REALTIME "time.h" HAVE_CLOCK_REALTIME)
## check how to do direct I/O
if (NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
endif ()
check_symbol_exists(O_DIRECT "fcntl.h" HAVE_O_DIRECT)
check_symbol_exists(F_NOCACHE "fcntl.h" HAVE_F_NOCACHE)
check_symbol_exists(MAP_ANONYMOUS "sys/mman.h" HAVE_MAP_ANONYMOUS)
check_symbol_exists(PR_SET_PTRACER "sys/prctl.h" HAVE_PR_SET_PTRACER)
check_symbol_exists(PR_SET_PTRACER_ANY "sys/prctl.h" HAVE_PR_SET_PTRACER_ANY)
include(CheckFunctionExists)
## check for the right way to get the actual allocation size of a pointer
check_function_exists(malloc_size HAVE_MALLOC_SIZE)
check_function_exists(malloc_usable_size HAVE_MALLOC_USABLE_SIZE)
## check whether we have memalign or valloc (a weak substitute for memalign on darwin)
check_function_exists(memalign HAVE_MEMALIGN)
check_function_exists(valloc HAVE_VALLOC)
## check whether we have random_r or nrand48 to use as a reentrant random function
check_function_exists(nrand48 HAVE_NRAND48)
check_function_exists(random_r HAVE_RANDOM_R)
check_function_exists(mincore HAVE_MINCORE)
## clear this out in case mysql modified it
set(CMAKE_REQUIRED_LIBRARIES "")
set(EXTRA_SYSTEM_LIBS "")
check_function_exists(dlsym HAVE_DLSYM_WITHOUT_DL)
if (NOT HAVE_DLSYM_WITHOUT_DL)
set(CMAKE_REQUIRED_LIBRARIES dl)
check_function_exists(dlsym HAVE_DLSYM_WITH_DL)
if (HAVE_DLSYM_WITH_DL)
list(APPEND EXTRA_SYSTEM_LIBS dl)
else ()
message(FATAL_ERROR "Cannot find dlsym(), even with -ldl.")
endif ()
endif ()
check_function_exists(backtrace HAVE_BACKTRACE_WITHOUT_EXECINFO)
if (NOT HAVE_BACKTRACE_WITHOUT_EXECINFO)
set(CMAKE_REQUIRED_LIBRARIES execinfo)
check_function_exists(backtrace HAVE_BACKTRACE_WITH_EXECINFO)
if (HAVE_BACKTRACE_WITH_EXECINFO)
list(APPEND EXTRA_SYSTEM_LIBS execinfo)
else ()
message(FATAL_ERROR "Cannot find backtrace(), even with -lexecinfo.")
endif ()
endif ()
if(HAVE_CLOCK_REALTIME)
list(APPEND EXTRA_SYSTEM_LIBS rt)
else()
list(APPEND EXTRA_SYSTEM_LIBS System)
endif()
set(CMAKE_REQUIRED_LIBRARIES pthread)
## check whether we can change rwlock preference
check_function_exists(pthread_rwlockattr_setkind_np HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP)
## check for the right way to yield using pthreads
check_function_exists(pthread_yield HAVE_PTHREAD_YIELD)
check_function_exists(pthread_yield_np HAVE_PTHREAD_YIELD_NP)
## check if we have pthread_getthreadid_np() (i.e. freebsd)
check_function_exists(pthread_getthreadid_np HAVE_PTHREAD_GETTHREADID_NP)
include(CheckCSourceCompiles)
if (HAVE_PTHREAD_YIELD)
include(CheckPrototypeDefinition)
check_prototype_definition(pthread_yield "void pthread_yield(void)" 0 "pthread.h" PTHREAD_YIELD_RETURNS_VOID)
check_c_source_compiles("#include <pthread.h>
int main(void) {
int r = pthread_yield();
return r;
}" PTHREAD_YIELD_RETURNS_INT)
endif (HAVE_PTHREAD_YIELD)
## check whether we have gcc-style thread-local storage using a storage class modifier
check_c_source_compiles("#include <pthread.h>
static __thread int tlsvar = 0;
int main(void) { return tlsvar; }" HAVE_GNU_TLS)
## set TOKUDB_REVISION
set(CMAKE_TOKUDB_REVISION 0 CACHE INTEGER "Revision of tokudb.")
# Merge static libraries into a big static lib. The resulting library
# should not not have dependencies on other static libraries.
# We use it in MySQL to merge mysys,dbug,vio etc into mysqlclient
FUNCTION(TOKU_GET_DEPENDEND_OS_LIBS target result)
SET(deps ${${target}_LIB_DEPENDS})
IF(deps)
FOREACH(lib ${deps})
# Filter out keywords for used for debug vs optimized builds
IF(NOT lib MATCHES "general" AND NOT lib MATCHES "debug" AND NOT lib MATCHES "optimized")
GET_TARGET_PROPERTY(lib_location ${lib} LOCATION)
IF(NOT lib_location)
SET(ret ${ret} ${lib})
ENDIF()
ENDIF()
ENDFOREACH()
ENDIF()
SET(${result} ${ret} PARENT_SCOPE)
ENDFUNCTION(TOKU_GET_DEPENDEND_OS_LIBS)
MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
# To produce a library we need at least one source file.
# It is created by ADD_CUSTOM_COMMAND below and will helps
# also help to track dependencies.
SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.cc)
ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE})
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})
SET(OSLIBS)
FOREACH(LIB ${LIBS_TO_MERGE})
GET_TARGET_PROPERTY(LIB_LOCATION ${LIB} LOCATION)
GET_TARGET_PROPERTY(LIB_TYPE ${LIB} TYPE)
IF(NOT LIB_LOCATION)
# 3rd party library like libz.so. Make sure that everything
# that links to our library links to this one as well.
LIST(APPEND OSLIBS ${LIB})
ELSE()
# This is a target in current project
# (can be a static or shared lib)
IF(LIB_TYPE STREQUAL "STATIC_LIBRARY")
SET(STATIC_LIBS ${STATIC_LIBS} ${LIB_LOCATION})
ADD_DEPENDENCIES(${TARGET} ${LIB})
# Extract dependend OS libraries
TOKU_GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS)
LIST(APPEND OSLIBS ${LIB_OSLIBS})
ELSE()
# This is a shared library our static lib depends on.
LIST(APPEND OSLIBS ${LIB})
ENDIF()
ENDIF()
ENDFOREACH()
IF(OSLIBS)
LIST(REMOVE_DUPLICATES OSLIBS)
TARGET_LINK_LIBRARIES(${TARGET} ${OSLIBS})
ENDIF()
# Make the generated dummy source file depended on all static input
# libs. If input lib changes,the source file is touched
# which causes the desired effect (relink).
ADD_CUSTOM_COMMAND(
OUTPUT ${SOURCE_FILE}
COMMAND ${CMAKE_COMMAND} -E touch ${SOURCE_FILE}
DEPENDS ${STATIC_LIBS})
IF(MSVC)
# To merge libs, just pass them to lib.exe command line.
SET(LINKER_EXTRA_FLAGS "")
FOREACH(LIB ${STATIC_LIBS})
SET(LINKER_EXTRA_FLAGS "${LINKER_EXTRA_FLAGS} ${LIB}")
ENDFOREACH()
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES STATIC_LIBRARY_FLAGS
"${LINKER_EXTRA_FLAGS}")
ELSE()
GET_TARGET_PROPERTY(TARGET_LOCATION ${TARGET} LOCATION)
IF(APPLE)
# Use OSX's libtool to merge archives (ihandles universal
# binaries properly)
ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD
COMMAND rm ${TARGET_LOCATION}
COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}
${STATIC_LIBS}
)
ELSE()
# Generic Unix, Cygwin or MinGW. In post-build step, call
# script, that extracts objects from archives with "ar x"
# and repacks them with "ar r"
SET(TARGET ${TARGET})
CONFIGURE_FILE(
${TOKU_CMAKE_SCRIPT_DIR}/merge_archives_unix.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}.cmake
@ONLY
)
ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD
COMMAND rm ${TARGET_LOCATION}
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}.cmake
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}.cmake"
)
ENDIF()
ENDIF()
ENDMACRO(TOKU_MERGE_STATIC_LIBS)
## some functions for getting system info so we can construct BUILDNAME
## given an executable, follows symlinks and resolves paths until it runs
## out of symlinks, then gives you the basename
macro(real_executable_name filename_input out)
set(res 0)
set(filename ${filename_input})
while(NOT(res))
execute_process(
COMMAND which ${filename}
RESULT_VARIABLE res
OUTPUT_VARIABLE full_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT(res))
execute_process(
COMMAND readlink ${full_filename}
RESULT_VARIABLE res
OUTPUT_VARIABLE link_target
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT(res))
execute_process(
COMMAND dirname ${full_filename}
OUTPUT_VARIABLE filepath
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(filename "${filepath}/${link_target}")
else()
set(filename ${full_filename})
endif()
else()
set(filename ${filename})
endif()
endwhile()
execute_process(
COMMAND basename ${filename}
OUTPUT_VARIABLE real_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(${out} ${real_filename})
endmacro(real_executable_name)
## gives you `uname ${flag}`
macro(uname flag out)
execute_process(
COMMAND uname ${flag}
OUTPUT_VARIABLE ${out}
OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro(uname)
## gives the current username
macro(whoami out)
execute_process(
COMMAND whoami
OUTPUT_VARIABLE ${out}
OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro(whoami)
## gives the current hostname, minus .tokutek.com if it's there
macro(hostname out)
execute_process(
COMMAND hostname
OUTPUT_VARIABLE fullhostname
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} ${fullhostname})
endmacro(hostname)
## gather machine info
uname("-m" machine_type)
real_executable_name("${CMAKE_CXX_COMPILER}" real_cxx_compiler)
get_filename_component(branchname "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
hostname(host)
whoami(user)
## construct SITE, seems to have to happen before include(CTest)
set(SITE "${user}@${host}")
if (USE_GCOV)
set(buildname_build_type "Coverage")
else (USE_GCOV)
set(buildname_build_type "${CMAKE_BUILD_TYPE}")
endif (USE_GCOV)
## construct BUILDNAME, seems to have to happen before include(CTest)
set(BUILDNAME "${branchname} ${buildname_build_type} ${CMAKE_SYSTEM} ${machine_type} ${CMAKE_CXX_COMPILER_ID} ${real_cxx_compiler} ${CMAKE_CXX_COMPILER_VERSION}" CACHE STRING "CTest build name" FORCE)
include(CTest)
set(TOKUDB_DATA "${TokuDB_SOURCE_DIR}/../tokudb.data" CACHE FILEPATH "Path to data files for tests")
if (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
set(WARNED_ABOUT_DATA 0)
if (NOT EXISTS "${TOKUDB_DATA}/" AND NOT WARNED_ABOUT_DATA)
message(WARNING "Test data files are missing from ${TOKUDB_DATA}, which will cause some tests to fail. Please put them there or modify TOKUDB_DATA to avoid this.")
set(WARNED_ABOUT_DATA 1)
endif ()
## set up full valgrind suppressions file (concatenate the suppressions files)
file(READ ft/valgrind.suppressions valgrind_suppressions)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/valgrind.suppressions" "${valgrind_suppressions}")
file(READ src/tests/bdb.suppressions bdb_suppressions)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/valgrind.suppressions" "${bdb_suppressions}")
file(READ bash.suppressions bash_suppressions)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/valgrind.suppressions" "${bash_suppressions}")
include(CMakeDependentOption)
set(helgrind_drd_depend_conditions "")
## Helgrind and DRD explicitly state that they only run with the Linux
## glibc-2.3 NPTL threading implementation [1,2]. If this ever changes
## we can enable helgrind and drd on other systems.
## [1]: http://valgrind.org/docs/manual/hg-manual.html#hg-manual.effective-use
## [2]: http://valgrind.org/docs/manual/drd-manual.html#drd-manual.limitations
list(APPEND helgrind_drd_depend_conditions "CMAKE_SYSTEM_NAME STREQUAL Linux")
## no point doing it with gcov
list(APPEND helgrind_drd_depend_conditions "NOT USE_GCOV")
cmake_dependent_option(RUN_DRD_TESTS "Run some tests under drd." ON
"${helgrind_drd_depend_conditions}" OFF)
cmake_dependent_option(RUN_HELGRIND_TESTS "Run some tests under helgrind." ON
"${helgrind_drd_depend_conditions}" OFF)
macro(setup_toku_test_properties test str)
set_tests_properties(${test} PROPERTIES ENVIRONMENT "TOKU_TEST_FILENAME=${str}.ctest-data")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${str}.ctest-data")
endmacro(setup_toku_test_properties)
macro(add_toku_test_aux pfx name bin)
add_test(${pfx}/${name} ${bin} ${ARGN})
setup_toku_test_properties(${pfx}/${name} ${name})
endmacro(add_toku_test_aux)
macro(add_toku_test pfx bin)
add_toku_test_aux(${pfx} ${bin} ${bin} ${ARGN})
endmacro(add_toku_test)
## setup a function to write tests that will run with helgrind
set(CMAKE_HELGRIND_COMMAND_STRING "valgrind --quiet --tool=helgrind --error-exitcode=1 --soname-synonyms=somalloc=*tokuportability* --suppressions=${TokuDB_SOURCE_DIR}/src/tests/helgrind.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,grep,*/grep,date,*/date,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown,novalgrind")
function(add_helgrind_test pfx name)
separate_arguments(CMAKE_HELGRIND_COMMAND_STRING)
add_test(
NAME ${pfx}/${name}
COMMAND ${CMAKE_HELGRIND_COMMAND_STRING} ${ARGN}
)
setup_toku_test_properties(${pfx}/${name} ${name})
endfunction(add_helgrind_test)
## setup a function to write tests that will run with drd
set(CMAKE_DRD_COMMAND_STRING "valgrind --quiet --tool=drd --error-exitcode=1 --soname-synonyms=somalloc=*tokuportability* --suppressions=${TokuDB_SOURCE_DIR}/src/tests/drd.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,grep,*/grep,date,*/date,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown,novalgrind")
function(add_drd_test pfx name)
separate_arguments(CMAKE_DRD_COMMAND_STRING)
add_test(
NAME ${pfx}/${name}
COMMAND ${CMAKE_DRD_COMMAND_STRING} ${ARGN}
)
setup_toku_test_properties(${pfx}/${name} ${name})
endfunction(add_drd_test)
option(RUN_LONG_TESTS "If set, run all tests, even the ones that take a long time to complete." OFF)
option(RUN_STRESS_TESTS "If set, run the stress tests." OFF)
option(RUN_PERF_TESTS "If set, run the perf tests." OFF)
configure_file(CTestCustom.cmake . @ONLY)
endif (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
function(add_c_defines)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${ARGN})
endfunction(add_c_defines)
if (APPLE)
add_c_defines(DARWIN=1 _DARWIN_C_SOURCE)
endif ()
## preprocessor definitions we want everywhere
add_c_defines(
_FILE_OFFSET_BITS=64
_LARGEFILE64_SOURCE
__STDC_FORMAT_MACROS
__STDC_LIMIT_MACROS
__LONG_LONG_SUPPORTED
)
if (NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
## on FreeBSD these types of macros actually remove functionality
add_c_defines(
_SVID_SOURCE
_XOPEN_SOURCE=600
)
endif ()
## add TOKU_PTHREAD_DEBUG for debug builds
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD TOKU_PTHREAD_DEBUG=1)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD _FORTIFY_SOURCE=2)
## coverage
option(USE_GCOV "Use gcov for test coverage." OFF)
if (USE_GCOV)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES GNU)
message(FATAL_ERROR "Must use the GNU compiler to compile for test coverage.")
endif ()
find_program(COVERAGE_COMMAND NAMES gcov47 gcov)
endif (USE_GCOV)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
## adds a compiler flag if the compiler supports it
macro(set_cflags_if_supported_named flag flagname)
check_c_compiler_flag("${flag}" HAVE_C_${flagname})
if (HAVE_C_${flagname})
set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
endif ()
check_cxx_compiler_flag("${flag}" HAVE_CXX_${flagname})
if (HAVE_CXX_${flagname})
set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
endif ()
endmacro(set_cflags_if_supported_named)
## adds a compiler flag if the compiler supports it
macro(set_cflags_if_supported)
foreach(flag ${ARGN})
check_c_compiler_flag(${flag} HAVE_C_${flag})
if (HAVE_C_${flag})
set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
endif ()
check_cxx_compiler_flag(${flag} HAVE_CXX_${flag})
if (HAVE_CXX_${flag})
set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
endif ()
endforeach(flag)
endmacro(set_cflags_if_supported)
## adds a linker flag if the compiler supports it
macro(set_ldflags_if_supported)
foreach(flag ${ARGN})
check_cxx_compiler_flag(${flag} HAVE_${flag})
if (HAVE_${flag})
set(CMAKE_EXE_LINKER_FLAGS "${flag} ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${flag} ${CMAKE_SHARED_LINKER_FLAGS}")
endif ()
endforeach(flag)
endmacro(set_ldflags_if_supported)
## disable some warnings
set_cflags_if_supported(
-Wno-missing-field-initializers
-Wstrict-null-sentinel
-Winit-self
-Wswitch
-Wtrampolines
-Wlogical-op
-Wmissing-format-attribute
-Wno-error=missing-format-attribute
-Wno-error=address-of-array-temporary
-fno-rtti
-fno-exceptions
)
## set_cflags_if_supported_named("-Weffc++" -Weffcpp)
if (CMAKE_CXX_FLAGS MATCHES -fno-implicit-templates)
# must append this because mysql sets -fno-implicit-templates and we need to override it
check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates)
if (HAVE_CXX_-fimplicit-templates)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates")
endif ()
endif()
## Clang has stricter POD checks. So, only enable this warning on our other builds (Linux + GCC)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
set_cflags_if_supported(
-Wpacked
)
endif ()
## this hits with optimized builds somewhere in ftleaf_split, we don't
## know why but we don't think it's a big deal
set_cflags_if_supported(
-Wno-error=strict-overflow
)
set_ldflags_if_supported(
-Wno-error=strict-overflow
)
## set extra debugging flags and preprocessor definitions
set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0 ${CMAKE_CXX_FLAGS_DEBUG}")
## flags to use when we want to run DRD on the resulting binaries
## DRD needs debugging symbols.
## -O0 makes it too slow, and -O2 inlines too much for our suppressions to work. -O1 is just right.
set(CMAKE_C_FLAGS_DRD "-g3 -O1 ${CMAKE_C_FLAGS_DRD}")
set(CMAKE_CXX_FLAGS_DRD "-g3 -O1 ${CMAKE_CXX_FLAGS_DRD}")
## set extra release flags
## need to set flags for RelWithDebInfo as well because we want the MySQL/MariaDB builds to use them
if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
# have tried -flto and -O4, both make our statically linked executables break apple's linker
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-g -O3 ${CMAKE_C_FLAGS_RELEASE} -UNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 ${CMAKE_CXX_FLAGS_RELEASE} -UNDEBUG")
else ()
# we overwrite this because the default passes -DNDEBUG and we don't want that
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-flto -fuse-linker-plugin ${CMAKE_C_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-flto -fuse-linker-plugin ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-g -O3 -flto -fuse-linker-plugin ${CMAKE_C_FLAGS_RELEASE} -UNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -flto -fuse-linker-plugin ${CMAKE_CXX_FLAGS_RELEASE} -UNDEBUG")
set(CMAKE_EXE_LINKER_FLAGS "-g -fuse-linker-plugin ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-g -fuse-linker-plugin ${CMAKE_SHARED_LINKER_FLAGS}")
endif ()
## set warnings
set_cflags_if_supported(
-Wextra
-Wbad-function-cast
-Wno-missing-noreturn
-Wstrict-prototypes
-Wmissing-prototypes
-Wmissing-declarations
-Wpointer-arith
-Wmissing-format-attribute
-Wshadow
## other flags to try:
#-Wunsafe-loop-optimizations
#-Wpointer-arith
#-Wc++-compat
#-Wc++11-compat
#-Wwrite-strings
#-Wzero-as-null-pointer-constant
#-Wlogical-op
#-Wvector-optimization-performance
)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang)
# Disabling -Wcast-align with clang. TODO: fix casting and re-enable it, someday.
set_cflags_if_supported(-Wcast-align)
endif ()
## always want these
set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}")
## need to set -stdlib=libc++ to get real c++11 support on darwin
if (APPLE)
if (CMAKE_GENERATOR STREQUAL Xcode)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
else ()
add_definitions(-stdlib=libc++)
endif ()
endif ()
# pick language dialect
set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
check_cxx_compiler_flag(-std=c++11 HAVE_STDCXX11)
check_cxx_compiler_flag(-std=c++0x HAVE_STDCXX0X)
if (HAVE_STDCXX11)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
elseif (HAVE_STDCXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
else ()
message(FATAL_ERROR "${CMAKE_CXX_COMPILER} doesn't support -std=c++11 or -std=c++0x, you need one that does.")
endif ()
function(add_space_separated_property type obj propname val)
get_property(oldval ${type} ${obj} PROPERTY ${propname})
if (oldval MATCHES NOTFOUND)
set_property(${type} ${obj} PROPERTY ${propname} "${val}")
else ()
set_property(${type} ${obj} PROPERTY ${propname} "${val} ${oldval}")
endif ()
endfunction(add_space_separated_property)
## this function makes sure that the libraries passed to it get compiled
## with gcov-needed flags, we only add those flags to our libraries
## because we don't really care whether our tests get covered
function(maybe_add_gcov_to_libraries)
if (USE_GCOV)
foreach(lib ${ARGN})
add_space_separated_property(TARGET ${lib} COMPILE_FLAGS --coverage)
add_space_separated_property(TARGET ${lib} LINK_FLAGS --coverage)
target_link_libraries(${lib} gcov)
endforeach(lib)
endif (USE_GCOV)
endfunction(maybe_add_gcov_to_libraries)
include(ExternalProject)
## add jemalloc with an external project
set(JEMALLOC_SOURCE_DIR "${TokuDB_SOURCE_DIR}/third_party/jemalloc" CACHE FILEPATH "Where to find jemalloc sources.")
if (NOT EXISTS "${JEMALLOC_SOURCE_DIR}/configure")
message(FATAL_ERROR "Can't find jemalloc sources. Please check them out to ${JEMALLOC_SOURCE_DIR} or modify JEMALLOC_SOURCE_DIR.")
endif ()
set(jemalloc_configure_opts "CC=${CMAKE_C_COMPILER}" "--with-jemalloc-prefix=" "--with-private-namespace=tokudb_jemalloc_internal_" "--enable-cc-silence")
option(JEMALLOC_DEBUG "Build jemalloc with --enable-debug." OFF)
if (JEMALLOC_DEBUG)
list(APPEND jemalloc_configure_opts --enable-debug)
endif ()
ExternalProject_Add(build_jemalloc
PREFIX jemalloc
SOURCE_DIR "${JEMALLOC_SOURCE_DIR}"
CONFIGURE_COMMAND
"${JEMALLOC_SOURCE_DIR}/configure" ${jemalloc_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc"
)
add_library(jemalloc STATIC IMPORTED GLOBAL)
set_target_properties(jemalloc PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib/libjemalloc_pic.a")
add_dependencies(jemalloc build_jemalloc)
add_library(jemalloc_nopic STATIC IMPORTED GLOBAL)
set_target_properties(jemalloc_nopic PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib/libjemalloc.a")
add_dependencies(jemalloc_nopic build_jemalloc)
# detect when we are being built as a subproject
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
install(
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib"
DESTINATION .
)
endif ()
## add lzma with an external project
set(xz_configure_opts --with-pic --enable-static)
if (APPLE)
## lzma has some assembly that doesn't work on darwin
list(APPEND xz_configure_opts --disable-assembler)
endif ()
list(APPEND xz_configure_opts CC=${CMAKE_C_COMPILER})
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL drd)
list(APPEND xz_configure_opts --enable-debug)
endif ()
set(XZ_SOURCE_DIR "${TokuDB_SOURCE_DIR}/third_party/xz-4.999.9beta" CACHE FILEPATH "Where to find sources for xz (lzma).")
if (NOT EXISTS "${XZ_SOURCE_DIR}/configure")
message(FATAL_ERROR "Can't find the xz sources. Please check them out to ${XZ_SOURCE_DIR} or modify XZ_SOURCE_DIR.")
endif ()
if (CMAKE_GENERATOR STREQUAL Ninja)
## ninja doesn't understand "$(MAKE)"
set(SUBMAKE_COMMAND make)
else ()
## use "$(MAKE)" for submakes so they can use the jobserver, doesn't
## seem to break Xcode...
set(SUBMAKE_COMMAND $(MAKE))
endif ()
FILE(GLOB XZ_ALL_FILES ${XZ_SOURCE_DIR}/*)
ExternalProject_Add(build_lzma
PREFIX xz
DOWNLOAD_COMMAND
cp -au "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
CONFIGURE_COMMAND
"<SOURCE_DIR>/configure" ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
BUILD_COMMAND
${SUBMAKE_COMMAND} -C src/liblzma
INSTALL_COMMAND
${SUBMAKE_COMMAND} -C src/liblzma install
)
FILE(GLOB_RECURSE XZ_ALL_FILES_RECURSIVE ${XZ_SOURCE_DIR}/*)
ExternalProject_Add_Step(build_lzma reclone_src # Names of project and custom step
COMMENT "(re)cloning xz source..." # Text printed when step executes
DEPENDERS download configure # Steps that depend on this step
DEPENDS ${XZ_ALL_FILES_RECURSIVE} # Files on which this step depends
)
set_source_files_properties(
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/base.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/bcj.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/block.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/check.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/container.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/delta.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/filter.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/index.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/index_hash.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/lzma.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/stream_flags.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/subblock.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/version.h"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/vli.h"
PROPERTIES GENERATED TRUE)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include")
add_library(lzma STATIC IMPORTED)
set_target_properties(lzma PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib/liblzma.a")
add_dependencies(lzma build_lzma)
# detect when we are being built as a subproject
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
install(
FILES
db-insert.c
db-insert-multiple.c
db-scan.c
db-update.c
Makefile
README.examples
DESTINATION
examples
)
endif ()
\ No newline at end of file
SRCS = $(wildcard *.c)
TARGETS = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%-bdb,$(SRCS))
CPPFLAGS = -I../include -D_GNU_SOURCE
CFLAGS = -g -std=c99 -Wall -Wextra -Werror -Wno-missing-field-initializers
ifeq ($(USE_STATIC_LIBS),1)
LIBTOKUDB = tokufractaltree_static
LIBTOKUPORTABILITY = tokuportability_static
else
LIBTOKUDB = tokufractaltree
LIBTOKUPORTABILITY = tokuportability
endif
LDFLAGS = -L../lib -l$(LIBTOKUDB) -l$(LIBTOKUPORTABILITY) -Wl,-rpath,../lib -lpthread -lz -ldl
default local: $(TARGETS)
%: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS)
%-bdb: %.c
$(CC) -D_GNU_SOURCE -DBDB $(CFLAGS) $^ -o $@ -ldb
check: $(TARGETS)
./db-insert -x && ./db-scan --lwc --prelock --prelockflag
checknox: $(TARGETS)
./db-insert && ./db-scan --nox --lwc --prelock --prelockflag
clean:
rm -rf $(TARGETS) bench.* update.env.* insertm.env.*
The examples includes a pair of programs that can be compiled to use either the Berkeley DB library or the Tokutek Fractal Tree index library.
Note: The file formats are different from TokuDB and Berkley DB. Thus
you cannot access a database created by Berkeley DB using the Tokutek
DB, or vice-versa.
db-insert is a program that inserts random key-value pairs into a database.
db-scan is a program that scans through the key-value pairs, reading every row, from a database.
db-update is a program that upserts key-value pairs into a database. If the key already exists it increment a count in the value.
db-insert-multiple is a program and inserts key-value pairs into multiple databases. This is is now TokuDB maintains consistent
secondary databases.
To build it and run it (it's been tested on Fedora 10):
$ make (Makes the binaries)
Run the insertion workload under TokuDB:
$ ./db-insert
Run the insertion workload under BDB:
$ ./db-insert-bdb
Here is what the output looks like (this on a Thinkpad X61s laptop
running Fedora 10). BDB is a little faster for sequential insertions
(the first three columns), but much much slower for random insertions
(the next 3 columns), so that TokuDB is faster on combined workload.
$ ./db-insert
serial and random insertions of 1048576 per batch
serial 2.609965s 401759/s random 10.983798s 95466/s cumulative 13.593869s 154272/s
serial 3.053433s 343409/s random 12.008670s 87318/s cumulative 28.656115s 146367/s
serial 5.198312s 201715/s random 15.087426s 69500/s cumulative 48.954605s 128516/s
serial 6.096396s 171999/s random 13.550688s 77382/s cumulative 68.638321s 122215/s
Shutdown 4.025110s
Total time 72.677498s for 8388608 insertions = 115422/s
$ ./db-insert-bdb
serial and random insertions of 1048576 per batch
serial 2.623888s 399627/s random 8.770850s 119552/s cumulative 11.394805s 184045/s
serial 3.081946s 340232/s random 21.046589s 49822/s cumulative 35.523434s 118071/s
serial 14.160498s 74049/s random 497.117523s 2109/s cumulative 546.804504s 11506/s
serial 1.534212s 683462/s random 1128.525146s 929/s cumulative 1676.863892s 5003/s
Shutdown 195.879242s
Total time 1872.746582s for 8388608 insertions = 4479/s
The files are smaller for TokuDB than BDB.
$ ls -lh bench.tokudb/
total 39M
-rwxrwxr-x 1 bradley bradley 39M 2009-07-28 15:36 bench.db
$ ls -lh bench.bdb/
total 322M
-rw-r--r-- 1 bradley bradley 322M 2009-07-28 16:14 bench.db
When scanning the table, one can run out of locks with BDB. There are ways around it (increase the lock table size).
$ ./db-scan-bdb --nox
Lock table is out of available object entries
db-scan-bdb: db-scan.c:177: scanscan_hwc: Assertion `r==(-30988)' failed.
Aborted
TokuDB is fine on a big table scan.
$ ./db-scan --nox
Scan 33162304 bytes (2072644 rows) in 7.924463s at 4.184801MB/s
Scan 33162304 bytes (2072644 rows) in 3.062239s at 10.829431MB/s
0:3 1:53 2:56
miss=3 hit=53 wait_reading=0 wait=0
VmPeak: 244668 kB
VmHWM: 68096 kB
VmRSS: 1232 kB
The update-bdb program upserts 1B rows into a BDB database. When the database gets larger than memory, the throughput
should tank since every update needs to read a block from the storage system. The storage system becomes the performance
bottleneck. The program uses 1 1GB cache in front of the kernel's file system buffer cache. The program should hit the wall
at about 300M rows on a machine with 16GB of memory since keys are 8 bytes and values are 8 bytes in size.
$ ./db-update-bdb
The update program upserts 1B rows into a TokuDB database. Throughput should be not degrade significantly since the cost
of the storage system reads is amortized over 1000's of update operations. One should expect TokuDB to be at least 50 times
faster than BDB.
$ ./db-update
There isn't much documentation for the Tokutek Fractal Tree index library, but most of the API is like Berkeley DB's.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
## generate log_code.cc, log_print.cc, log_header.cc
set_source_files_properties(
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
"${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
PROPERTIES GENERATED TRUE)
add_executable(logformat logformat.cc)
target_link_libraries(logformat ${LIBTOKUPORTABILITY})
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
COMMAND $<TARGET_FILE:logformat> .
DEPENDS logformat
)
add_custom_target(
generate_log_code
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
)
set(FT_SOURCES
background_job_manager
block_allocator
block_table
cachetable
checkpoint
compress
dbufio
fifo
ft
ft-cachetable-wrappers
ft-flusher
ft-hot-flusher
ftloader
ftloader-callback
ft_msg
ft_node-serialize
ft-node-deserialize
ft-ops
ft-serialize
ft-test-helpers
ft-verify
key
leafentry
le-cursor
logcursor
logfilemgr
logger
log_upgrade
memarena
minicron
omt
pqueue
queue
quicklz
recover
rollback
rollback-apply
rollback-ct-callbacks
rollback_log_node_cache
roll
sub_block
txn
txn_child_manager
txn_manager
ule
x1764
xids
ybt
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
)
add_library(ft SHARED ${FT_SOURCES})
add_library(ft_static STATIC ${FT_SOURCES})
## we're going to link this into libtokudb.so so it needs to have PIC
set_target_properties(ft_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
maybe_add_gcov_to_libraries(ft ft_static)
## depend on other generated targets
add_dependencies(ft install_tdb_h generate_log_code build_lzma)
add_dependencies(ft_static install_tdb_h generate_log_code build_lzma)
## link with lzma (which should be static) and link dependers with zlib
target_link_libraries(ft LINK_PRIVATE util_static lzma ${LIBTOKUPORTABILITY})
target_link_libraries(ft LINK_PUBLIC z)
target_link_libraries(ft_static LINK_PRIVATE lzma)
## build the bins in this directory
foreach(tool tokuftdump tdb_logprint tdb-recover ftverify)
add_executable(${tool} ${tool})
add_dependencies(${tool} install_tdb_h)
target_link_libraries(${tool} ft_static util_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_space_separated_property(TARGET ${tool} COMPILE_FLAGS -fvisibility=hidden)
endforeach(tool)
# link in math.h library just for this tool.
target_link_libraries(ftverify m)
install(
TARGETS tokuftdump
DESTINATION bin
)
add_subdirectory(tests)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
CFLAGS = -O2 -Wall -W -Werror -g
LDFLAGS = -lz -lssl -g
adler32:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
CFLAGS = -O -Wall -W -Werror
LDFLAGS = -lz
cratio:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
LDFLAGS = -lz
CFLAGS = -O4 -Wall -W
hash-benchmark:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
CPPFLAGS= -D_GNU_SOURCE -I../../toku_include
CFLAGS=-O2 -Wall -W -Werror
LDFLAGS=-lpthread
default: trylock trylock-rdtsc mfence-benchmark process_locks pthread-locks
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment