From f88d3f4e45a1daee8f395cbe5b65ce14c0425441 Mon Sep 17 00:00:00 2001 From: wangfenjin Date: Fri, 15 Jul 2022 10:06:25 +0800 Subject: [PATCH 1/5] use byronhe version to reduce mem --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c4e5b10..9c57301 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,7 +6,7 @@ if(SIMPLE_WITH_JIEBA) ExternalProject_Add( cppjieba PREFIX ${CMAKE_BINARY_DIR}/cppjieba - GIT_REPOSITORY https://github.com/yanyiwu/cppjieba.git + GIT_REPOSITORY https://github.com/byronhe/cppjieba.git CONFIGURE_COMMAND "" BUILD_COMMAND cmake -E echo "Skipping build cppjieba." INSTALL_COMMAND cmake -E echo "Skipping install cppjieba." From be82c8fbe8e7ceb2501ec61f3316ce5864f8e7d5 Mon Sep 17 00:00:00 2001 From: wangfenjin Date: Fri, 15 Jul 2022 11:17:30 +0800 Subject: [PATCH 2/5] fix build file --- build-and-run-no-jieba | 2 +- examples/cpp/main.cc | 13 +++++++------ src/CMakeLists.txt | 2 ++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build-and-run-no-jieba b/build-and-run-no-jieba index 424b8ec..62f84e4 100755 --- a/build-and-run-no-jieba +++ b/build-and-run-no-jieba @@ -77,7 +77,7 @@ simple.example() { run "./sqlite3 < ${ProjectRoot}/example.sql" run "./simple_cpp_example" run "cd ${ProjectRoot}" - run "python3 examples/python3/db_connector.py" + run "python3 examples/python3/db_connector.py './output/bin/libsimple'" } main() { diff --git a/examples/cpp/main.cc b/examples/cpp/main.cc index 9834ae6..f53e9a4 100644 --- a/examples/cpp/main.cc +++ b/examples/cpp/main.cc @@ -73,12 +73,6 @@ int main() { handle_rc(db, rc); ms pinyin = Clock::now() - before; std::cout << "It took " << pinyin.count() << "ms to init pinyin" << std::endl; - before = Clock::now(); - sql = "select jieba_query('结巴')"; - rc = sqlite3_exec(db, sql.c_str(), callback, 0, &zErrMsg); - handle_rc(db, rc); - ms warm_up = Clock::now() - before; - std::cout << "It took " << warm_up.count() << "ms to init jieba" << std::endl; before = Clock::now(); // create fts table @@ -112,6 +106,13 @@ int main() { rc = sqlite3_exec(db, sql.c_str(), callback, 0, &zErrMsg); handle_rc(db, rc); #ifdef USE_JIEBA + before = Clock::now(); + sql = "select jieba_query('结巴')"; + rc = sqlite3_exec(db, sql.c_str(), callback, 0, &zErrMsg); + handle_rc(db, rc); + ms warm_up = Clock::now() - before; + std::cout << "It took " << warm_up.count() << "ms to init jieba" << std::endl; + // set dict path manually string dict_path = get_current_dir() + "/dict"; sql = "select jieba_dict('" + dict_path + "')"; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9c57301..d111613 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,6 +37,8 @@ if(SIMPLE_WITH_JIEBA) add_dependencies(simple cppjieba) include_directories(${SQLITE3_HEADERS_DIR} ${source_dir}/include ${source_dir}/deps) target_include_directories(simple INTERFACE ${SQLITE3_HEADERS_DIR} ${source_dir}/include ${source_dir}/deps) + set_source_files_properties(${source_dir}/deps/limonp/Md5.cpp PROPERTIES GENERATED TRUE) + target_sources(simple PRIVATE ${source_dir}/deps/limonp/Md5.cpp) # for tests only add_custom_command(TARGET simple PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory From 3d255614453fccd213fdb2187533ef412b885670 Mon Sep 17 00:00:00 2001 From: wangfenjin Date: Fri, 15 Jul 2022 12:11:14 +0800 Subject: [PATCH 3/5] use my test version --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d111613..eaf8a68 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,7 +6,7 @@ if(SIMPLE_WITH_JIEBA) ExternalProject_Add( cppjieba PREFIX ${CMAKE_BINARY_DIR}/cppjieba - GIT_REPOSITORY https://github.com/byronhe/cppjieba.git + GIT_REPOSITORY https://github.com/wangfenjin/cppjieba.git CONFIGURE_COMMAND "" BUILD_COMMAND cmake -E echo "Skipping build cppjieba." INSTALL_COMMAND cmake -E echo "Skipping install cppjieba." From c95e25d05ff3d2910933d8fe3a6706f520666fc4 Mon Sep 17 00:00:00 2001 From: wangfenjin Date: Tue, 11 Apr 2023 14:43:20 +0800 Subject: [PATCH 4/5] use master --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 11152e4..468f77d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,7 @@ if(SIMPLE_WITH_JIEBA) PREFIX ${CMAKE_BINARY_DIR}/cppjieba GIT_REPOSITORY https://github.com/wangfenjin/cppjieba.git CONFIGURE_COMMAND "" - GIT_TAG 194c144d8b5ed1baf3190d07c5226e804454ab47 + GIT_TAG master BUILD_COMMAND cmake -E echo "Skipping build cppjieba." INSTALL_COMMAND cmake -E echo "Skipping install cppjieba." LOG_DOWNLOAD ON From d4c772958d69f0adc945235d38ce25e6627929d3 Mon Sep 17 00:00:00 2001 From: wangfenjin Date: Tue, 11 Apr 2023 15:56:01 +0800 Subject: [PATCH 5/5] update to 20.04 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08556fb..6725459 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -140,7 +140,7 @@ jobs: include: [ { name: 'ARM64', xcc_pkg: gcc-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static, os: ubuntu-latest, }, - { name: 'ARM64, gcc-7', xcc_pkg: gcc-7-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc-7, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static, os: ubuntu-18.04, }, + { name: 'ARM64, gcc-7', xcc_pkg: gcc-7-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc-7, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static, os: ubuntu-20.04, }, ] env: # Set environment variables CC: ${{ matrix.xcc }} @@ -205,7 +205,7 @@ jobs: fail-fast: true matrix: include: - - os: ubuntu-18.04 + - os: ubuntu-20.04 - os: ubuntu-latest steps: - name: "Release Build Type"