rocksdb/examples
Peter Dillinger 2950e99219 Require C++20 (#13904)
Summary:
I am wanting to use std::counting_semaphore for something and the timing seems good to require C++20 support. The internets suggest:

* GCC >= 10 is adequate, >= 11 preferred
* Clang >= 10 is needed
* Visual Studio >= 2019 is adquate

And popular linux distributions look like this:
* CentOS Stream 9 -> GCC 11.2  (CentOS 8 is EOL)
* Ubuntu 22.04 LTS -> GCC 11.x  (Ubuntu 20 just ended standard support)
* Debian 12 (oldstable) -> GCC 12.2
  * (Debian 11 has ended security updates, uses GCC 10.2)

This required generating a new docker image based on Ubuntu 22 for CI using gcc. The existing Ubuntu 20 image works for covering appropriate clang versions (though we should maybe add a much later version as well, in the next increment of our Ubuntu 22 image; however the minimum available clang build from apt.llvm.org for Ubuntu 22 is clang 13).

Update to SetDumpFilter is to quiet a mysterious gcc-13 warning-as-error.

Removed --compile-no-warning-as-error from a cmake command line because cmake in the new docker image is too old for this option.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/13904

Test Plan: CI, one minor unit test added to verify std::counting_semaphor works

Reviewed By: xingbowang

Differential Revision: D81266435

Pulled By: pdillinger

fbshipit-source-id: 26040eeccca7004416e29a6ff4f6ea93f2052684
2025-08-28 16:59:16 -07:00
..
.gitignore Add rocksdb_backup_restore_example to examples/.gitignore (#10825) 2022-11-02 15:02:09 -07:00
c_simple_example.c Standardize on clang-format version 18 (#13233) 2024-12-19 10:58:40 -08:00
CMakeLists.txt add WITH_EXAMPLES options to cmake and cleanups. (#6580) 2020-06-18 18:00:04 -07:00
column_families_example.cc Run clang format against files under example/, memory/ and memtable/ folders (#10893) 2022-10-28 13:16:50 -07:00
compact_files_example.cc Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
compaction_filter_example.cc Remove 'virtual' when implied by 'override' (#12319) 2024-01-31 13:14:42 -08:00
Makefile Require C++20 (#13904) 2025-08-28 16:59:16 -07:00
multi_processes_example.cc Prefer static_cast in place of most reinterpret_cast (#12308) 2024-02-07 10:44:11 -08:00
optimistic_transaction_example.cc Standardize on clang-format version 18 (#13233) 2024-12-19 10:58:40 -08:00
options_file_example.cc Remove using namespace (#9369) 2022-01-12 09:31:12 -08:00
README.md Improve examples/README.md 2015-12-16 16:27:37 +01:00
rocksdb_backup_restore_example.cc Add a simple example of backup and restore (#10054) 2022-06-03 23:25:31 -07:00
rocksdb_option_file_example.ini Deprecate random access max buffer size references - take #2 (#13288) 2025-01-10 15:32:38 -08:00
simple_example.cc Run clang format against files under example/, memory/ and memtable/ folders (#10893) 2022-10-28 13:16:50 -07:00
transaction_example.cc Standardize on clang-format version 18 (#13233) 2024-12-19 10:58:40 -08:00

  1. Compile RocksDB first by executing make static_lib in parent dir
  2. Compile all examples: cd examples/; make all