Say how to build a static rocksdb that compiles

The recipe used the Makefile build without DISABLE_WARNING_AS_ERROR, and it
built the bundled gtest and the tools, none of which are needed for a static
library. Both bring the build down with newer compilers, on Rocky Linux with
gcc 11 for example:

  gtest-all.cc:8681: error: 'dummy' may be used uninitialized
  env/env.cc:688: error: 'hostname_buf' may be used uninitialized

Both are warnings about code that is not ours, and FAIL_ON_WARNINGS turns them
into errors. The recipe switches that off and leaves out the tests and tools.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: I614a8630ab732200c8b24af8cb0026da1dc20425
diff --git a/README.md b/README.md
index 749ca63..aa13f5b 100644
--- a/README.md
+++ b/README.md
@@ -61,16 +61,33 @@
 Keep it out of `/usr/local`, where its headers would shadow those of the
 package, and point the build at it:
 
+Build the same version as the rocksdb that collocatordb is compiled against,
+otherwise the static library does not match the headers:
+
 ```bash
 git clone https://github.com/facebook/rocksdb.git -b v$(rpm -q --qf '%{VERSION}' rocksdb) --single-branch
 cd rocksdb
-make -j $(nproc) static_lib
-make install-static INSTALL_PATH=$HOME/rocksdb-static
+cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
+      -DFAIL_ON_WARNINGS=OFF \
+      -DWITH_TESTS=OFF -DWITH_BENCHMARK_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_CORE_TOOLS=OFF \
+      -DROCKSDB_BUILD_SHARED=OFF \
+      -DCMAKE_INSTALL_PREFIX=$HOME/rocksdb-static
+cmake --build build -j $(nproc)
+cmake --install build
 cd ../collocatordb/build
 cmake -DROCKSDB_STATIC=$HOME/rocksdb-static/lib/librocksdb.a -DCMAKE_INSTALL_PREFIX=/usr/local ..
 make && sudo make install && sudo ldconfig
 ```
 
+`WITH_TESTS` and the tools bring in the bundled gtest, which is not needed for
+a static library and does not compile with every compiler. `FAIL_ON_WARNINGS`
+adds `-Werror`, which turns warnings of newer compilers about rocksdb's own
+code into errors - on Rocky Linux with gcc 11, for instance:
+
+```
+env/env.cc:688: error: 'hostname_buf' may be used uninitialized [-Werror=maybe-uninitialized]
+```
+
 ## Provided API
 
 ```c