Skip to content

Commit a58c02c

Browse files
authored
Merge pull request #33 from satanson/master0
update glog and gflags
2 parents 2438f54 + ad85bd9 commit a58c02c

File tree

200 files changed

+21317
-14958
lines changed

Some content is hidden

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

200 files changed

+21317
-14958
lines changed

CMakeLists.txt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
cmake_minimum_required(VERSION 2.8.12)
1+
cmake_minimum_required(VERSION 3.5)
22
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmakes ${CMAKE_MODULE_PATH})
3+
cmake_policy(SET CMP0079 NEW)
4+
cmake_policy(SET CMP0167 OLD)
35

46
project(cpp_etudes)
57
#enable_language(CXX)
@@ -128,16 +130,28 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
128130
include_directories(${PROJECT_SOURCE_DIR}/src/modules)
129131
include_directories(${LLVM_INCLUDE_DIRS})
130132
link_directories(${LLVM_LIBRARY_DIRS})
131-
133+
message(STATUS "build path=${CMAKE_BINARY_DIR}/third-party/glog")
132134
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src)
133135
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/benchmark-1.5.1/include)
134-
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/glog-0.6.0/src)
136+
include_directories(SYSTEM ${CMAKE_BINARY_DIR}/third-party/gflags/include)
137+
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/glog/src)
135138
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/abseil-cpp-91b7cd600a34cbd/)
136139

137140
add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest)
138141
add_subdirectory(third-party/benchmark-1.5.1)
139142
set(BUILD_TESTING OFF)
140-
add_subdirectory(third-party/glog-0.6.0)
143+
add_subdirectory(third-party/gflags)
144+
set(GFLAGS_NAMESPACE "google" CACHE STRING "Namespace for gflags")
145+
add_definitions(-DGFLAGS_IS_A_DEPENDENCY)
146+
set(WITH_GFLAGS OFF)
147+
add_definitions(-DGLOG_EXPORT=)
148+
add_definitions(-DGLOG_NO_EXPORT=)
149+
add_definitions(-DGLOG_DEPRECATED=)
150+
set(WITH_GFLAGS OFF CACHE BOOL "Disable gflags support")
151+
set(WITH_UNWIND OFF CACHE BOOL "Disable libunwind support")
152+
add_definitions(-DGOOGLE_STRIP_LOG=0)
153+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries")
154+
add_subdirectory(third-party/glog)
141155

142156
set(ABSL_PROPAGATE_CXX_STD ON)
143157
set(ABSL_BUILD_TESTING OFF)
@@ -157,10 +171,12 @@ check_cxx_source_compiles("
157171
if (NOT HAVE_GLIBCXX_USE_CXX11_ABI)
158172
MESSAGE(FATAL_ERROR "_GLIBCXX_USE_CXX11_ABI should not be 0")
159173
endif()
160-
174+
find_package(zstd REQUIRED)
161175
list(APPEND link_libs gtest
162176
pthread atomic
177+
gflags
163178
glog::glog
179+
zstd
164180
absl::algorithm
165181
absl::base
166182
absl::debugging

accelerated_queries.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
set -e -o pipefail
3+
perl -lne '@a=($_=~/(\bQ\d+\b)/g); push @b,@a;}{%h=map{$_,1} @b;print join ",", map{qq/"$_"/} sort{$a cmp $b} keys %h' $1

cmakes/llvm.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# endif ()
44
#endforeach ()
55
set(LLVM_DIR "${PROJECT_SOURCE_DIR}/llvm_install/usr/local/lib/cmake/llvm/")
6-
find_package(LLVM 14.0.6 REQUIRED CONFIG)
6+
find_package(LLVM 20.0.0 REQUIRED CONFIG)
77

88
message(STATUS "LLVM_FOUND=${LLVM_FOUND}")
99
message(STATUS "LLVM library Directory: ${LLVM_LIBRARY_DIRS}")
1010
if (LLVM_FOUND)
1111
# Remove dynamically-linked zlib and libedit from LLVM's dependencies:
1212
set_target_properties(LLVMSupport PROPERTIES INTERFACE_LINK_LIBRARIES "-lpthread;LLVMDemangle;${ZLIB_LIBRARIES}")
13-
set_target_properties(LLVMLineEditor PROPERTIES INTERFACE_LINK_LIBRARIES "LLVMSupport")
13+
#set_target_properties(LLVMLineEditor PROPERTIES INTERFACE_LINK_LIBRARIES "LLVMSupport")
1414
option(LLVM_HAS_RTTI "Enable if LLVM was build with RTTI enabled" ON)
1515
else ()
1616
message(FATAL_ERROR "Can't find system LLVM")
@@ -62,6 +62,6 @@ set(REQUIRED_LLVM_LIBRARIES
6262
LLVMDebugInfoCodeView
6363
LLVMSupport
6464
LLVMDemangle
65-
LLVMOrcError
65+
#LLVMOrcError
6666
)
6767

include/llvm.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public:
162162
auto symbol = cantFail(_es->lookup({&_main_jd}, _mangling(fn_name)));
163163
// Get the symbol's address and cast it to the right type (takes no
164164
// arguments, returns a double) so we can call it as a native function.
165-
return reinterpret_cast<uintptr_t>(symbol.getAddress());
165+
return reinterpret_cast<uintptr_t>(symbol.getAddress().getValue());
166166
}
167167
};
168168

rm_bak.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/bash
22
find -name "*.bak" |xargs -i{} rm -fr '{}'
33
find -name "*.backup.[0-9]*" |xargs -i{} rm -fr '{}'
4+
find -name "*.backup" |xargs -i{} rm -fr '{}'

split_mv_rec_files.pl

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/perl
2+
3+
use strict;
4+
use warnings;
5+
6+
my @ignores=(qr/^\s*$/);
7+
my @matches=(qr/^--(?:\s*)?Id=(\d+)/);
8+
9+
my $file=undef;
10+
while(<>){
11+
my $ignored="false";
12+
for my $igRe (@ignores){
13+
if ($_ =~ $igRe){
14+
$ignored="true";
15+
last;
16+
}
17+
}
18+
if ($ignored eq "true"){
19+
next;
20+
}
21+
22+
my $matched="false";
23+
for my $mRe (@matches){
24+
if ($_ =~ $mRe){
25+
$matched="true";
26+
if (defined($file)){
27+
close($file);
28+
}
29+
my $name="mv_".substr("00$1",-2) . ".sql";
30+
open $file, "> $name" or die "$!";
31+
print $file "$_";
32+
last;
33+
}
34+
}
35+
36+
if ($matched ne "true"){
37+
print $file "$_";
38+
}
39+
}
40+
41+
if (defined($file)){
42+
close($file);
43+
}

sr_index2.pl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,27 @@ ($)
9191
next;
9292
}
9393

94-
if (/\b(InstancePeakMemoryUsage|__MAX_OF_InstancePeakMemoryUsage|InstanceNum):\s+(.*)/) {
94+
if (/\b(InstanceNum):\s+(.*)/) {
9595
$plan->{$fragment}{$1}=$2;
9696
$plan->{$fragment}{id}=$fragment;
9797
next;
9898
}
9999

100+
if (/\b(InstancePeakMemoryUsage|__MAX_OF_InstancePeakMemoryUsage|InstanceNum):\s+(.*)/) {
101+
$plan->{$fragment}{$1}=norm_bytes($2);
102+
$plan->{$fragment}{id}=$fragment;
103+
next;
104+
}
105+
100106
if (/\b(MemoryLimit|PeakMemoryUsage|__MAX_OF_PeakMemoryUsage):\s+(.*)/) {
101107
if (defined($operator)){
102108
my $operator_id = join "_", ($fragment, $pipeline, $operator);
103-
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=$2;
109+
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=norm_bytes($2);
104110
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{id}=$operator_id;
105111
} elsif(defined($pipeline)) {
106-
$plan->{$fragment}{pipelines}{$pipeline}{$1}=$2;
112+
$plan->{$fragment}{pipelines}{$pipeline}{$1}=norm_bytes($2);
107113
} else {
108-
$plan->{$fragment}{$1}=$2;
114+
$plan->{$fragment}{$1}=norm_bytes($2);
109115
$plan->{$fragment}{id}=$fragment;
110116
}
111117
next;
@@ -124,7 +130,7 @@ ($)
124130
next;
125131
}
126132

127-
if (/\b(DegreeOfParallelism|TotalDegreeOfParallelism):\s+(\d+(?:(?:\.\d+)\w+)?)/) {
133+
if (/\b(DegreeOfParallelism|TotalDegreeOfParallelism|PeakDriverQueueSize|__MAX_OF_PeakDriverQueueSize):\s+(\d+(?:(?:\.\d+)\w+)?)/) {
128134
$plan->{$fragment}{pipelines}{$pipeline}{$1}=norm_num($2);
129135
next;
130136
}
@@ -163,7 +169,7 @@ ($)
163169
}
164170
if (/\b(BytesPassThrough|BytesSent|BlockCacheWriteBytes|__MAX_OF_BlockCacheWriteBytes|BlockCacheReadBytes|__MAX_OF_BlockCacheReadBytes|InputRequiredMemory|__MAX_OF_InputRequiredMemory|MergeUnsortedPeakMemoryUsage|__MAX_OF_MergeUnsortedPeakMemoryUsage|MergeSortedPeakMemoryUsage|__MAX_OF_MergeSortedPeakMemoryUsage|SortPartialPeakMemoryUsage|__MAX_OF_SortPartialPeakMemoryUsage|UpcompressedBytes|OperatorPeakMemoryUsage|__MAX_OF_OperatorPeakMemoryUsage):\s+(.*)/) {
165171
my $operator_id = join "_", ($fragment, $pipeline, $operator);
166-
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=$2;
172+
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{$1}=norm_bytes($2);
167173
$plan->{$fragment}{pipelines}{$pipeline}{operators}{$operator}{id}=$operator_id;
168174
next;
169175
}
@@ -187,5 +193,6 @@ ($)
187193
my @fragments = grep {exists $_->{$index}} @$fragments;
188194
my @pipelines = grep {exists $_->{$index}} @$pipelines;
189195
my @ops= grep {exists $_->{$index}} @$ops;
196+
#print Dumper([@fragments, @pipelines, @ops]);
190197
print join "\n", map {sprintf "%s\t\t%s\t%s", "".$_->{$index}, $index, $_->{id}} sort{$a->{$index} <=> $b->{$index}} (@fragments, @pipelines, @ops);
191198
print "\n";

third-party/gflags/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# treat all files in this repository as text files
2+
# and normalize them to LF line endings when committed
3+
* text

third-party/gflags/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/xcode/
2+
/build/
3+
/builds/
4+
/build-*/
5+
/_build/
6+
.DS_Store
7+
CMakeCache.txt
8+
DartConfiguration.tcl
9+
Makefile
10+
CMakeFiles/
11+
/Testing/
12+
/include/gflags/config.h
13+
/include/gflags/gflags_completions.h
14+
/include/gflags/gflags_declare.h
15+
/include/gflags/gflags.h
16+
/lib/
17+
/test/gflags_unittest_main.cc
18+
/test/gflags_unittest-main.cc
19+
/packages/
20+
CMakeLists.txt.user
21+
/bazel-bin
22+
/bazel-genfiles
23+
/bazel-gflags
24+
/bazel-out
25+
/bazel-testlogs

third-party/gflags/.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "doc"]
2+
path = doc
3+
url = https://github.com/gflags/gflags.git
4+
branch = gh-pages

0 commit comments

Comments
 (0)