Skip to content

Build with CMake 4 and current compilers - #12

Merged
nalinigans merged 3 commits into
mainfrom
tf_modern_toolchains
Oct 9, 2026
Merged

nalinigans merged 3 commits into
mainfrom
tf_modern_toolchains

Conversation

@tfenne

@tfenne tfenne commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

TileDB doesn't build with current toolchains: under CMake 4 the SDK builds fail to configure, because CMake 4 refuses their cmake_minimum_required() of less than 3.5, and newer compilers stop on azure-storage-cpplite, the AWS SDK and google-cloud-cpp. With this, TileDB and its SDKs build with CMake 4, GCC 15, clang 21 and Apple clang 21 without local patches or environment settings, and the SDK versions are unchanged. The SDK builds get TileDB's compilers, macOS deployment target and CMAKE_POLICY_VERSION_MINIMUM=3.5, and google-cloud-cpp gets TileDB's OpenSSL instead of requiring the OPENSSL_ROOT_DIR environment variable on macOS. The AWS SDK gets the standard includes it relied on older compilers to pull in, google-cloud-cpp's warnings are no longer errors, and azure-storage-cpplite's NULL-as-std::string warning, in code TileDB never calls, is no longer an error.

It also fixes three things that bite when TileDB is built as a subproject or on macOS: configuring TileDB updated every submodule of the parent project rather than only its own, the libuuid lookup could pick up Kernel.framework, whose headers shadow the SDK's C headers, and the examples failed to configure with TILEDB_DISABLE_TESTS. The clang warning flags now apply to clang on any platform, not just macOS.

Checked with clean builds, SDKs included: on macOS arm64 with CMake 4.4 and Apple clang 21, and on Linux aarch64 in an AlmaLinux 8 container with CMake 4.4, GCC 15.2 and clang 21. Every test passes, though on aarch64 the examples also need #11. On main, the same macOS build stops at the SDK configure steps and at azure-storage-cpplite.

TileDB and the SDKs it builds now build with CMake 4, GCC 15, clang 21
and Apple clang 21 without local patches or environment settings. The
SDK versions are unchanged.

- Give the SDK builds TileDB's compilers and macOS deployment target,
  and CMAKE_POLICY_VERSION_MINIMUM=3.5, since CMake 4 refuses their
  cmake_minimum_required() of less than 3.5. google-cloud-cpp also gets
  TileDB's OpenSSL, instead of insisting on the OPENSSL_ROOT_DIR
  environment variable on macOS.
- Add the standard includes the AWS SDK relied on older compilers to pull
  in, stop treating google-cloud-cpp's warnings as errors, and stop
  treating azure-storage-cpplite's NULL-as-std::string warning, in code
  TileDB never calls, as an error. The OpenSSL shim includes the headers
  it uses.
- Apply the clang warning flags for clang on any platform, not just on
  macOS.
- Update only TileDB's own submodules at configure time; as a subproject
  it reset every submodule of the parent project.
- Keep Kernel.framework out of the libuuid lookup on macOS, where its
  headers shadowed the SDK's C headers.
- Let the examples configure when TILEDB_DISABLE_TESTS is set.
if(APPLE)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libuuid "Could not find libuuid headers ${DEFAULT_MSG}" LIBUUID_INCLUDE_DIR)
else()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to be a dangling else() or do we need to indent the following lines?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not dangling: everything down to endif() is still the non-Apple branch. Those lines were never indented on main, and with the duplicate find_path moved above the if, else() looked empty. I've indented them in 7eef531.

@nalinigans nalinigans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nalinigans
nalinigans merged commit 2c612be into main Oct 9, 2026
10 checks passed
@nalinigans
nalinigans deleted the tf_modern_toolchains branch October 9, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants