Skip to content

Commit f37e29a

Browse files
Merge pull request #6 from fast-pack/revert-5-update_build_1
Revert "Update build review"
2 parents 1365331 + 6794a90 commit f37e29a

43 files changed

Lines changed: 1301 additions & 2702 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/buildwheels.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 32 deletions
This file was deleted.

.travis.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
language: cpp
2+
3+
matrix:
4+
fast_finish: true
5+
include:
6+
- os: linux
7+
env: PYTHON=2.7
8+
- os: linux
9+
env: PYTHON=3
10+
- os: osx
11+
env: PYTHON=3.6
12+
allow_failures:
13+
- os: osx
14+
15+
addons:
16+
apt:
17+
sources:
18+
- ubuntu-toolchain-r-test
19+
packages:
20+
- g++-4.9
21+
22+
before_install:
23+
- |
24+
PIP=pip
25+
PY=python
26+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.9 CC=gcc-4.9; fi
27+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
28+
brew update
29+
brew install gcc
30+
PIP=pip2
31+
PY=python2
32+
if [ "${PYTHON:0:1}" = "3" ]; then
33+
brew upgrade python
34+
brew install sashkab/python/python$PYTHON
35+
PIP=pip3
36+
PY=python3
37+
fi
38+
fi
39+
$PIP install --user virtualenv
40+
virtualenv -p $PY venv
41+
source venv/bin/activate
42+
$PIP install --upgrade pip
43+
$PIP install -qq setuptools
44+
45+
install:
46+
- |
47+
travis_wait travis_retry $PIP install -r python_bindings/requirements.txt
48+
travis_retry cd python_bindings && $PY setup.py build install && cd ..
49+
50+
script:
51+
- $PY --version
52+
- $PIP --version
53+
- |
54+
set -e
55+
cd python_bindings
56+
$PY setup.py test
57+
cd ..
58+
59+
cache:
60+
- apt
61+
- directories:
62+
- $HOME/.cache/pip
63+

CMakeLists.txt

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Apache License Version 2.0 http://www.apache.org/licenses/.
44
#
55
# This is a modified version of the CMakeFile
6-
# for the project https://github.com/lemire/FastPFor
7-
# This file can be used to
6+
# for the project https://github.com/lemire/FastPFor
7+
# This file can be used to
88
# 1) Build a library separately. Then, this library
99
# will be re-used by the Python build process
1010
# 2) Build and run unit and performance tests.
1111
#
12-
cmake_minimum_required(VERSION 3.10)
12+
cmake_minimum_required(VERSION 2.8.7)
1313
if (NOT CMAKE_BUILD_TYPE)
1414
message(STATUS "No build type selected, default to Release")
1515
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
@@ -21,7 +21,7 @@ include(AppendCompilerFlags)
2121

2222

2323
project(PyFastPFor CXX C)
24-
set(PROJECT_URL "https://github.com/fast-pack/PyFastPFOR")
24+
set(PROJECT_URL "https://github.com/searchivarius/PyFastPFOR")
2525
set(PROJECT_DESCRIPTION "Python bindings for the FastPFOR C++ library: Fast integer compression")
2626
include(DetectCPUFeatures)
2727
#
@@ -54,10 +54,8 @@ MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
5454
MESSAGE( STATUS "CXX_COMPILER_VERSION: " ${CXX_COMPILER_VERSION} )
5555
if( SUPPORT_SSE42 )
5656
MESSAGE( STATUS "SSE 4.2 support detected" )
57-
elseif( SUPPORT_NEON )
58-
MESSAGE( STATUS "ARM NEON detected: SSE intrinsics are emulated via fastpfor_neon.h" )
5957
else()
60-
MESSAGE( STATUS "Neither SSE 4.2 nor ARM NEON support detected" )
58+
MESSAGE( STATUS "SSE 4.2 support not detected" )
6159
endif()
6260

6361
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -81,21 +79,14 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
8179
set (CMAKE_CXX_FLAGS_DEBUG "-Wall -ggdb -std=c++11 -DHAVE_CXX0X -march=native")
8280
set (CMAKE_C_FLAGS_RELEASE "-Wall -Ofast -DNDEBUG -std=c99 -march=native")
8381
set (CMAKE_C_FLAGS_DEBUG "-Wall -ggdb -std=c99 -march=native")
84-
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
82+
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
8583
if (CXX_COMPILER_VERSION VERSION_LESS 4.2.1)
8684
message(STATUS "Clang version must be at least 4.2.1!" )
8785
endif()
88-
# -msse4.1 is x86-only and rejected on ARM; -march=native already enables the
89-
# available SIMD (SSE/AVX on x86, NEON on ARM), so only add it off ARM.
90-
if (SUPPORT_NEON)
91-
set (SIMD_FLAGS "-march=native")
92-
else()
93-
set (SIMD_FLAGS "-msse4.1 -march=native")
94-
endif()
95-
set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c++11 -DHAVE_CXX0X ${SIMD_FLAGS}")
96-
set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X ${SIMD_FLAGS}")
97-
set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 ${SIMD_FLAGS}")
98-
set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 ${SIMD_FLAGS}")
86+
set (CMAKE_CXX_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c++11 -DHAVE_CXX0X -msse4.1 -march=native")
87+
set (CMAKE_CXX_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c++11 -DHAVE_CXX0X -msse4.1 -march=native")
88+
set (CMAKE_C_FLAGS_RELEASE "-Wall -Wcast-align -O3 -DNDEBUG -std=c99 -msse4.1 -march=native")
89+
set (CMAKE_C_FLAGS_DEBUG "-Wall -Wcast-align -ggdb -std=c99 -msse4.1 -march=native")
9990
elseif(WIN32)
10091
# TODO add support for later versions?
10192
if(NOT MSVC12)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ or via pip:
1919
```
2020
pip install pyfastpfor
2121
```
22-
The bindings build with GCC or Clang, on both x86-64 (SSE/AVX) and ARM/aarch64 (NEON, including Apple Silicon). You may also need to install Python dev-files. On Ubuntu, for Python 3 you can do it as follows:
22+
Due to some compilation quirks this currently seem to work with GCC only. I will fix it in some not so distant future. You may also need to install Python dev-files. On Ubuntu, for Python 3 you can do it as follows:
2323

2424
```
2525
sudo apt-get install python3-dev
@@ -28,7 +28,7 @@ sudo apt-get install python3-dev
2828

2929
# Documentation
3030

31-
The library supports all the codecs implemented in the original [FastPFor](https://github.com/lemire/FastPFor) library (v0.5.0). To get a list of codecs, use the function ``getCodecList``.
31+
The library supports all the codecs implemented in the original [FastPFor](https://github.com/lemire/FastPFor) library by July 2023. To get a list of codecs, use the function ``getCodecList``.
3232

3333
Typical light-weight compression does not take context into account and, consequently, works well only for small integers. When integers are large, data differencing is a common trick to make integers small. In particular, we often deal with sorted lists of integers, which can be represented by differences between neighboring numbers.
3434

cmake_modules/DetectCPUFeatures.cmake

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,7 @@ else()
4747
check_cxx_source_compiles("${AVXPROG}" SUPPORT_AVX)
4848
set(CMAKE_REQUIRED_FLAGS "-march=native -mavx2")
4949
check_cxx_source_compiles("${AVX2PROG}" SUPPORT_AVX2)
50-
endif()
50+
endif()
5151

5252
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
53-
54-
# On ARM the SSE intrinsics used throughout FastPFor are provided by the
55-
# fastpfor_neon.h shim (mapped onto NEON), so there is no SSE4.2 support but the
56-
# code still compiles. Flag ARM builds so the SIMD-specific compiler options
57-
# (e.g. -msse4.1) can be skipped.
58-
if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm"
59-
OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64"
60-
OR CMAKE_GENERATOR_PLATFORM MATCHES "ARM64" OR CMAKE_GENERATOR_PLATFORM MATCHES "ARM")
61-
set(SUPPORT_NEON ON)
62-
endif ()
6353

headers/VarIntG8IU.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This code is released under the
33
* Apache License Version 2.0 http://www.apache.org/licenses/.
44
*/
5-
#if (!defined(__SSSE3__) && !(defined(_MSC_VER) && defined(__AVX__))) && !(defined(__ARM_NEON) || defined(__aarch64__))
5+
#if !defined(__SSSE3__) && !(defined(_MSC_VER) && defined(__AVX__))
66
#ifndef _MSC_VER
77
#pragma message \
88
"Disabling varintg8iu due to lack of SSSE3 support, try adding -mssse3 or the equivalent on your compiler"
@@ -12,12 +12,7 @@
1212
#else
1313
#ifndef VARINTG8IU_H__
1414
#define VARINTG8IU_H__
15-
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
1615
#include <emmintrin.h>
17-
#elif defined(__aarch64__)
18-
/* GCC-compatible compiler, targeting ARM with native NEON */
19-
#include "fastpfor_neon.h"
20-
#endif
2116
#include "codecs.h"
2217
#ifdef __GNUC__
2318
#define PREDICT_FALSE(x) (__builtin_expect(x, 0))

headers/blockpacking.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ class ByteAlignedPacking : public IntegerCODEC {
286286

287287
const uint32_t *decodeArray(const uint32_t *in, const size_t length,
288288
uint32_t *out, size_t &nvalue) {
289-
(void)length;
290289
const uint32_t actuallength = *in++;
291290
const uint8_t *inbyte = reinterpret_cast<const uint8_t *>(in);
292291
const uint32_t *const initout(out);

headers/codecfactory.h

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,54 +21,15 @@ class CODECFactory {
2121
public:
2222
CODECFactory();
2323

24-
std::vector<std::shared_ptr<IntegerCODEC>> allSchemes() const;
24+
std::vector<std::shared_ptr<IntegerCODEC>> allSchemes();
2525

26-
std::vector<std::string> allNames() const;
26+
std::vector<std::string> allNames();
2727

28-
std::shared_ptr<IntegerCODEC> const& getFromName(std::string name) const;
28+
std::shared_ptr<IntegerCODEC> &getFromName(std::string name);
2929
private:
3030
CodecMap scodecmap;
3131
};
3232

33-
std::unique_ptr<IntegerCODEC> fastbinarypacking8_codec();
34-
std::unique_ptr<IntegerCODEC> fastbinarypacking16_codec();
35-
std::unique_ptr<IntegerCODEC> fastbinarypacking32_codec();
36-
std::unique_ptr<IntegerCODEC> BP32_codec();
37-
std::unique_ptr<IntegerCODEC> vsencoding_codec();
38-
std::unique_ptr<IntegerCODEC> fastpfor128_codec();
39-
std::unique_ptr<IntegerCODEC> fastpfor256_codec();
40-
std::unique_ptr<IntegerCODEC> simdfastpfor128_codec();
41-
std::unique_ptr<IntegerCODEC> simdfastpfor256_codec();
42-
std::unique_ptr<IntegerCODEC> simplepfor_codec();
43-
std::unique_ptr<IntegerCODEC> simdsimplepfor_codec();
44-
std::unique_ptr<IntegerCODEC> pfor_codec();
45-
std::unique_ptr<IntegerCODEC> simdpfor_codec();
46-
std::unique_ptr<IntegerCODEC> pfor2008_codec();
47-
std::unique_ptr<IntegerCODEC> simdnewpfor_codec();
48-
std::unique_ptr<IntegerCODEC> newpfor_codec();
49-
std::unique_ptr<IntegerCODEC> optpfor_codec();
50-
std::unique_ptr<IntegerCODEC> simdoptpfor_codec();
51-
std::unique_ptr<IntegerCODEC> varint_codec();
52-
std::unique_ptr<IntegerCODEC> vbyte_codec();
53-
std::unique_ptr<IntegerCODEC> maskedvbyte_codec();
54-
std::unique_ptr<IntegerCODEC> streamvbyte_codec();
55-
std::unique_ptr<IntegerCODEC> varintgb_codec();
56-
std::unique_ptr<IntegerCODEC> simple16_codec();
57-
std::unique_ptr<IntegerCODEC> simple9_codec();
58-
std::unique_ptr<IntegerCODEC> simple9_rle_codec();
59-
std::unique_ptr<IntegerCODEC> simple8b_codec();
60-
std::unique_ptr<IntegerCODEC> simple8b_rle_codec();
61-
#ifdef VARINTG8IU_H__
62-
std::unique_ptr<IntegerCODEC> varintg8iu_codec();
63-
#endif
64-
#ifdef USESNAPPY
65-
std::unique_ptr<IntegerCODEC> snappy_codec();
66-
#endif
67-
std::unique_ptr<IntegerCODEC> simdbinarypacking_codec();
68-
std::unique_ptr<IntegerCODEC> simdgroupsimple_codec();
69-
std::unique_ptr<IntegerCODEC> simdgroupsimple_ringbuf_codec();
70-
std::unique_ptr<IntegerCODEC> copy_codec();
71-
7233
} // namespace FastPForLib
7334

7435
#endif /* CODECFACTORY_H_ */

headers/codecs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ class IntegerCODEC {
5353
* of the variable nvalue gets updated with the number actually use
5454
* (if nvalue exceeds the original value, there might be a buffer
5555
* overrun).
56-
*
57-
* NOTE: Decoding can be performed with an unknown input length. This
58-
* case is indicated by a length of 0; however, nvalue must be provided
59-
* in order for the decoder knows how many values to decode.
6056
*/
6157
virtual const uint32_t *decodeArray(const uint32_t *in, const size_t length,
6258
uint32_t *out, size_t &nvalue) = 0;

0 commit comments

Comments
 (0)