Skip to content

Commit

Permalink
Merge remote-tracking branch 'fstpackage/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusKlik committed Apr 4, 2019
2 parents 306aee4 + ea73cf1 commit 77b3721
Show file tree
Hide file tree
Showing 45 changed files with 5,653 additions and 1,133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.vs/*
/build/*
*.o
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/MarcusKlik/fstlib.svg?branch=develop)](https://travis-ci.org/MarcusKlik/fstlib)
[![Build Status](https://travis-ci.org/fstpackage/fstlib.svg?branch=develop)](https://travis-ci.org/fstpackage/fstlib)

# The fst format and fstlib library

Expand Down Expand Up @@ -29,8 +29,6 @@ The `fstlib` library was designed with four goals in mind:
* **full (almost) random access**: `fstlib` was designed to facilitate computational platforms. Therefore, data in the format can be access with almost full random access, both in columns- and rows. This allows for high-speed chunk-based processing of data, crucial for larger-than-memory analytics.
* **flexibility**: `fstlib` needs an interface to columnar in-memory data, but is agnostic to the memory management and precise format of that data. That makes it very effective for use with wide range of in-memory table-like containers without any overhead for copying data. It can handle `arrow` memory structures, but also native `R` vectors, all zero-copy.



## Use cases

Currently, the main use case for `fstlib` is `R`'s [`fst` package](http://www.fstpackage.org/). In that package, `fstlib` provides the backend for accessing `fst` files with very high speeds up to multiple GB/s. In the future, `fstlib` will be part of similar packages for other languages such as `Python`, `Julia`, and `Rust`.
44 changes: 28 additions & 16 deletions ext/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ set(gtest_build_include_dirs
"${gtest_SOURCE_DIR}")
include_directories(${gtest_build_include_dirs})

# Summary of tuple support for Microsoft Visual Studio:
# Compiler version(MS) version(cmake) Support
# ---------- ----------- -------------- -----------------------------
# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple.
# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10
# VS 2013 12 1800 std::tr1::tuple
# VS 2015 14 1900 std::tuple
# VS 2017 15 >= 1910 std::tuple
if (MSVC AND MSVC_VERSION EQUAL 1700)
add_definitions(/D _VARIADIC_MAX=10)
endif()

########################################################################
#
# Defines the gtest & gtest_main libraries. User tests should link
Expand Down Expand Up @@ -175,20 +187,6 @@ if (gtest_build_tests)
# 'make test' or ctest.
enable_testing()

if (WIN32)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/RunTest.ps1"
CONTENT
"$project_bin = \"${CMAKE_BINARY_DIR}/bin/$<CONFIG>\"
$env:Path = \"$project_bin;$env:Path\"
& $args")
elseif (MINGW)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1"
CONTENT
"$project_bin = (cygpath --windows ${CMAKE_BINARY_DIR}/bin)
$env:Path = \"$project_bin;$env:Path\"
& $args")
endif()

############################################################
# C++ tests built with standard compiler flags.

Expand Down Expand Up @@ -219,7 +217,6 @@ $env:Path = \"$project_bin;$env:Path\"
test/gtest-typed-test2_test.cc)
cxx_test(gtest_unittest gtest_main)
cxx_test(gtest-unittest-api_test gtest)
cxx_test(gtest_skip_test gtest_main)

############################################################
# C++ tests built with non-standard compiler flags.
Expand Down Expand Up @@ -253,6 +250,21 @@ $env:Path = \"$project_bin;$env:Path\"
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")

if (NOT MSVC OR MSVC_VERSION LESS 1600) # 1600 is Visual Studio 2010.
# Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that
# conflict with our own definitions. Therefore using our own tuple does not
# work on those compilers.
cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
src/gtest-all.cc src/gtest_main.cc)

cxx_test_with_flags(googletest-tuple-test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple test/googletest-tuple-test.cc)

cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple
test/googletest-param-test-test.cc test/googletest-param-test2-test.cc)
endif()

############################################################
# Python tests.

Expand Down Expand Up @@ -316,4 +328,4 @@ $env:Path = \"$project_bin;$env:Path\"
cxx_executable(gtest_xml_output_unittest_ test gtest)
py_test(gtest_xml_output_unittest --no_stacktrace_support)
py_test(googletest-json-output-unittest --no_stacktrace_support)
endif()
endif()
5 changes: 2 additions & 3 deletions ext/gtest/cmake/gtest.pc.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
prefix=${pcfiledir}/../..
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: gtest
Description: GoogleTest (without main() function)
Expand Down
5 changes: 2 additions & 3 deletions ext/gtest/cmake/gtest_main.pc.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
prefix=${pcfiledir}/../..
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: gtest_main
Description: GoogleTest (with main() function)
Expand Down
91 changes: 20 additions & 71 deletions ext/gtest/cmake/internal_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ macro(config_compiler_and_linker)
"${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")
set(cxx_default "${cxx_exception}")
set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}")
set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1")

# For building the gtest libraries.
set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
Expand All @@ -166,22 +167,6 @@ function(cxx_library_with_type name type cxx_flags)
set_target_properties(${name}
PROPERTIES
DEBUG_POSTFIX "d")
# Set the output directory for build artifacts
set_target_properties(${name}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# make PDBs match library name
get_target_property(pdb_debug_postfix ${name} DEBUG_POSTFIX)
set_target_properties(${name}
PROPERTIES
PDB_NAME "${name}"
PDB_NAME_DEBUG "${name}${pdb_debug_postfix}"
COMPILE_PDB_NAME "${name}"
COMPILE_PDB_NAME_DEBUG "${name}${pdb_debug_postfix}")

if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
set_target_properties(${name}
PROPERTIES
Expand Down Expand Up @@ -259,13 +244,7 @@ find_package(PythonInterp)
# from the given source files with the given compiler flags.
function(cxx_test_with_flags name cxx_flags libs)
cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
if (WIN32 OR MINGW)
add_test(NAME ${name}
COMMAND "powershell" "-Command" "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/RunTest.ps1" "$<TARGET_FILE:${name}>")
else()
add_test(NAME ${name}
COMMAND "$<TARGET_FILE:${name}>")
endif()
add_test(NAME ${name} COMMAND ${name})
endfunction()

# cxx_test(name libs srcs...)
Expand All @@ -284,51 +263,33 @@ endfunction()
# test/name.py. It does nothing if Python is not installed.
function(py_test name)
if (PYTHONINTERP_FOUND)
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 3.1)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
if (CMAKE_CONFIGURATION_TYPES)
# Multi-configuration build generators as for Visual Studio save
# output in a subdirectory of CMAKE_CURRENT_BINARY_DIR (Debug,
# Release etc.), so we have to provide it here.
if (WIN32 OR MINGW)
add_test(NAME ${name}
COMMAND powershell -Command ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/RunTest.ps1
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG> ${ARGN})
else()
add_test(NAME ${name}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
# Multi-configuration build generators as for Visual Studio save
# output in a subdirectory of CMAKE_CURRENT_BINARY_DIR (Debug,
# Release etc.), so we have to provide it here.
add_test(
NAME ${name}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG> ${ARGN})
endif()
else (CMAKE_CONFIGURATION_TYPES)
# Single-configuration build generators like Makefile generators
# don't have subdirs below CMAKE_CURRENT_BINARY_DIR.
if (WIN32 OR MINGW)
add_test(NAME ${name}
COMMAND powershell -Command ${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR} ${ARGN})
else()
add_test(NAME ${name}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
# Single-configuration build generators like Makefile generators
# don't have subdirs below CMAKE_CURRENT_BINARY_DIR.
add_test(
NAME ${name}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR} ${ARGN})
endif()
endif (CMAKE_CONFIGURATION_TYPES)
else()
else (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
# ${CMAKE_CURRENT_BINARY_DIR} is known at configuration time, so we can
# directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
# only at ctest runtime (by calling ctest -c <Configuration>), so
# we have to escape $ to delay variable substitution here.
if (WIN32 OR MINGW)
add_test(NAME ${name}
COMMAND powershell -Command ${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN})
else()
add_test(NAME ${name}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN})
endif()
endif()
add_test(
${name}
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN})
endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
endif(PYTHONINTERP_FOUND)
endfunction()

Expand All @@ -345,18 +306,6 @@ function(install_project)
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# Install PDBs
foreach(t ${ARGN})
get_target_property(t_pdb_name ${t} COMPILE_PDB_NAME)
get_target_property(t_pdb_name_debug ${t} COMPILE_PDB_NAME_DEBUG)
get_target_property(t_pdb_output_directory ${t} PDB_OUTPUT_DIRECTORY)
install(FILES
"${t_pdb_output_directory}/\${CMAKE_INSTALL_CONFIG_NAME}/$<$<CONFIG:Debug>:${t_pdb_name_debug}>$<$<NOT:$<CONFIG:Debug>>:${t_pdb_name}>.pdb"
DESTINATION ${CMAKE_INSTALL_LIBDIR}
OPTIONAL)
endforeach()
endif()
# Configure and install pkgconfig files.
foreach(t ${ARGN})
set(configured_pc "${generated_dir}/${t}.pc")
Expand Down
7 changes: 3 additions & 4 deletions ext/gtest/include/gtest/gtest-message.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_

#include <limits>
#include <memory>

#include "gtest/internal/gtest-port.h"

Expand Down Expand Up @@ -152,7 +151,7 @@ class GTEST_API_ Message {
// as "(null)".
template <typename T>
inline Message& operator <<(T* const& pointer) { // NOLINT
if (pointer == nullptr) {
if (pointer == NULL) {
*ss_ << "(null)";
} else {
*ss_ << pointer;
Expand Down Expand Up @@ -208,7 +207,7 @@ class GTEST_API_ Message {
// tr1::type_traits-like is_pointer works, and we can overload on that.
template <typename T>
inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
if (pointer == nullptr) {
if (pointer == NULL) {
*ss_ << "(null)";
} else {
*ss_ << pointer;
Expand All @@ -225,7 +224,7 @@ class GTEST_API_ Message {
#endif // GTEST_OS_SYMBIAN

// We'll hold the text streamed to this object here.
const std::unique_ptr< ::std::stringstream> ss_;
const internal::scoped_ptr< ::std::stringstream> ss_;

// We declare (but don't implement) this to prevent the compiler
// from implementing the assignment operator.
Expand Down
Loading

0 comments on commit 77b3721

Please sign in to comment.