Skip to content

Commit 3672c4c

Browse files
authored
General cleanup (#64)
Create pisa library Declare dependency for gumbo Fix #60 Fix #22
1 parent e3a3121 commit 3672c4c

File tree

114 files changed

+525
-657
lines changed

Some content is hidden

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

114 files changed

+525
-657
lines changed

CMakeLists.txt

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
set(CMAKE_CXX_EXTENSIONS OFF)
77

88
configure_file(
9-
${DS2I_SOURCE_DIR}/include/ds2i_config.hpp.in
10-
${DS2I_SOURCE_DIR}/include/ds2i_config.hpp
9+
${DS2I_SOURCE_DIR}/include/pisa/ds2i_config.hpp.in
10+
${DS2I_SOURCE_DIR}/include/pisa/ds2i_config.hpp
1111
ESCAPE_QUOTES)
1212

1313
if(NOT CMAKE_BUILD_TYPE)
@@ -31,6 +31,7 @@ set_target_properties(gumbo::gumbo PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
3131
${CMAKE_CURRENT_SOURCE_DIR}/external/gumbo-parser/src)
3232
set_property(TARGET gumbo::gumbo APPEND PROPERTY IMPORTED_LOCATION
3333
${CMAKE_BINARY_DIR}/gumbo-parser/lib/libgumbo.a)
34+
add_dependencies( gumbo::gumbo gumbo-external )
3435

3536
# Add code coverage
3637
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/CMake-codecov/cmake")
@@ -63,11 +64,29 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
6364
find_package(Threads REQUIRED)
6465
link_libraries(Threads::Threads)
6566

66-
# add the root directory to include path to make includes absolute
67-
include_directories(${DS2I_SOURCE_DIR}/external
68-
${STXXL_INCLUDE_DIRS}
69-
${DS2I_SOURCE_DIR}/include
70-
)
67+
68+
include_directories(include)
69+
add_library(pisa INTERFACE)
70+
target_include_directories(pisa INTERFACE
71+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/pisa>
72+
)
73+
target_link_libraries(pisa INTERFACE
74+
Threads::Threads
75+
Boost::boost
76+
QMX
77+
mio
78+
ParallelSTL
79+
GSL
80+
FastPFor
81+
streamvbyte
82+
MaskedVByte
83+
simdcomp
84+
gumbo::gumbo
85+
Boost::filesystem
86+
Porter2
87+
warcpp
88+
)
89+
target_include_directories(pisa INTERFACE external)
7190

7291
add_subdirectory(src)
7392

benchmarks/CMakeLists.txt

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,19 @@
11
add_executable(index_perftest index_perftest.cpp)
22
target_link_libraries(index_perftest
3-
Boost::boost
4-
mio
5-
FastPFor
6-
streamvbyte
7-
MaskedVByte
8-
QMX
9-
simdcomp
10-
ParallelSTL
11-
GSL
12-
)
3+
pisa
4+
)
135

146
add_executable(perftest_interpolative perftest_interpolative.cpp)
157
target_link_libraries(perftest_interpolative
16-
Boost::boost
17-
mio
18-
FastPFor
19-
QMX
20-
simdcomp
21-
GSL
22-
)
8+
pisa
9+
)
2310

2411
add_executable(selective_queries selective_queries.cpp)
2512
target_link_libraries(selective_queries
26-
Boost::boost
27-
mio
28-
FastPFor
29-
streamvbyte
30-
MaskedVByte
31-
QMX
32-
simdcomp
33-
ParallelSTL
34-
GSL
35-
)
13+
pisa
14+
)
3615

3716
add_executable(scan_perftest scan_perftest.cpp)
3817
target_link_libraries(scan_perftest
39-
Boost::boost
40-
mio
41-
ParallelSTL
42-
GSL
43-
)
18+
pisa
19+
)

benchmarks/index_perftest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include "index_types.hpp"
55
#include "util/util.hpp"
66

7-
using ds2i::logger;
8-
using ds2i::get_time_usecs;
9-
using ds2i::do_not_optimize_away;
7+
using pisa::logger;
8+
using pisa::get_time_usecs;
9+
using pisa::do_not_optimize_away;
1010

1111
template <typename IndexType, bool with_freqs>
1212
void perftest(IndexType const& index, std::string const& type)
@@ -65,7 +65,7 @@ void perftest(IndexType const& index, std::string const& type)
6565
if (size < min_length) continue;
6666

6767
skip_values.emplace_back(i, std::vector<uint64_t>());
68-
for (size_t i = 0; i < std::min(ds2i::ceil_div(size, skip),
68+
for (size_t i = 0; i < std::min(pisa::ceil_div(size, skip),
6969
max_calls_per_list); ++i) {
7070
reader.move(i * skip);
7171
skip_values.back().second.push_back(reader.docid());
@@ -106,7 +106,7 @@ void perftest(const char* index_filename, std::string const& type)
106106
logger() << "Loading index from " << index_filename << std::endl;
107107
IndexType index;
108108
mio::mmap_source m(index_filename);
109-
ds2i::mapper::map(index, m, ds2i::mapper::map_flags::warmup);
109+
pisa::mapper::map(index, m, pisa::mapper::map_flags::warmup);
110110

111111
perftest<IndexType, false>(index, type);
112112
perftest<IndexType, true>(index, type);
@@ -115,7 +115,7 @@ void perftest(const char* index_filename, std::string const& type)
115115

116116
int main(int argc, const char** argv) {
117117

118-
using namespace ds2i;
118+
using namespace pisa;
119119

120120
if (argc != 3) {
121121
std::cerr << "Usage: " << argv[0]

benchmarks/perftest_interpolative.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
int main()
88
{
9-
using namespace ds2i;
9+
using namespace pisa;
1010
static const size_t size = interpolative_block::block_size;
1111
static const size_t runs = 1 << 20;
1212

benchmarks/scan_perftest.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
#include "sequence/uniform_partitioned_sequence.hpp"
66
#include "util/util.hpp"
77

8-
using ds2i::logger;
9-
using ds2i::get_time_usecs;
10-
using ds2i::do_not_optimize_away;
8+
using pisa::logger;
9+
using pisa::get_time_usecs;
10+
using pisa::do_not_optimize_away;
1111

1212
template <typename BaseSequence>
1313
void perftest(const char* index_filename)
1414
{
15-
typedef ds2i::sequence_collection<BaseSequence> collection_type;
15+
typedef pisa::sequence_collection<BaseSequence> collection_type;
1616
logger() << "Loading collection from " << index_filename << std::endl;
1717
collection_type coll;
1818
mio::mmap_source m(index_filename);
19-
ds2i::mapper::map(coll, m, ds2i::mapper::map_flags::warmup);
19+
pisa::mapper::map(coll, m, pisa::mapper::map_flags::warmup);
2020

2121
if (true) {
2222
logger() << "Scanning all the posting lists" << std::endl;
@@ -127,10 +127,10 @@ void perftest(const char* index_filename)
127127
}
128128
int main(int argc, const char** argv) {
129129

130-
using ds2i::compact_elias_fano;
131-
using ds2i::indexed_sequence;
132-
using ds2i::partitioned_sequence;
133-
using ds2i::uniform_partitioned_sequence;
130+
using pisa::compact_elias_fano;
131+
using pisa::indexed_sequence;
132+
using pisa::partitioned_sequence;
133+
using pisa::uniform_partitioned_sequence;
134134

135135
if (argc != 3) {
136136
std::cerr << "Usage: " << argv[0]

benchmarks/selective_queries.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ template <typename IndexType>
1212
void selective_queries(const char* index_filename,
1313
std::string const& type)
1414
{
15-
using namespace ds2i;
15+
using namespace pisa;
1616

1717

1818
IndexType index;
@@ -59,7 +59,7 @@ void selective_queries(const char* index_filename,
5959

6060

6161
int main(int, const char** argv) {
62-
using namespace ds2i;
62+
using namespace pisa;
6363

6464
std::string type = argv[1];
6565
const char* index_filename = argv[2];

include/binary_collection.hpp renamed to include/pisa/binary_collection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <sys/mman.h>
1414
#endif
1515

16-
namespace ds2i {
16+
namespace pisa {
1717

1818
template <typename Source = mio::mmap_source>
1919
class base_binary_collection {

include/binary_freq_collection.hpp renamed to include/pisa/binary_freq_collection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "binary_collection.hpp"
88

9-
namespace ds2i {
9+
namespace pisa {
1010

1111
class binary_freq_collection {
1212
public:

include/bit_vector.hpp renamed to include/pisa/bit_vector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "succinct/mappable_vector.hpp"
1111

12-
namespace ds2i {
12+
namespace pisa {
1313

1414
namespace detail {
1515
inline size_t words_for(uint64_t n) { return ceil_div(n, 64); }
@@ -476,4 +476,4 @@ class bit_vector {
476476
mapper::mappable_vector<uint64_t> m_bits;
477477
};
478478

479-
} // namespace ds2i
479+
} // namespace pisa

include/bitvector_collection.hpp renamed to include/pisa/bitvector_collection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "codec/compact_elias_fano.hpp"
66

7-
namespace ds2i {
7+
namespace pisa {
88

99
class bitvector_collection {
1010
public:

0 commit comments

Comments
 (0)