Building from source

June 23, 2025 · View on GitHub

macOS and Linux

Begin by downloading a release tarball or by cloning this repo and checking out a release tag (where <version> is the version you wish to use, such as 2.27.2):

$ git clone https://github.com/TileDB-Inc/TileDB.git
$ cd TileDB
$ git checkout <version>

To configure TileDB, use the bootstrap script:

$ mkdir build
$ cd build
$ ../bootstrap <flags>
$ # Or use CMake directly instead of bootstrap:
$ # cmake <flags> ..

The flags for the bootstrap script and the CMake equivalents are as follows:

FlagDescriptionCMake Equivalent
--helpPrints command line flag optionsN/A
--prefix=PREFIXInstall files in tree rooted at PREFIX (defaults to TileDB/dist)CMAKE_INSTALL_PREFIX=<PREFIX>
--dependency=DIRsColon separated list to binary dependenciesCMAKE_PREFIX_PATH=<DIRs>
--enable-debugEnable debug buildCMAKE_BUILD_TYPE=Debug
--enable-coverageEnable build with code coverage supportCMAKE_BUILD_TYPE=Coverage
--enable-verboseEnable verbose status messagesTILEDB_VERBOSE=ON
--enable-assertionsEnable build with assertions enabled. Always on for debug builds.TILEDB_ASSERTIONS=ON
--enable-hdfsEnables building with HDFS storage backend supportTILEDB_HDFS=ON
--enable-s3Enables building with S3 storage backend supportTILEDB_S3=ON
--enable-azureEnables building with Azure Blob Storage backend supportTILEDB_AZURE=ON
--enable-gcsEnables building with Google Cloud Storage backend supportTILEDB_GCS=ON
--enable-serializationEnables building with Serialization and TileDB Cloud supportTILEDB_SERIALIZATION=ON
--enable-static-tiledbEnables building TileDB as a static libraryTILEDB_STATIC=ON
--disable-werrorDisables building with the -Werror flagTILEDB_WERROR=OFF
--disable-cpp-apiDisables building the TileDB C++ APITILEDB_CPP_API=OFF
--disable-statsDisables internal TileDB statisticsTILEDB_STATS=OFF
--disable-testsDisables building the TileDB test suiteTILEDB_TESTS=OFF

To build after configuration, run the generated make script:

$ make -j <nprocs>

To install to the configured prefix, run the following:

$ make install

Note that building against the installed shared library requires setting the library search path at build-time or run-time, as documented in Usage. System-wide installations requiring sudo permissions may avoid this step by running sudo ldconfig after installation.

Other helpful Makefile targets are as follows:

# Runs the tests
make check

# Builds the examples
make examples

Windows

Building TileDB on Windows has been tested to work with Microsoft Visual Studio 2019 and later. You can install the free Community Edition if you’d like the full IDE, or the Build Tools if you don’t need or want the IDE installed.

During the Visual Studio setup process, make sure the Git for Windows component is selected if you do not already have a working Git installation. Also, be sure to select the CMake component if you do not have a working CMake installation.

In addition, you will need to install PowerShell (which you can download for free through Microsoft).

To build and install TileDB, first open PowerShell and clone this repository. Then, checkout a release tag (where <version> is the version you wish to use, such as 2.27.2):

> git clone https://github.com/TileDB-Inc/TileDB.git
> cd TileDB
> git checkout <version>

Next, ensure the CMake binaries are in your path. If you installed Visual Studio, run the following:

> $env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
> # If you installed the build tools, run the following instead:
> # $env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"

Create a build directory and configure TileDB:

> mkdir build
> cd build
> ..\bootstrap.ps1 <flags>
> # Or use CMake directly:
> # cmake <flags> ..

The flags for the bootstrap script and the CMake equivalents are as follows:

FlagDescriptionCMake Equivalent
-?Display a usage message.n/a
-PrefixInstall files in tree rooted at PREFIX (defaults to TileDB\dist)CMAKE_INSTALL_PREFIX=<PREFIX>
-DependencySemicolon separated list to binary dependencies.CMAKE_PREFIX_PATH=<DIRs>
-CMakeGeneratorOptionally specify the CMake generator string, e.g. “Visual Studio 15 2017”. Check ‘cmake –help’ for a list of supported generators.-G <generator>
-EnableDebugEnable debug buildCMAKE_BUILD_TYPE=Debug
-EnableVerboseEnable verbose status messages.TILEDB_VERBOSE=ON
-EnableAssertEnables building with assertions enabled. Always on for debug builds.TILEDB_ASSERTIONS=ON
-EnableS3Enables building with the S3 storage backend.TILEDB_S3=ON
-EnableGcsEnables building the Google Cloud Storage backendTILEDB_GCS=ON
-EnableSerializationEnabled serialization and TileDB Cloud supportTILEDB_SERIALZIATION=ON
-EnableStaticTileDBEnables building TileDB as a static libraryTILEDB_STATIC=ON
-DisableWerrorDisables building with the /WX flagTILEDB_WERROR=OFF
-DisableCppApiDisables building the TileDB C++ APITILEDB_CPP_API=OFF
-DisableTBBDisables use of TBB for parallelizationTILEDB_TBB=OFF
-DisableStatsDisables internal TileDB statisticsTILEDB_STATS=OFF
-DisableTestsDisables building the TileDB test suiteTILEDB_TESTS=OFF

To build after configuration, run the following:

> cmake --build . --config Release

To install, run the following:

> cmake --build . --target install-tiledb --config Release

Other helpful build targets are as follows:

# Runs the tests
cmake --build . --target check --config Release

# Builds the examples
cmake --build . --target examples --config Release

Warning: If you build libtiledb in Release mode, make sure to build check and examples in Release mode as well. Similarly, if you build libtiledb in Debug mode, you need to build check and examples in Debug mode as well. Otherwise, the test and example executables will not run properly.

Should you experience any problem with the build, it is always a good idea to delete the build and dist directories in your TileDB repo path and restart the process, as cmake’s cached state could present some unexpected problems.

Cygwin

Cygwin is a Unix like environment and command line interface for Microsoft Windows that provides a large collection of GNU/OpenSource tools (including the gcc toolchain) and supporting libraries that provide substantial POSIX API functionality. TileDB is able to compile from source in the Cygwin environment if Intel TBB is disabled and some TileDB dependencies are installed as Cygwin packages.

The following Cygwin packages need to be installed:

  • gcc/g++
  • git
  • cmake
  • make
  • lz4-devel
  • zlib-devel
  • libzstd-devel (+src)
  • bzip2 (+src)
  • openssl-devel

You can then clone and build TileDB using git/cmake/make:

$ git clone https://github.com/TileDB-Inc/TileDB.git
$ cd TileDB
$ git checkout <version>
$ mkdir build && cd build
$ cmake -DTILEDB_TBB=OFF ..
$ make
$ make check