diff --git a/.github/workflows/build-ubuntu20.04-backwards-compatibility.yml b/.github/workflows/build-ubuntu20.04-backwards-compatibility.yml index b3d290bc904..6a935583085 100644 --- a/.github/workflows/build-ubuntu20.04-backwards-compatibility.yml +++ b/.github/workflows/build-ubuntu20.04-backwards-compatibility.yml @@ -46,7 +46,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: tiledb_unit - path: ${{ github.workspace }}/build/tiledb/test/tiledb_unit + path: ${{ github.workspace }}/build/test/tiledb_unit retention-days: 1 test: @@ -69,10 +69,10 @@ jobs: uses: actions/download-artifact@v3 with: name: tiledb_unit - path: ${{ github.workspace }}/build/tiledb/test/ + path: ${{ github.workspace }}/build/test/ - name: Update tiledb_unit permissions - run: chmod +x $GITHUB_WORKSPACE/build/tiledb/test/tiledb_unit + run: chmod +x $GITHUB_WORKSPACE/build/test/tiledb_unit - name: Free disk space run: | @@ -106,7 +106,7 @@ jobs: # Bypass Catch2 Framework stdout interception with awk on test output - $GITHUB_WORKSPACE/build/tiledb/test/tiledb_unit -d yes "[backwards-compat]"| awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' + $GITHUB_WORKSPACE/build/test/tiledb_unit -d yes "[backwards-compat]"| awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' - name: 'Test status check' run: | diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index aebad0e24cc..7b26ecee8c7 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -242,11 +242,11 @@ jobs: # & "$env:BUILD_SOURCESDIRECTORY\scripts\install-minio.ps1" # update CMake to disable S3 for the test configuration, see minio note above - cmake -B $env:BUILD_BUILDDIRECTORY\tiledb -DTILEDB_S3=0 $env:BUILD_SOURCESDIRECTORY + cmake -B $env:BUILD_BUILDDIRECTORY -DTILEDB_S3=OFF $env:BUILD_SOURCESDIRECTORY } # CMake exits with non-0 status if there are any warnings during the build, so - cmake --build $env:BUILD_BUILDDIRECTORY\tiledb -j --target tiledb_unit unit_vfs tiledb_regression all_link_complete --config $CMakeBuildType + cmake --build $env:BUILD_BUILDDIRECTORY -j --target tiledb_unit unit_vfs tiledb_regression all_link_complete --config $CMakeBuildType if ($env:TILEDB_AZURE -eq "ON") { if($env.TILEDB_USE_CUSTOM_NODE_JS) { @@ -277,7 +277,7 @@ jobs: # Actually run tests - $cmds = "$env:BUILD_BUILDDIRECTORY\tiledb\test\tiledb_unit.exe -d=yes" + $cmds = "$env:BUILD_BUILDDIRECTORY\test\tiledb_unit.exe -d=yes" Write-Host "cmds: '$cmds'" Invoke-Expression $cmds if ($LastExitCode -ne 0) { @@ -285,7 +285,7 @@ jobs: $host.SetShouldExit($LastExitCode) } - $cmds = "$env:BUILD_BUILDDIRECTORY\tiledb\tiledb\sm\filesystem\test\unit_vfs -d=yes" + $cmds = "$env:BUILD_BUILDDIRECTORY\tiledb\sm\filesystem\test\unit_vfs -d=yes" Write-Host "cmds: '$cmds'" Invoke-Expression $cmds if ($LastExitCode -ne 0) { @@ -293,7 +293,7 @@ jobs: $host.SetShouldExit($LastExitCode) } - $cmds = "$env:BUILD_BUILDDIRECTORY\tiledb\test\ci\test_assert.exe -d=yes" + $cmds = "$env:BUILD_BUILDDIRECTORY\test\ci\test_assert.exe -d=yes" Invoke-Expression $cmds if ($LastExitCode -ne 0) { Write-Host "Tests failed. test_assert exit status: " $LastExitCocde @@ -313,9 +313,9 @@ jobs: $env:Path += ";$env:BUILD_BUILDDIRECTORY\dist\bin;$env:BUILD_BUILDDIRECTORY\externals\install\bin" - $TestAppDir = (Join-Path $env:BUILD_BUILDDIRECTORY "tiledb\examples\c_api") - $TestAppDataDir = (Join-Path $env:BUILD_BUILDDIRECTORY "tiledb\examples\c_api\test_app_data") - Get-ChildItem (Join-Path $env:BUILD_BUILDDIRECTORY "tiledb\examples\c_api\") -Filter *.exe | + $TestAppDir = (Join-Path $env:BUILD_BUILDDIRECTORY "examples\c_api") + $TestAppDataDir = (Join-Path $env:BUILD_BUILDDIRECTORY "examples\c_api\test_app_data") + Get-ChildItem (Join-Path $env:BUILD_BUILDDIRECTORY "examples\c_api\") -Filter *.exe | Foreach-Object { try { Set-Location -path $TestAppDir @@ -346,9 +346,9 @@ jobs: Set-Location -path $TestAppDir Remove-Item -Path $TestAppDataDir -recurse -force -ErrorAction SilentlyContinue - $TestAppDir = (Join-Path $env:BUILD_BUILDDIRECTORY "tiledb\examples\cpp_api") - $TestAppDataDir = (Join-Path $env:BUILD_BUILDDIRECTORY "tiledb\examples\cpp_api\test_app_data") - Get-ChildItem (Join-Path $env:BUILD_BUILDDIRECTORY "tiledb\examples\cpp_api\") -Filter *.exe | + $TestAppDir = (Join-Path $env:BUILD_BUILDDIRECTORY "examples\cpp_api") + $TestAppDataDir = (Join-Path $env:BUILD_BUILDDIRECTORY "examples\cpp_api\test_app_data") + Get-ChildItem (Join-Path $env:BUILD_BUILDDIRECTORY "examples\cpp_api\") -Filter *.exe | Foreach-Object { try { Set-Location -path $TestAppDir @@ -405,7 +405,7 @@ jobs: - name: Packaging test shell: pwsh run: | - cmake --build $env:BUILD_BUILDDIRECTORY\tiledb --target check-package + cmake --build $env:BUILD_BUILDDIRECTORY --target check-package - name: 'process crashdumps' shell: cmd diff --git a/.github/workflows/ci-linux_mac.yml b/.github/workflows/ci-linux_mac.yml index f3aeaf6b5da..869275e89b6 100644 --- a/.github/workflows/ci-linux_mac.yml +++ b/.github/workflows/ci-linux_mac.yml @@ -213,10 +213,10 @@ jobs: # Run tests # Bypass Catch2 Framework stdout interception with awk on test output - ./tiledb/test/regression/tiledb_regression -d yes - ./tiledb/test/ci/test_assert -d yes - ./tiledb/test/tiledb_unit -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' - ./tiledb/tiledb/sm/filesystem/test/unit_vfs -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' + ./test/regression/tiledb_regression -d yes + ./test/ci/test_assert -d yes + ./test/tiledb_unit -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' + ./tiledb/sm/filesystem/test/unit_vfs -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' ctest -R tiledb_timing_unit | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' @@ -244,7 +244,7 @@ jobs: ################################################### # Perform package test - cmake --build $GITHUB_WORKSPACE/build/tiledb --target check-package + cmake --build $GITHUB_WORKSPACE/build --target check-package - name: 'Dump core stacks on failure' if: ${{ failure() && startsWith(matrix.os, 'ubuntu-') == true }} # only run this job if the build step failed diff --git a/.github/workflows/mingw-w64-tiledb/PKGBUILD b/.github/workflows/mingw-w64-tiledb/PKGBUILD index 7c54c04e909..79a79aa29e2 100644 --- a/.github/workflows/mingw-w64-tiledb/PKGBUILD +++ b/.github/workflows/mingw-w64-tiledb/PKGBUILD @@ -34,24 +34,22 @@ build() { -DTILEDB_TESTS=OFF \ -DTILEDB_S3=ON \ -DCOMPILER_SUPPORTS_AVX2=OFF \ - -DTILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK=ON \ -DTILEDB_WERROR=OFF \ -DVCPKG_TARGET_TRIPLET=${vcpkg_triplet} \ .. make - make -C tiledb # in a local environ, can build to demo/check for previously seen (windows event) handle leakge # apparently due to issues with mingw std library implementation. # note that with S3 enabled above, and minio not running, the aws sdk may fatally error on exit. -# make -C tiledb/test tiledb_unit # need the support lib built -# make -C tiledb/test/performance tiledb_explore_msys_handle_leakage +# make -C test tiledb_unit # need the support lib built +# make -C test/performance tiledb_explore_msys_handle_leakage # . ../test/performance/msys_handle_leakage/trials.sh } package() { cd ${source_dir}/build-${MINGW_CHOST} - make DESTDIR="${pkgdir}" -C tiledb install + make DESTDIR="${pkgdir}" install # Copy vcpkg_installed to the mingw package. cp -r vcpkg_installed/${vcpkg_triplet}/. ${pkgdir}/${MINGW_ARCH} } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f05a9ff87af..f752e6d97f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -125,8 +125,8 @@ jobs: with: name: release path: | - build/tiledb/tiledb-*.tar.gz* - build/tiledb/tiledb-*.zip* + build/tiledb-*.tar.gz* + build/tiledb-*.zip* - name: "Print log files (failed build only)" run: | source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh diff --git a/.github/workflows/test-cloud-e2e.yml b/.github/workflows/test-cloud-e2e.yml index 845389c52b6..dae04836de7 100644 --- a/.github/workflows/test-cloud-e2e.yml +++ b/.github/workflows/test-cloud-e2e.yml @@ -90,7 +90,7 @@ jobs: # Run tests # Bypass Catch2 Framework stdout interception with awk on test output - ./tiledb/test/tiledb_unit -d yes "[vfs-e2e]" | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' + ./test/tiledb_unit -d yes "[vfs-e2e]" | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' - name: 'Test status check' run: | diff --git a/.github/workflows/unit-test-runs.yml b/.github/workflows/unit-test-runs.yml index 0b1bfce01f3..b0f3f25bc08 100644 --- a/.github/workflows/unit-test-runs.yml +++ b/.github/workflows/unit-test-runs.yml @@ -61,14 +61,13 @@ jobs: -DCMAKE_BUILD_TYPE=Debug \ -DTILEDB_SERIALIZATION=ON \ -DTILEDB_ASSERTIONS=ON - cmake --build build -j4 # Build all unit tests - cmake --build build/tiledb --target tests -j4 + cmake --build build --target tests -j4 - name: 'Run standalone unit tests' run: | - ctest --test-dir build/tiledb -R '(^unit_|test_assert)' --no-tests=error - ctest --test-dir build/tiledb -R 'test_ci_asserts' + ctest --test-dir build -R '(^unit_|test_assert)' --no-tests=error + ctest --test-dir build -R 'test_ci_asserts' - name: "Print log files (failed build only)" run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index e99ae9851dc..d3fec8f854c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,56 +112,9 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden) # Disable warnings from Boost set(Boost_NO_WARN_NEW_VERSIONS ON) -############################################################ -# Superbuild setup -############################################################ - -# Set the variable used when calling find_package(), find_file() etc. -# to determine if NO_DEFAULT_PATH should be passed. -if (TILEDB_FORCE_ALL_DEPS) - set(TILEDB_DEPS_NO_DEFAULT_PATH NO_DEFAULT_PATH) -else() - set(TILEDB_DEPS_NO_DEFAULT_PATH) -endif() - -# If this is an in-IDE build, we need to disable the superbuild and explicitly -# set the EP base dir. The normal 'cmake && make' process won't need this step, -# it is for better CLion support of this superbuild architecture. -if (TILEDB_CMAKE_IDE) - set(TILEDB_SUPERBUILD OFF) - set(TILEDB_EP_BASE "${CMAKE_CURRENT_BINARY_DIR}/externals") -endif() - -# Set main TileDB Source -set(TILEDB_BASE_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/tiledb") -# Set experimental TileDB Source -set(TILEDB_EXPERIMENTAL_BASE_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/experimental") - -# Perform superbuild config and exit. -if (TILEDB_SUPERBUILD) - project(TileDB-Superbuild) - - # Override default install prefix if not set - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - message(STATUS "Setting CMAKE_INSTALL_PREFIX to: '${PROJECT_BINARY_DIR}/dist'") - set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/dist" CACHE PATH "..." FORCE) - endif() - - message(STATUS "Starting TileDB superbuild.") - include("cmake/TileDB-Superbuild.cmake") - message(STATUS "Install prefix is ${CMAKE_INSTALL_PREFIX}") - # The superbuild file incorporates this file as an external project with the - # superbuild off. Thus we stop processing this file here, knowing that we'll - # come back later. - return() -endif() - project(TileDB) message(STATUS "Starting TileDB regular build.") message(STATUS " CMake version: ${CMAKE_VERSION}") -# Paths to locate the installed external projects. -set(TILEDB_EP_SOURCE_DIR "${TILEDB_EP_BASE}/src") -set(TILEDB_EP_INSTALL_PREFIX "${TILEDB_EP_BASE}/install") ############################################################ # Compile options/definitions for all targets @@ -532,9 +485,6 @@ add_subdirectory(experimental/experimental_examples) # Build tools if (TILEDB_TOOLS) - if (TILEDB_AZURE AND NOT TILEDB_VCPKG) - message(FATAL_ERROR "Building tools with Azure enabled requires enabling TILEDB_VCPKG") - endif() add_subdirectory(tools) endif() diff --git a/bootstrap b/bootstrap index a149b12b7e1..5ae7321b8c7 100755 --- a/bootstrap +++ b/bootstrap @@ -39,8 +39,6 @@ Configuration: ['"${default_dependency}"'] --linkage specify the linkage of tiledb. Defaults to shared. [static|shared] - --force-build-all-deps force building of all dependencies, even those - already installed at system-level --remove-deprecations build TileDB without any deprecated APIs --disable-werror disables use of -Werror during build --disable-cpp-api disables building of the TileDB C++ API @@ -99,7 +97,6 @@ tiledb_gcs="OFF" tiledb_werror="ON" tiledb_tests="ON" tiledb_cpp_api="ON" -tiledb_force_all_deps="OFF" tiledb_remove_deprecations="OFF" tiledb_stats="ON" build_shared_libs="OFF" @@ -122,7 +119,7 @@ while test $# != 0; do --dependency=*) dir=`arg "$1"` dependency_dir="$dir";; --linkage=*) linkage=`arg "$1"`;; - --force-build-all-deps) tiledb_force_all_deps="ON";; + --force-build-all-deps) echo "Argument '--force-build-all-deps' has no effect and will be removed in a future version. Vcpkg builds all dependencies by default, please consult the guide in doc/dev/BUILD.md or vcpkg's documentation to see how to provide your own dependencies.";; --remove-deprecations) tiledb_remove_deprecations="ON";; --disable-werror) tiledb_werror="OFF";; --disable-tests) tiledb_tests="OFF";; @@ -246,7 +243,6 @@ ${cmake} -DCMAKE_BUILD_TYPE=${build_type} \ -DTILEDB_CCACHE=${tiledb_ccache} \ -DTILEDB_ARROW_TESTS=${tiledb_arrow_tests} \ -DTILEDB_WEBP=${tiledb_build_webp} \ - -DTILEDB_FORCE_ALL_DEPS=${tiledb_force_all_deps} \ -DTILEDB_REMOVE_DEPRECATIONS=${tiledb_remove_deprecations} \ -DTILEDB_SANITIZER="${sanitizer}" \ -DTILEDB_EXPERIMENTAL_FEATURES=${tiledb_experimental_features} \ @@ -255,4 +251,4 @@ ${cmake} -DCMAKE_BUILD_TYPE=${build_type} \ ${vcpkg_base_triplet} \ "${source_dir}" || die "failed to configure the project" -echo 'bootstrap success. Run "make" to build, "make check" to test, or "make -C tiledb install" to install.' +echo 'bootstrap success. Run "make" to build, "make check" to test, or "make install" to install.' diff --git a/bootstrap.ps1 b/bootstrap.ps1 index 03384495ec9..6fa40781daf 100644 --- a/bootstrap.ps1 +++ b/bootstrap.ps1 @@ -71,7 +71,7 @@ Enables building TileDB as a static library. Deprecated, use -Linkage static instead. .PARAMETER EnableBuildDeps -Enables building TileDB dependencies from source (superbuild) +Unused, kept for compatibility. .PARAMETER EnableTools Enables building TileDB CLI tools (experimental) @@ -277,9 +277,8 @@ if ($EnableExperimentalFeatures.IsPresent) { $TileDBExperimentalFeatures = "ON" } -$TileDBBuildDeps = "OFF"; if ($EnableBuildDeps.IsPresent) { - $TileDBBuildDeps = "ON" + Write-Warning "-EnableBuildDeps has no effect and will be removed in a future version. Vcpkg builds all dependencies by default, please consult the guide in doc/dev/BUILD.md or vcpkg's documentation to see how to provide your own dependencies." } $ArrowTests="OFF" @@ -330,7 +329,7 @@ if ($CMakeGenerator -eq $null) { # Run CMake. # We use Invoke-Expression so we can echo the command to the user. -$CommandString = "cmake $ArchFlag -DCMAKE_BUILD_TYPE=$BuildType -DCMAKE_INSTALL_PREFIX=""$InstallPrefix"" $VcpkgBaseTriplet -DCMAKE_PREFIX_PATH=""$DependencyDir"" -DMSVC_MP_FLAG=""/MP$BuildProcesses"" -DTILEDB_ASSERTIONS=$AssertionMode -DTILEDB_VERBOSE=$Verbosity -DTILEDB_AZURE=$UseAzure -DTILEDB_S3=$UseS3 -DTILEDB_GCS=$UseGcs -DTILEDB_SERIALIZATION=$UseSerialization -DTILEDB_WERROR=$Werror -DTILEDB_CPP_API=$CppApi -DTILEDB_TESTS=$Tests -DTILEDB_STATS=$Stats -DBUILD_SHARED_LIBS=$BuildSharedLibs -DTILEDB_FORCE_ALL_DEPS=$TileDBBuildDeps -DTILEDB_REMOVE_DEPRECATIONS=$_RemoveDeprecations -DTILEDB_TOOLS=$TileDBTools -DTILEDB_EXPERIMENTAL_FEATURES=$TileDBExperimentalFeatures -DTILEDB_WEBP=$BuildWebP -DTILEDB_CRC32=$BuildCrc32 -DTILEDB_ARROW_TESTS=$ArrowTests -DTILEDB_TESTS_AWS_S3_CONFIG=$ConfigureS3 $GeneratorFlag ""$SourceDirectory""" +$CommandString = "cmake $ArchFlag -DCMAKE_BUILD_TYPE=$BuildType -DCMAKE_INSTALL_PREFIX=""$InstallPrefix"" $VcpkgBaseTriplet -DCMAKE_PREFIX_PATH=""$DependencyDir"" -DMSVC_MP_FLAG=""/MP$BuildProcesses"" -DTILEDB_ASSERTIONS=$AssertionMode -DTILEDB_VERBOSE=$Verbosity -DTILEDB_AZURE=$UseAzure -DTILEDB_S3=$UseS3 -DTILEDB_GCS=$UseGcs -DTILEDB_SERIALIZATION=$UseSerialization -DTILEDB_WERROR=$Werror -DTILEDB_CPP_API=$CppApi -DTILEDB_TESTS=$Tests -DTILEDB_STATS=$Stats -DBUILD_SHARED_LIBS=$BuildSharedLibs -DTILEDB_REMOVE_DEPRECATIONS=$_RemoveDeprecations -DTILEDB_TOOLS=$TileDBTools -DTILEDB_EXPERIMENTAL_FEATURES=$TileDBExperimentalFeatures -DTILEDB_WEBP=$BuildWebP -DTILEDB_CRC32=$BuildCrc32 -DTILEDB_ARROW_TESTS=$ArrowTests -DTILEDB_TESTS_AWS_S3_CONFIG=$ConfigureS3 $GeneratorFlag ""$SourceDirectory""" Write-Host $CommandString Write-Host Invoke-Expression "$CommandString" diff --git a/cmake/Modules/FindAWSSDK_EP.cmake b/cmake/Modules/FindAWSSDK_EP.cmake deleted file mode 100644 index 0682e959c6d..00000000000 --- a/cmake/Modules/FindAWSSDK_EP.cmake +++ /dev/null @@ -1,173 +0,0 @@ -# -# FindAWSSDK_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# This module finds the AWS C++ SDK, installing it with an ExternalProject if -# necessary. It then defines the imported targets AWSSDK::, e.g. -# AWSSDK::aws-cpp-sdk-s3 or AWSSDK::aws-cpp-sdk-core. - -# Include some common helper functions. -include(TileDBCommon) - -set(AWS_SERVICES identity-management sts s3) - -if(TILEDB_VCPKG) - # Provides: ${AWSSDK_LINK_LIBRARIES} - find_package(AWSSDK REQUIRED QUIET COMPONENTS ${AWS_SERVICES}) - return() -endif() - - -############################################################################### -# Start superbuild/unmanaged/legacy version -############################################################################### - -##----------------------------------- -# early WIN32 audit of path length for aws sdk build where -# insufficient available path length causes sdk build failure. -if (WIN32 AND NOT TILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK) - if (TILEDB_SUPERBUILD AND TILEDB_S3) - string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} LENGTH_CMAKE_CURRENT_BINARY_DIR) - if ( NOT (LENGTH_CMAKE_CURRENT_BINARY_DIR LESS 61)) - message(FATAL_ERROR " build directory path likely too long for building awssdk/dependencies!") - return() - endif() - endif() -endif() -##----------------------------------- - -# If the EP was built, it will install the AWSSDKConfig.cmake file, which we -# can use with find_package. CMake uses CMAKE_PREFIX_PATH to locate find -# modules. -set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${TILEDB_EP_INSTALL_PREFIX}") - -if(DEFINED ENV{AWSSDK_ROOT_DIR}) - set(AWSSDK_ROOT_DIR $ENV{AWSSDK_ROOT_DIR}) -else() - set(AWSSDK_ROOT_DIR "${TILEDB_EP_INSTALL_PREFIX}") -endif() - -# Check to see if the SDK is installed (which provides the find module). -# This will either use the system-installed AWSSDK find module (if present), -# or the superbuild-installed find module. -if (TILEDB_SUPERBUILD) - # Don't use find_package in superbuild if we are forcing all deps. - # That's because the AWSSDK config file hard-codes a search of /usr, - # /usr/local, etc. - if (NOT TILEDB_FORCE_ALL_DEPS) - find_package(AWSSDK CONFIG COMPONENTS ${AWS_SERVICES}) - endif() -else() - find_package(AWSSDK CONFIG COMPONENTS ${AWS_SERVICES}) -endif() - -if (NOT AWSSDK_FOUND) - if (TILEDB_SUPERBUILD) - message(STATUS "Could NOT find AWSSDK") - message(STATUS "Adding AWSSDK as an external project") - - set(DEPENDS) - if (NOT WIN32 AND TARGET ep_curl) - list(APPEND DEPENDS ep_curl) - endif() - if (NOT WIN32 AND TARGET ep_openssl) - list(APPEND DEPENDS ep_openssl) - endif() - if (TARGET ep_zlib) - list(APPEND DEPENDS ep_zlib) - endif() - - # Set AWS cmake build to use specified build type except for gcc - # For aws sdk and gcc we must always build in release mode - # See https://github.com/TileDB-Inc/TileDB/issues/1351 and - # https://github.com/awslabs/aws-checksums/issues/8 - set(AWS_CMAKE_BUILD_TYPE $) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(AWS_CMAKE_BUILD_TYPE "Release") - endif() - - # Work around for: https://github.com/aws/aws-sdk-cpp/pull/1187 - # AWS SDK builds it's "aws-common" dependencies using `execute_process` to run cmake directly, - # and does not pass the CMAKE_GENERATOR PLATFORM, so those projects default to Win32 builds, - # causing linkage errors. - if (CMAKE_GENERATOR MATCHES "Visual Studio 14.*" OR CMAKE_GENERATOR MATCHES "Visual Studio 15.*" - AND NOT CMAKE_GENERATOR MATCHES ".*Win64") - - set(_CMKGEN_OLD "${CMAKE_GENERATOR}") - set(_CMKPLT_OLD "${CMAKE_GENERATOR_PLATFORM}") - set(CMAKE_GENERATOR "${CMAKE_GENERATOR} Win64") - set(CMAKE_GENERATOR_PLATFORM "") - endif() - - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR NOT WIN32) - set(CONDITIONAL_CXX_FLAGS "-DCMAKE_CXX_FLAGS=-Wno-nonnull -Wno-error=deprecated-declarations") - endif() - - ExternalProject_Add(ep_awssdk - PREFIX "externals" - # Set download name to avoid collisions with only the version number in the filename - DOWNLOAD_NAME ep_awssdk.zip - # We download with git clone because the repository has submodules - GIT_REPOSITORY "https://github.com/aws/aws-sdk-cpp.git" - GIT_TAG "1.11.160" - CMAKE_ARGS - -DCMAKE_BUILD_TYPE=${AWS_CMAKE_BUILD_TYPE} - -DENABLE_TESTING=OFF - -DAWS_SDK_WARNINGS_ARE_ERRORS=OFF - -DBUILD_ONLY=s3\\$core\\$identity-management\\$sts - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_INSTALL_BINDIR=lib - -DENABLE_UNITY_BUILD=ON - -DCUSTOM_MEMORY_MANAGEMENT=0 - ${CONDITIONAL_CXX_FLAGS} - -DCMAKE_PREFIX_PATH=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - DEPENDS ${DEPENDS} - ) - - # restore cached values - if (DEFINED _CMKGEN_OLD) - - set(CMAKE_GENERATOR "${_CMKGEN_OLD}") - set(CMAKE_GENERATOR_PLATFORM "${_CMKPLT_OLD}") - endif() - - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_awssdk) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_AWSSDK_EP_BUILT=TRUE - ) - else () - message(FATAL_ERROR "Could not find AWSSDK (required).") - endif () -endif () diff --git a/cmake/Modules/FindBzip2_EP.cmake b/cmake/Modules/FindBzip2_EP.cmake deleted file mode 100644 index 6a77d8b410d..00000000000 --- a/cmake/Modules/FindBzip2_EP.cmake +++ /dev/null @@ -1,142 +0,0 @@ -# -# FindBzip2_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Bzip2 library, installing with an ExternalProject as necessary. -# This module defines: -# - BZIP2_INCLUDE_DIR, directory containing headers -# - BZIP2_LIBRARIES, the Bzip2 library path -# - BZIP2_FOUND, whether Bzip2 has been found -# - The BZip2::BZip2 imported target - -# Include some common helper functions. -include(TileDBCommon) - -if(TILEDB_VCPKG) - find_package(BZip2 REQUIRED) - return() -endif() - -# First check for a static version in the EP prefix. -find_library(BZIP2_LIBRARIES - NAMES - libbz2static${CMAKE_STATIC_LIBRARY_SUFFIX} - libbz2${CMAKE_STATIC_LIBRARY_SUFFIX} - PATHS ${TILEDB_EP_INSTALL_PREFIX} - PATH_SUFFIXES lib - NO_DEFAULT_PATH -) - -if (BZIP2_LIBRARIES) - set(BZIP2_STATIC_EP_FOUND TRUE) - find_path(BZIP2_INCLUDE_DIR - NAMES bzlib.h - PATHS ${TILEDB_EP_INSTALL_PREFIX} - PATH_SUFFIXES include - NO_DEFAULT_PATH - ) -elseif(NOT TILEDB_FORCE_ALL_DEPS) - set(BZIP2_STATIC_EP_FOUND FALSE) - # Static EP not found, search in system paths. - find_library(BZIP2_LIBRARIES - NAMES - bz2 libbz2 - PATH_SUFFIXES lib bin - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - find_path(BZIP2_INCLUDE_DIR - NAMES bzlib.h - PATH_SUFFIXES include - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) -endif() - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bzip2 - REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR -) - -if (NOT BZIP2_FOUND) - if (TILEDB_SUPERBUILD) - message(STATUS "Adding Bzip2 as an external project") - if (WIN32) - ExternalProject_Add(ep_bzip2 - PREFIX "externals" - URL "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" - URL_HASH SHA1=bf7badf7e248e0ecf465d33c2f5aeec774209227 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - UPDATE_COMMAND "" - PATCH_COMMAND - ${CMAKE_COMMAND} -E copy ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_bzip2/CMakeLists.txt ${CMAKE_CURRENT_BINARY_DIR}/externals/src/ep_bzip2 - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - else() - if (CMAKE_OSX_ARCHITECTURES STREQUAL arm64) - set(BZIP2_CFLAGS "-fPIC -target arm64-apple-darwin") - elseif(CMAKE_OSX_ARCHITECTURES STREQUAL x86_64) - set(BZIP2_CFLAGS "-fPIC -target x86_64-apple-darwin") - else() - set(BZIP2_CFLAGS "-fPIC") - endif() - - # We build bzip2 with -fPIC on non-Windows platforms so that we can link the static library - # to the shared TileDB library. This allows us to avoid having to install the bzip2 libraries - # alongside TileDB. - ExternalProject_Add(ep_bzip2 - PREFIX "externals" - URL "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" - URL_HASH SHA1=bf7badf7e248e0ecf465d33c2f5aeec774209227 - CONFIGURE_COMMAND "" - BUILD_IN_SOURCE TRUE - BUILD_COMMAND "" - INSTALL_COMMAND $(MAKE) CFLAGS=${BZIP2_CFLAGS} PREFIX=${TILEDB_EP_INSTALL_PREFIX} install - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - endif() - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_BZIP2_EP_BUILT=TRUE - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_bzip2) - else() - message(FATAL_ERROR "Unable to find Bzip2") - endif() -endif() - -if (BZIP2_FOUND AND NOT TARGET BZip2::BZip2) - add_library(BZip2::BZip2 UNKNOWN IMPORTED) - set_target_properties(BZip2::BZip2 PROPERTIES - IMPORTED_LOCATION "${BZIP2_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${BZIP2_INCLUDE_DIR}" - ) -endif() diff --git a/cmake/Modules/FindCapnp_EP.cmake b/cmake/Modules/FindCapnp_EP.cmake deleted file mode 100644 index d177cb0f33f..00000000000 --- a/cmake/Modules/FindCapnp_EP.cmake +++ /dev/null @@ -1,158 +0,0 @@ -# -# FindCapnp_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Capnp library, installing with an ExternalProject as necessary. -# This module defines: -# - CAPNP_FOUND, whether Capnp has been found -# - The CapnProto::{capnp,kj,capnp-json} imported targets - -# Include some common helper functions. -include(TileDBCommon) - -if (TILEDB_VCPKG AND TILEDB_SERIALIZATION) - find_package(CapnProto REQUIRED) - return() -endif() - - -# If the EP was built, it will install the CapnProtoConfig.cmake file, which we -# can use with find_package. - -set(TILEDB_CAPNPROTO_VERSION 1.0.1) -set(TILEDB_CAPNPROTO_GITTAG "v1.0.1") -set(TILEDB_CAPNPROTO_HASH_SPEC "SHA1=a1ae37ec1731eef93d2ce1ffa959259e26d25874") -set(TILEDB_CAPNPROTO_URL "https://github.com/capnproto/capnproto/archive/v1.0.1.tar.gz") - -# First try the CMake find module. -if (NOT TILEDB_FORCE_ALL_DEPS OR TILEDB_CAPNP_EP_BUILT) - if (TILEDB_CAPNP_EP_BUILT) - # If we built it from the source always force no default path - SET(TILEDB_CAPNP_NO_DEFAULT_PATH NO_DEFAULT_PATH) - else() - SET(TILEDB_CAPNP_NO_DEFAULT_PATH ${TILEDB_DEPS_NO_DEFAULT_PATH}) - endif() - - find_package(CapnProto - ${TILEDB_CAPNPROTO_VERSION} EXACT - PATHS ${TILEDB_EP_INSTALL_PREFIX} - ${TILEDB_CAPNP_NO_DEFAULT_PATH} - ) - set(CAPNP_FOUND ${CapnProto_FOUND}) -endif() - -# If not found, add it as an external project -if (NOT CAPNP_FOUND) - message(STATUS "Cap'n Proto was not found") - if (TILEDB_SUPERBUILD) - message(STATUS "Adding Capnp as an external project") - - if (WIN32) - find_package(Git REQUIRED) - set(CONDITIONAL_PATCH - cd ${CMAKE_SOURCE_DIR} && - ${GIT_EXECUTABLE} apply --ignore-whitespace -p1 --unsafe-paths --verbose --directory=${TILEDB_EP_SOURCE_DIR}/ep_capnp < ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_capnp/disable-C-20-co-routines.patch && - ${GIT_EXECUTABLE} apply --ignore-whitespace -p1 --unsafe-paths --verbose --directory=${TILEDB_EP_SOURCE_DIR}/ep_capnp < ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_capnp/undef-KJ_USE_EPOLL-for-ANDROID_PLATFORM-23.patch) - else() - set(CONDITIONAL_PATCH patch -N -p1 < ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_capnp/disable-C-20-co-routines.patch && - patch -N -p1 < ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_capnp/undef-KJ_USE_EPOLL-for-ANDROID_PLATFORM-23.patch) - endif() - - ExternalProject_Add(ep_capnp - PREFIX "externals" - DOWNLOAD_NAME ep_capnp.${TILEDB_CAPNPROTO_VERSION}.tar.gz - URL ${TILEDB_CAPNPROTO_URL} - URL_HASH ${TILEDB_CAPNPROTO_HASH_SPEC} - CMAKE_ARGS - -DCMAKE_PREFIX_PATH=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=Release - -DBUILD_TESTING=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - PATCH_COMMAND - ${CONDITIONAL_PATCH} - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_capnp) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_CAPNP_EP_BUILT=TRUE - ) - else() - message(FATAL_ERROR "Unable to find Capnp") - endif() -else() - add_definitions(${CAPNP_DEFINITIONS}) -endif() - - -if(CAPNP_FOUND AND NOT WIN32) - # We handle the found case first because ubuntu's install of capnproto is missing libcapnp-json - # so we must first make sure the found case has all the appropriate libs, else we will build from source - # List of all required Capnp libraries. - set(CAPNP_LIB_NAMES capnp kj capnp-json) - foreach(LIB ${CAPNP_LIB_NAMES}) - if (NOT TARGET CapnProto::${LIB} AND NOT CAPNP_LIBRARIES) - message(FATAL_ERROR "Required target CapnProto::${LIB} not defined") - elseif (TARGET CapnProto::${LIB}) - message(STATUS "Found CapnProto lib: ${LIB}") - elseif (NOT TARGET CapnProto::${LIB}) - message(STATUS "NOT Found Target for CapnProto lib: ${LIB}") - set(SHOULD_CAPNP_LIBRARIES 1) - endif() - endforeach() - if (SHOULD_CAPNP_LIBRARIES) - message(STATUS "Checking libraries in ${CAPNP_LIBRARIES}") - foreach(NEEDED_LIB ${CAPNP_LIB_NAMES}) - foreach(LIB ${CAPNP_LIBRARIES}) - if (LIB MATCHES "lib${NEEDED_LIB}.") - set(FOUND_${NEEDED_LIB} 1) - if (NOT TARGET CapnProto::${NEEDED_LIB}) - message(STATUS "Adding target for CapnProto::${NEEDED_LIB} from CAPNP_LIBRARIES") - add_library(CapnProto::${NEEDED_LIB} UNKNOWN IMPORTED) - set_target_properties(CapnProto::${NEEDED_LIB} PROPERTIES - IMPORTED_LOCATION "${LIB}" - INTERFACE_INCLUDE_DIRECTORIES "${CAPNP_INCLUDE_DIR}" - ) - endif() - endif() - endforeach() - if (NOT FOUND_${NEEDED_LIB}) - message("Cap'n Proto ${NEEDED_LIB} not found on system, reverting to external project") - unset(CAPNP_FOUND) - endif() - endforeach() - endif() -endif() - - - - - diff --git a/cmake/Modules/FindCatch_EP.cmake b/cmake/Modules/FindCatch_EP.cmake deleted file mode 100644 index 24d0dc42a69..00000000000 --- a/cmake/Modules/FindCatch_EP.cmake +++ /dev/null @@ -1,101 +0,0 @@ -# -# FindCatch_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Catch library, installing with an ExternalProject as necessary. -# This module defines: -# - CATCH_INCLUDE_DIR, directory containing headers -# - Catch2_FOUND, whether Catch has been found -# - TILEDB_CATCH2_SOURCES_DIR directory containing headers, lib source -# - The Catch2::Catch2 imported target - -if (NOT TILEDB_TESTS) - message(FATAL_ERROR "FindCatch_EP should not be used with TILEDB_TESTS=OFF") -endif() - -# Include some common helper functions. -include(TileDBCommon) - -# Search the path set during the superbuild for the EP. -message(VERBOSE "searching for catch in ${TILEDB_EP_INSTALL_PREFIX}") -set(CATCH_PATHS ${TILEDB_EP_INSTALL_PREFIX}) - -if (NOT TILEDB_FORCE_ALL_DEPS OR TILEDB_CATCH_EP_BUILT) - find_path(CATCH_INCLUDE_DIR - NAMES catch2/catch_all.hpp - PATHS ${CATCH_PATHS} - ) -endif() - -find_package(Catch2 3.1 - HINTS - ${CATCH_PATHS} - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) -if(Catch2_FOUND) - set(CATCH_INCLUDE_DIR ${Catch2_INCLUDE_DIR}) - set(CATCH_LIBRARIES ${Catch2_LIBRARIES}) -endif() - -message(VERBOSE "CATCH_INCLUDE_DIR is \"${CATCH_INCLUDE_DIR}\", CATCH_LIBRARIES is \"${CATCH_LIBRARIES}\"") - -if(Catch2_FOUND) - message(VERBOSE "Catch2_FOUND is ${Catch2_FOUND}, CATCH_INCLUDE_DIR is \"${CATCH_INCLUDE_DIR}\", CATCH_LIBRARIES is \"${CATCH_LIBRARIES}\"") -else() - message(VERBOSE "TILEDB_SUPERBUILD is ${TILEDB_SUPERBUILD}, Catch2_FOUND is ${Catch2_FOUND}") -endif() - -if (NOT Catch2_FOUND AND TILEDB_SUPERBUILD) - message(STATUS "Adding Catch as an external project") - ExternalProject_Add(ep_catch - PREFIX "externals" - # Set download name to avoid collisions with only the version number in the filename - DOWNLOAD_NAME ep_catch.zip - URL "https://github.com/catchorg/Catch2/archive/v3.3.2.zip" - URL_HASH SHA1=ab23bef93b3c5ddf696d8855f34a3e882e71c64b - CMAKE_ARGS - -DCMAKE_BUILD_TYPE=$ - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - # https://stackoverflow.com/questions/66227246/catch2-undefined-reference-to-catchstringmaker - # catch build reportedly defaults to c++14, apparently building as cxx17 avoids... - -DCMAKE_CXX_STANDARD=17 # to avoid undefined ...Catch::StringMaker - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_catch) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_CATCH_EP_BUILT=TRUE - ) -endif() - -# Many tiledb Find...s check for an expected target here and -# create tiledb's own pseudo version of it if not found. Since -# this Find... is now requesting a specific version or higher the -# target need should always be satisfied. diff --git a/cmake/Modules/FindClipp_EP.cmake b/cmake/Modules/FindClipp_EP.cmake deleted file mode 100644 index 3eaf29978f6..00000000000 --- a/cmake/Modules/FindClipp_EP.cmake +++ /dev/null @@ -1,96 +0,0 @@ -# -# FindClipp_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Clipp library, installing with an ExternalProject as necessary. -# -# This module defines: -# - CLIPP_INCLUDE_DIR, directory containing headers -# - CLIPP_FOUND, whether Clipp has been found -# - The Clipp::Clipp imported target - -# Search the path set during the superbuild for the EP. -set(CLIPP_PATHS ${TILEDB_EP_INSTALL_PREFIX}) - -if (TILEDB_VCPKG) - find_package(clipp REQUIRED) - return() -endif() - -if (NOT TILEDB_FORCE_ALL_DEPS OR TILEDB_CLIPP_EP_BUILT) - find_path(CLIPP_INCLUDE_DIR - NAMES clipp.h - PATHS ${CLIPP_PATHS} - PATH_SUFFIXES include - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) -endif() - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Clipp - REQUIRED_VARS CLIPP_INCLUDE_DIR -) - -if (NOT CLIPP_FOUND) - if (TILEDB_SUPERBUILD) - message(STATUS "Adding Clipp as an external project") - ExternalProject_Add(ep_clipp - PREFIX "externals" - # Set download name to avoid collisions with only the version number in the filename - DOWNLOAD_NAME ep_clipp.zip - URL "https://github.com/muellan/clipp/archive/v1.2.3.zip" - URL_HASH SHA1=5cb4255d29e1b47b5d5abf7481befe659ffc3ee1 - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND - ${CMAKE_COMMAND} -E make_directory ${TILEDB_EP_INSTALL_PREFIX}/include - COMMAND - ${CMAKE_COMMAND} -E copy_if_different - ${TILEDB_EP_BASE}/src/ep_clipp/include/clipp.h - ${TILEDB_EP_INSTALL_PREFIX}/include/ - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_clipp) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_CLIPP_EP_BUILT=TRUE - ) - else() - message(FATAL_ERROR "Unable to find Clipp") - endif() -endif() - -# Create the imported target for Clipp -if (CLIPP_FOUND AND NOT TARGET clipp::clipp) - add_library(clipp::clipp INTERFACE IMPORTED) - set_target_properties(clipp::clipp PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${CLIPP_INCLUDE_DIR}" - ) -endif() diff --git a/cmake/Modules/FindCurl_EP.cmake b/cmake/Modules/FindCurl_EP.cmake deleted file mode 100644 index 06879090691..00000000000 --- a/cmake/Modules/FindCurl_EP.cmake +++ /dev/null @@ -1,246 +0,0 @@ -# -# FindCurl_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# - -if (TARGET CURL OR NOT (TILEDB_SERIALIZATION OR TILEDB_GCS OR TILEDB_S3 OR TILEDB_AZURE)) - return() -endif() - -if (TILEDB_VCPKG) - find_package(CURL REQUIRED) - return() -endif() - -# === Superbuild - -# Search the path set during the superbuild for the EP. -set(CURL_PATHS ${TILEDB_EP_INSTALL_PREFIX}) - -# If the EP was built, it will install the CURLConfig.cmake file, which we -# can use with find_package. - -# First try the CMake-provided find script. -if (NOT TILEDB_FORCE_ALL_DEPS) - find_package(CURL ${TILEDB_DEPS_NO_DEFAULT_PATH}) -endif() - -# Next try finding the superbuild external project -if (NOT CURL_FOUND) - find_path(CURL_INCLUDE_DIR - NAMES curl/curl.h - PATHS ${CURL_PATHS} - PATH_SUFFIXES include - ${TILEDB_DEPS_NO_DEFAULT_PATH}) - - # Link statically if installed with the EP. - find_library(CURL_LIBRARIES - NAMES - libcurl${CMAKE_STATIC_LIBRARY_SUFFIX} - libcurl-d${CMAKE_STATIC_LIBRARY_SUFFIX} - PATHS ${CURL_PATHS} - PATH_SUFFIXES lib - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curl - REQUIRED_VARS CURL_LIBRARIES CURL_INCLUDE_DIR - ) -endif() - -if (NOT CURL_FOUND AND TILEDB_SUPERBUILD) - message(STATUS "Adding Curl as an external project") - if (WIN32) - set(WITH_SSL "-DCMAKE_USE_SCHANNEL=ON") - ExternalProject_Add(ep_curl - PREFIX "externals" - # Set download name to avoid collisions with only the version number in the filename - DOWNLOAD_NAME ep_curl.tar.gz - URL "https://curl.se/download/curl-7.88.1.tar.gz" - URL_HASH SHA1=6ae5229c36badb822641bb14958e7d227c57611d - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=Release - -DBUILD_SHARED_LIBS=OFF - -DCURL_DISABLE_LDAP=ON - -DCURL_DISABLE_LDAPS=ON - -DCMAKE_USE_LIBSSH2=OFF - -DCURL_STATICLIB=ON - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DHTTP_ONLY=ON - # NOTE: as of Curl 7.74 there is no way to set ZSTD paths for cmake - # ZSTD is not enabled until curl support being able to point to superbuild - #-DCURL_ZSTD=ON - "${WITH_SSL}" - "-DCMAKE_C_FLAGS=${CFLAGS_DEF}" - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - - else() - set(DEPENDS) - if (TARGET ep_openssl) - # This branch specifically intends that curl will find our OpenSSL - # via pkg-config. Ensure it exists to avoid confusing errors. - find_package(PkgConfig REQUIRED) - - list(APPEND DEPENDS ep_openssl) - set(WITH_SSL "--with-ssl") - set(SSL_PKG_CONFIG_PATH "${TILEDB_EP_INSTALL_PREFIX}/lib/pkgconfig:${TILEDB_EP_INSTALL_PREFIX}/lib64/pkgconfig") - elseif (TILEDB_OPENSSL_DIR) - # ensure that curl links against the same libSSL - set(WITH_SSL "--with-ssl=${TILEDB_OPENSSL_DIR}") - else() - message(WARNING "TileDB FindOpenSSL_EP did not set TILEDB_OPENSSL_DIR. Falling back to autotools detection.") - # ensure that curl config errors out if SSL not available - set(WITH_SSL "--with-ssl") - endif() - - if (TARGET ep_zlib) - list(APPEND DEPENDS ep_zlib) - set(WITH_ZLIB "--with-zlib=${TILEDB_EP_INSTALL_PREFIX}") - elseif (TILEDB_ZLIB_DIR) - # ensure that curl links against the same libz - set(WITH_ZLIB "--with-zlib=${TILEDB_ZLIB_DIR}") - else() - message(WARNING "TileDB FindZlib_EP did not set TILEDB_ZLIB_DIR. Falling back to autotools detection.") - # ensure that curl config errors out if SSL not available - set(WITH_ZLIB "--with-zlib") - endif() - - if (APPLE) - set(WITH_CA_BUNDLE "--with-ca-bundle=/etc/ssl/cert.pem") - endif() - - if (TARGET ep_zstd) - list(APPEND DEPENDS ep_zstd) - set(WITH_ZLIB "--with-zstd=${TILEDB_EP_INSTALL_PREFIX}") - elseif (TILEDB_ZSTD_DIR) - # ensure that curl links against the same libz - set(WITH_ZSTD "--with-zstd=${TILEDB_ZSTD_DIR}") - else() - message(WARNING "TileDB FindZstd_EP did not set TILEDB_ZSTD_DIR. Falling back to autotools detection.") - # ensure that curl config errors out if SSL not available - set(WITH_ZSTD "--with-zstd") - endif() - - # Support cross compilation of MacOS - if (CMAKE_OSX_ARCHITECTURES STREQUAL arm64) - set(CURL_CROSS_COMPILATION_FLAGS "CFLAGS=${CFLAGS} -arch arm64" "LDFLAGS=${LDFLAGS} -arch arm64" --host=aarch64-apple-darwin) - elseif(CMAKE_OSX_ARCHITECTURES STREQUAL x86_64) - set(CURL_CROSS_COMPILATION_FLAGS "CFLAGS=${CFLAGS} -arch x86_64" "LDFLAGS=${LDFLAGS} -arch x86_64" --host=x86_64-apple-darwin) - endif() - - ExternalProject_Add(ep_curl - PREFIX "externals" - URL "https://curl.se/download/curl-7.88.1.tar.gz" - URL_HASH SHA1=6ae5229c36badb822641bb14958e7d227c57611d - CONFIGURE_COMMAND - ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${SSL_PKG_CONFIG_PATH} ${TILEDB_EP_BASE}/src/ep_curl/configure - --prefix=${TILEDB_EP_INSTALL_PREFIX} - --enable-http - --enable-optimize - --enable-shared=no - --with-pic=yes - --without-brotli - --without-bearssl - --without-cyassl - --without-wolfssl - --without-polarssl - --without-mbedtls - --without-gnutls - --without-gssapi - --without-idn2 - --without-libssh2 - --without-librtmp - --without-nghttp2 - --without-zstd - --disable-ares - --disable-dict - --disable-file - --disable-ftp - --disable-gopher - --disable-imap - --disable-mqtt - --disable-ldap - --disable-ldaps - --disable-pop3 - --disable-rtmp - --disable-rtsp - --disable-scp - --disable-sftp - --disable-smb - --disable-smtp - --disable-telnet - --disable-tftp - ${WITH_SSL} - ${WITH_ZLIB} - ${WITH_ZSTD} - ${WITH_CA_BUNDLE} - ${CURL_CROSS_COMPILATION_FLAGS} - BUILD_IN_SOURCE TRUE - BUILD_COMMAND $(MAKE) - INSTALL_COMMAND $(MAKE) install - DEPENDS ${DEPENDS} - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - endif() - - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_curl) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_CURL_EP_BUILT=TRUE - ) -endif() - -if (CURL_FOUND) - message(STATUS "Found CURL: '${CURL_LIBRARIES}' (found version \"${CURL_VERSION}\")") - - # If the libcurl target is missing this is an older version of curl found, don't attempt to use cmake target - if (NOT TARGET CURL::libcurl) - add_library(CURL::libcurl UNKNOWN IMPORTED) - set_target_properties(CURL::libcurl PROPERTIES - IMPORTED_LOCATION "${CURL_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR};${CURL_INCLUDE_DIRS}" - ) - # If the CURL::libcurl target exists this is new enough curl version to rely on the cmake target properties - else() - get_target_property(LIBCURL_TYPE CURL::libcurl TYPE) - # CURL_STATICLIB is missing for curl versions <7.61.1 - if(CURL_VERSION VERSION_LESS 7.61.1 AND LIBCURL_TYPE STREQUAL "STATIC_LIBRARY") - set_target_properties(CURL::libcurl PROPERTIES - INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB) - endif() - endif() - -endif() diff --git a/cmake/Modules/FindLZ4.cmake b/cmake/Modules/FindLZ4.cmake new file mode 100644 index 00000000000..23321dc2680 --- /dev/null +++ b/cmake/Modules/FindLZ4.cmake @@ -0,0 +1,70 @@ +# +# FindLZ4.cmake +# +# +# The MIT License +# +# Copyright (c) 2024 TileDB, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# Finds the LZ4 library. +# This module defines: +# - The lz4::lz4 imported target + +find_package(lz4 CONFIG) + +# The casing of the imported target's name differs. In the official CMake build system of +# lz4, it is called LZ4::lz4 (not yet released, see LZ4 pull requests 1372, 1413), while +# vcpkg uses its own build system called lz4::lz4, and Conda does not use CMake at all. +# Once lz4 releases a new version with these PRs merged, and vcpkg and Conda update to +# that version, and we update our vcpkg baseline to that version, we can simplify this logic. +if (lz4_FOUND) + if(TARGET LZ4::lz4) + add_library(lz4::lz4 ALIAS LZ4::lz4) + return() + elseif(TARGET lz4::lz4) + return() + endif() +endif() + +# Package not found, search in system paths. +find_library(LZ4_LIBRARIES + NAMES + lz4 liblz4 + PATH_SUFFIXES lib bin +) + +find_path(LZ4_INCLUDE_DIR + NAMES lz4.h + PATH_SUFFIXES include +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 + REQUIRED_VARS LZ4_LIBRARIES LZ4_INCLUDE_DIR +) + +if (LZ4_FOUND AND NOT TARGET lz4::lz4) + add_library(lz4::lz4 UNKNOWN IMPORTED) + set_target_properties(lz4::lz4 PROPERTIES + IMPORTED_LOCATION "${LZ4_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}" + ) +endif() diff --git a/cmake/Modules/FindLZ4_EP.cmake b/cmake/Modules/FindLZ4_EP.cmake deleted file mode 100644 index b044992998e..00000000000 --- a/cmake/Modules/FindLZ4_EP.cmake +++ /dev/null @@ -1,130 +0,0 @@ -# -# FindLZ4_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the LZ4 library, installing with an ExternalProject as necessary. -# This module defines: -# - LZ4_INCLUDE_DIR, directory containing headers -# - LZ4_LIBRARIES, the LZ4 library path -# - LZ4_FOUND, whether LZ4 has been found -# - The lz4::lz4 imported target - -# Include some common helper functions. -include(TileDBCommon) - -if(TILEDB_VCPKG) - find_package(lz4 REQUIRED) - return() -endif() - -# First check for a static version in the EP prefix. -find_library(LZ4_LIBRARIES - NAMES - liblz4${CMAKE_STATIC_LIBRARY_SUFFIX} - liblz4_static${CMAKE_STATIC_LIBRARY_SUFFIX} - lz4${CMAKE_STATIC_LIBRARY_SUFFIX} - PATHS ${TILEDB_EP_INSTALL_PREFIX} - PATH_SUFFIXES lib - NO_DEFAULT_PATH -) - -if (LZ4_LIBRARIES) - set(LZ4_STATIC_EP_FOUND TRUE) - find_path(LZ4_INCLUDE_DIR - NAMES lz4.h - PATHS ${TILEDB_EP_INSTALL_PREFIX} - PATH_SUFFIXES include - NO_DEFAULT_PATH - ) -elseif(NOT TILEDB_FORCE_ALL_DEPS) - set(LZ4_STATIC_EP_FOUND FALSE) - # Static EP not found, search in system paths. - find_library(LZ4_LIBRARIES - NAMES - lz4 liblz4 - PATH_SUFFIXES lib bin - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - find_path(LZ4_INCLUDE_DIR - NAMES lz4.h - PATH_SUFFIXES include - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) -endif() - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 - REQUIRED_VARS LZ4_LIBRARIES LZ4_INCLUDE_DIR -) - -if (NOT LZ4_FOUND) - if (TILEDB_SUPERBUILD) - message(STATUS "Adding LZ4 as an external project") - if (WIN32) - set(ARCH_SPEC -A X64) - endif() - set(LZ4_CMAKE_DIR "${TILEDB_EP_SOURCE_DIR}/ep_lz4/build/cmake/") - ExternalProject_Add(ep_lz4 - PREFIX "externals" - # Set download name to avoid collisions with only the version number in the filename - DOWNLOAD_NAME ep_lz4.zip - URL "https://github.com/lz4/lz4/archive/v1.9.3.zip" - URL_HASH SHA1=3e28f6691ee45c468b5aba3943bf26528b030a55 - CONFIGURE_COMMAND - ${CMAKE_COMMAND} - ${ARCH_SPEC} - -DLZ4_BUILD_LEGACY_LZ4C=OFF - -DLZ4_POSITION_INDEPENDENT_LIB=ON - -DBUILD_SHARED_LIBS=OFF - -DBUILD_STATIC_LIBS=ON - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - ${LZ4_CMAKE_DIR} - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_lz4) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_LZ4_EP_BUILT=TRUE - ) - else() - message(FATAL_ERROR "Unable to find LZ4") - endif() -endif() - -set(ignoreUnusedWarning "${TILEDB_LZ4_EP_BUILT}") - -if (LZ4_FOUND AND NOT TARGET lz4::lz4) - add_library(lz4::lz4 UNKNOWN IMPORTED) - set_target_properties(lz4::lz4 PROPERTIES - IMPORTED_LOCATION "${LZ4_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}" - ) -endif() diff --git a/cmake/Modules/FindLibMagic.cmake b/cmake/Modules/FindLibMagic.cmake new file mode 100644 index 00000000000..70ec93311e7 --- /dev/null +++ b/cmake/Modules/FindLibMagic.cmake @@ -0,0 +1,60 @@ +# +# FindLibMagic.cmake +# +# The MIT License +# +# Copyright (c) 2018-2021 TileDB, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# Finds the Magic library +# This module defines: +# - libmagic imported target +# - libmagic_DICTIONARY, location to magic.mgc + +# Include some common helper functions. +include(TileDBCommon) + +# The vcpkg libmagic port exports an unofficial CMake package. Try to find it first. +find_package(unofficial-libmagic CONFIG) +if (unofficial-libmagic_FOUND) + set(libmagic_DICTIONARY ${unofficial-libmagic_DICTIONARY}) +else() + # If the unofficial package is not found, try finding libmagic using the standard find commands. + find_path(libmagic_INCLUDE_DIR NAMES magic.h) + find_library(libmagic_LIBRARIES magic) + find_file(libmagic_DICTIONARY magic.mgc + PATH_SUFFIXES share/libmagic/misc share/misc + ) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(libmagic + REQUIRED_VARS + libmagic_INCLUDE_DIR + libmagic_LIBRARIES + libmagic_DICTIONARY + ) + + add_library(unofficial::libmagic::libmagic UNKNOWN IMPORTED) + set_target_properties(unofficial::libmagic::libmagic PROPERTIES + IMPORTED_LOCATION "${libmagic_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${libmagic_INCLUDE_DIR}" + ) +endif() +add_library(libmagic ALIAS unofficial::libmagic::libmagic) diff --git a/cmake/Modules/FindMagic_EP.cmake b/cmake/Modules/FindMagic_EP.cmake deleted file mode 100644 index efc039d3906..00000000000 --- a/cmake/Modules/FindMagic_EP.cmake +++ /dev/null @@ -1,168 +0,0 @@ -# -# FindMagic_EP.cmake -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Magic library, installing with an ExternalProject as necessary. -# This module defines: -# - libmagic_INCLUDE_DIR, directory containing headers -# - libmagic_LIBRARIES, the Magic library path -# - libmagic_FOUND, whether Magic has been found -# - libmagic_DICTIONARY, whether magic.mgc has been found -# - The libmagic imported target - -# Include some common helper functions. -include(TileDBCommon) - -if(TILEDB_VCPKG) - find_package(unofficial-libmagic CONFIG) - if (unofficial-libmagic_FOUND) - set(libmagic_DICTIONARY ${unofficial-libmagic_DICTIONARY}) - else() - find_path(libmagic_INCLUDE_DIR NAMES magic.h) - find_library(libmagic_LIBRARIES magic) - find_file(libmagic_DICTIONARY magic.mgc - PATH_SUFFIXES share/libmagic/misc share/misc - ) - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(libmagic - REQUIRED_VARS - libmagic_INCLUDE_DIR - libmagic_LIBRARIES - libmagic_DICTIONARY - ) - - if(NOT libmagic_FOUND) - message(FATAL_ERROR "Error finding libmagic") - endif() - - add_library(unofficial::libmagic::libmagic UNKNOWN IMPORTED) - set_target_properties(unofficial::libmagic::libmagic PROPERTIES - IMPORTED_LOCATION "${libmagic_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${libmagic_INCLUDE_DIR}" - ) - endif() - add_library(libmagic ALIAS unofficial::libmagic::libmagic) - return() -endif() - -# Search the path set during the superbuild for the EP. -set(LIBMAGIC_PATHS ${TILEDB_EP_INSTALL_PREFIX}) - -if(TILEDB_LIBMAGIC_EP_BUILT) - find_package(libmagic PATHS ${TILEDB_EP_INSTALL_PREFIX} ${TILEDB_DEPS_NO_DEFAULT_PATH}) -endif() - -if (TILEDB_LIBMAGIC_EP_BUILT) - find_path(libmagic_INCLUDE_DIR - NAMES magic.h - PATHS ${LIBMAGIC_PATHS} - PATH_SUFFIXES include - ${NO_DEFAULT_PATH} - ) - - if (NOT libmagic_INCLUDE_DIR) - find_path(libmagic_INCLUDE_DIR - NAMES file/file.h - PATHS ${LIBMAGIC_PATHS} - PATH_SUFFIXES include - ${NO_DEFAULT_PATH} - ) - endif() - - # Link statically if installed with the EP. - find_library(libmagic_LIBRARIES - libmagic - PATHS ${LIBMAGIC_PATHS} - PATH_SUFFIXES lib a - #${TILEDB_DEPS_NO_DEFAULT_PATH} - ${NO_DEFAULT_PATH} - ) - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(libmagic - REQUIRED_VARS libmagic_LIBRARIES libmagic_INCLUDE_DIR - ) -endif() - -# if not yet built add it as an external project -if(NOT TILEDB_LIBMAGIC_EP_BUILT) - if (TILEDB_SUPERBUILD) - message(STATUS "Adding Magic as an external project") - - if (WIN32) - set(CFLAGS_DEF "") - else() - set(CFLAGS_DEF "${CMAKE_C_FLAGS} -fPIC") - set(CXXFLAGS_DEF "${CMAKE_CXX_FLAGS} -fPIC") - endif() - - # For both windows/nix using tiledb fork of file-windows from julian-r who has build a cmake version and patched for msvc++ - # that was modified by tiledb to also build with cmake for nix - ExternalProject_Add(ep_magic - PREFIX "externals" - GIT_REPOSITORY "https://github.com/TileDB-Inc/file-windows.git" - GIT_TAG "5.38.2.tiledb" - GIT_SUBMODULES_RECURSE TRUE - UPDATE_COMMAND "" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_BUILD_TYPE=$ - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - "-DCMAKE_C_FLAGS=${CFLAGS_DEF}" - -Dlibmagic_STATIC_LIB=ON - -DBUILD_MAGIC_MACOS_UNIVERSAL=$ENV{BUILD_MAGIC_MACOS_UNIVERSAL} - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_magic) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_LIBMAGIC_EP_BUILT=TRUE - ) - - else() - message(FATAL_ERROR "Unable to find Magic") - endif() -endif() - -find_file(libmagic_DICTIONARY magic.mgc - PATHS ${LIBMAGIC_PATHS} - PATH_SUFFIXES bin share - ${NO_DEFAULT_PATH} -) - -if (libmagic_FOUND AND NOT TARGET libmagic) - message(STATUS "Found Magic, adding imported target: ${libmagic_LIBRARIES}") - add_library(libmagic UNKNOWN IMPORTED) - set_target_properties(libmagic PROPERTIES - IMPORTED_LOCATION "${libmagic_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${libmagic_INCLUDE_DIR}" - ) -endif() diff --git a/cmake/Modules/FindOpenSSL_EP.cmake b/cmake/Modules/FindOpenSSL_EP.cmake deleted file mode 100644 index 56a6e944df6..00000000000 --- a/cmake/Modules/FindOpenSSL_EP.cmake +++ /dev/null @@ -1,155 +0,0 @@ -# -# FindOpenSSL_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# # The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the OpenSSL library, installing with an ExternalProject as necessary. -# This module defines: -# - OPENSSL_INCLUDE_DIR, directory containing headers -# - OPENSSL_LIBRARIES, the OpenSSL library path -# - OPENSSL_FOUND, whether OpenSSL has been found -# - The OpenSSL::SSL and OpenSSL::Crypto imported targets - -# Include some common helper functions. -include(TileDBCommon) - -if (TILEDB_VCPKG) - find_package(OpenSSL REQUIRED) - return() -endif() - -# Search the path set during the superbuild for the EP. -set(OPENSSL_PATHS ${TILEDB_EP_INSTALL_PREFIX}) - -# Add /usr/local/opt, as Homebrew sometimes installs it there. -set (HOMEBREW_BASE "/usr/local/opt/openssl") -if (NOT TILEDB_DEPS_NO_DEFAULT_PATH) - list(APPEND OPENSSL_PATHS ${HOMEBREW_BASE}) -endif() - -# First try the CMake-provided find script. -# NOTE: must use OPENSSL_ROOT_DIR. HINTS does not work. -set(OPENSSL_ROOT_DIR ${OPENSSL_PATHS}) -if (NOT TILEDB_FORCE_ALL_DEPS) - find_package(OpenSSL - 1.1.0 - ${TILEDB_DEPS_NO_DEFAULT_PATH}) -endif() - -# Next try finding the superbuild external project -if (NOT OPENSSL_FOUND AND TILEDB_FORCE_ALL_DEPS) - find_path(OPENSSL_INCLUDE_DIR - NAMES openssl/ssl.h - PATHS ${OPENSSL_PATHS} - PATH_SUFFIXES include - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - - # Link statically if installed with the EP. - find_library(OPENSSL_SSL_LIBRARY - NAMES - libssl${CMAKE_STATIC_LIBRARY_SUFFIX} - PATHS ${OPENSSL_PATHS} - PATH_SUFFIXES lib - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - - find_library(OPENSSL_CRYPTO_LIBRARY - NAMES - libcrypto${CMAKE_STATIC_LIBRARY_SUFFIX} - PATHS ${OPENSSL_PATHS} - PATH_SUFFIXES lib - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSSL - REQUIRED_VARS OPENSSL_SSL_LIBRARY OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR - ) -endif() - -if (NOT OPENSSL_FOUND AND TILEDB_SUPERBUILD) - message(STATUS "Adding OpenSSL as an external project") - - if (WIN32) - message(FATAL_ERROR "OpenSSL external project unimplemented on Windows.") - endif() - - # Support cross compilation of MacOS - if (CMAKE_OSX_ARCHITECTURES STREQUAL arm64) - set(OPENSSL_CONFIG_CMD ${CMAKE_COMMAND} -E env "ARCHFLAGS=\\\\-arch arm64" ${TILEDB_EP_BASE}/src/ep_openssl/Configure darwin64-arm64-cc --prefix=${TILEDB_EP_INSTALL_PREFIX} no-shared -fPIC) - elseif(CMAKE_OSX_ARCHITECTURES STREQUAL x86_64) - set(OPENSSL_CONFIG_CMD ${CMAKE_COMMAND} -E env "ARCHFLAGS=\\\\-arch x86_64" ${TILEDB_EP_BASE}/src/ep_openssl/Configure darwin64-x86_64-cc --prefix=${TILEDB_EP_INSTALL_PREFIX} no-shared -fPIC) - else() - set(OPENSSL_CONFIG_CMD ${TILEDB_EP_BASE}/src/ep_openssl/config --prefix=${TILEDB_EP_INSTALL_PREFIX} no-shared -fPIC) - endif() - - ExternalProject_Add(ep_openssl - PREFIX "externals" - URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1i.zip" - URL_HASH SHA1=627938302f681dfac186a9225b65368516b4f484 - CONFIGURE_COMMAND ${OPENSSL_CONFIG_CMD} - BUILD_IN_SOURCE TRUE - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - - set(TILEDB_OPENSSL_DIR "${TILEDB_EP_INSTALL_PREFIX}") - - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_openssl) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_OPENSSL_EP_BUILT=TRUE - ) -endif() - -if (OPENSSL_FOUND) - message(STATUS "Found OpenSSL: ${OPENSSL_SSL_LIBRARY}") - message(STATUS "Found OpenSSL crypto: ${OPENSSL_CRYPTO_LIBRARY}") - message(STATUS "OpenSSL Root: ${OPENSSL_ROOT_DIR}") - - if (DEFINED OPENSSL_INCLUDE_DIR AND "${OPENSSL_INCLUDE_DIR}" MATCHES "${HOMEBREW_BASE}.*") - # define TILEDB_OPENSSL_DIR so we can ensure curl links the homebrew version - set(TILEDB_OPENSSL_DIR "${HOMEBREW_BASE}") - endif() - - - if (NOT TARGET OpenSSL::SSL) - add_library(OpenSSL::SSL UNKNOWN IMPORTED) - set_target_properties(OpenSSL::SSL PROPERTIES - IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}" - ) - endif() - - if (NOT TARGET OpenSSL::Crypto) - add_library(OpenSSL::Crypto UNKNOWN IMPORTED) - set_target_properties(OpenSSL::Crypto PROPERTIES - IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}" - ) - endif() -endif() diff --git a/cmake/Modules/FindSpdlog_EP.cmake b/cmake/Modules/FindSpdlog_EP.cmake deleted file mode 100644 index a3d3eb83edc..00000000000 --- a/cmake/Modules/FindSpdlog_EP.cmake +++ /dev/null @@ -1,126 +0,0 @@ -# -# FindSpdlog_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Spdlog library, installing with an ExternalProject as necessary. -# This module defines: -# - SPDLOG_INCLUDE_DIR, directory containing headers -# - SPDLOG_FOUND, whether Spdlog has been found -# - The spdlog::spdlog imported target - -# Include some common helper functions. -include(TileDBCommon) - -if (TILEDB_VCPKG) - find_package(spdlog CONFIG REQUIRED) -endif() - - -# If the EP was built, it will install the storage_client-config.cmake file, -# which we can use with find_package. CMake uses CMAKE_PREFIX_PATH to locate find -# modules. -set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${TILEDB_EP_INSTALL_PREFIX}") - - -# First try the CMake find module. -if (NOT TILEDB_FORCE_ALL_DEPS OR TILEDB_SPDLOG_EP_BUILT) - if (TILEDB_SPDLOG_EP_BUILT) - # If we built it from the source always force no default path - SET(TILEDB_SPDLOG_NO_DEFAULT_PATH NO_DEFAULT_PATH) - else() - SET(TILEDB_SPDLOG_NO_DEFAULT_PATH ${TILEDB_DEPS_NO_DEFAULT_PATH}) - endif() - - find_package(spdlog - PATHS ${TILEDB_EP_INSTALL_PREFIX} - ${TILEDB_SPDLOG_NO_DEFAULT_PATH} - ) - set(SPDLOG_FOUND ${spdlog_FOUND}) -endif() - -if (NOT SPDLOG_FOUND) - if(TILEDB_SUPERBUILD) - if (WIN32) - find_package(Git REQUIRED) - set(CONDITIONAL_PATCH cd ${CMAKE_SOURCE_DIR} && ${GIT_EXECUTABLE} apply --ignore-whitespace -p1 --unsafe-paths --verbose --directory=${TILEDB_EP_SOURCE_DIR}/ep_spdlog < ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_spdlog/spdlog.patch) - else() - set(CONDITIONAL_PATCH patch -N -p1 < ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_spdlog/spdlog.patch) - endif() - - message(STATUS "Adding spdlog as an external project") - ExternalProject_Add(ep_spdlog - PREFIX "externals" - # Set download name to avoid collisions with only the version number in the filename - DOWNLOAD_NAME ep_spdlog.zip - URL "https://github.com/gabime/spdlog/archive/v1.11.0.zip" - URL_HASH SHA1=4075d3da589d2000cffbd53ea8d31715a64ff8c6 - PATCH_COMMAND - ${CONDITIONAL_PATCH} - CMAKE_ARGS - -DCMAKE_PREFIX_PATH=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_BUILD_TYPE=$ - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DSPDLOG_BUILD_SHARED=OFF - -DSPDLOG_BUILD_EXAMPLE=OFF - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_spdlog) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_SPDLOG_EP_BUILT=TRUE - ) - else() - message(FATAL_ERROR "Unable to find spdlog") - endif() -endif() - -if (spdlog_FOUND AND NOT TARGET spdlog::spdlog) - add_library(spdlog::spdlog INTERFACE IMPORTED) - find_package(fmt QUIET) - if (${fmt_FOUND}) - target_link_libraries(spdlog::spdlog INTERFACE fmt::fmt) - endif() - set_target_properties(spdlog::spdlog PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SPDLOG_INCLUDE_DIR}" - ) - # If the target is defined we need to handle external fmt build types -elseif(TARGET spdlog::spdlog) - if (SPDLOG_FMT_EXTERNAL) - # Since we are using header only we need to define this - add_definitions("-DSPDLOG_FMT_EXTERNAL=1") - find_package(fmt REQUIRED) - if (${fmt_FOUND}) - target_link_libraries(spdlog::spdlog INTERFACE fmt::fmt) - endif() - endif() -endif() diff --git a/cmake/Modules/FindWebp_EP.cmake b/cmake/Modules/FindWebp_EP.cmake deleted file mode 100644 index 64766f5b6f4..00000000000 --- a/cmake/Modules/FindWebp_EP.cmake +++ /dev/null @@ -1,84 +0,0 @@ -# FindWebp_EP.cmake -# -# The MIT License -# -# Copyright (c) 2022 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Fetches and builds libwebp for use by tiledb. - -# Include some common helper functions. -include(TileDBCommon) - -if (TILEDB_VCPKG) - find_package(WebP REQUIRED) - return() -endif() - -if(TILEDB_WEBP_EP_BUILT) - find_package(WebP REQUIRED PATHS ${TILEDB_EP_INSTALL_PREFIX} NO_DEFAULT_PATH) -endif() - -# if not yet built add it as an external project -if(NOT TILEDB_WEBP_EP_BUILT) - if (TILEDB_SUPERBUILD) - message(STATUS "Adding Webp as an external project") - - # that was modified by tiledb to also build with cmake for nix - ExternalProject_Add(ep_webp - PREFIX "externals" - GIT_REPOSITORY "https://chromium.googlesource.com/webm/libwebp" - GIT_TAG "v1.3.2" - GIT_SUBMODULES_RECURSE TRUE - UPDATE_COMMAND "" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=$ - "-DCMAKE_C_FLAGS=${CFLAGS_DEF}" - -DWEBP_LINK_STATIC=ON - -DWEBP_BUILD_ANIM_UTILS=OFF - -DWEBP_BUILD_CWEBP=OFF - -DWEBP_BUILD_DWEBP=OFF - -DWEBP_BUILD_GIF2WEBP=OFF - -DWEBP_BUILD_IMG2WEBP=OFF - -DWEBP_BUILD_VWEBP=OFF - -DWEBP_BUILD_WEBPINFO=OFF - -DWEBP_BUILD_WEBPMUX=OFF - -DWEBP_BUILD_EXTRAS=OFF - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_webp) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_WEBP_EP_BUILT=TRUE - ) - - set(TILEDB_WEBP_DIR "${TILEDB_EP_INSTALL_PREFIX}") - - else() - message(FATAL_ERROR "Unable to find Webp") - endif() -endif() diff --git a/cmake/Modules/FindZlib_EP.cmake b/cmake/Modules/FindZlib_EP.cmake deleted file mode 100644 index 78a23264840..00000000000 --- a/cmake/Modules/FindZlib_EP.cmake +++ /dev/null @@ -1,128 +0,0 @@ -# -# FindZlib_EP.cmake -# -# The MIT License -# -# Copyright (c) 2018-2021 TileDB, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Zlib library, installing with an ExternalProject as necessary. -# This module defines: -# - ZLIB_INCLUDE_DIR, directory containing headers -# - ZLIB_LIBRARIES, the Zlib library path -# - ZLIB_FOUND, whether Zlib has been found -# - The ZLIB::ZLIB imported target - -# Include some common helper functions. -include(TileDBCommon) - -if (TILEDB_VCPKG) - find_package(ZLIB REQUIRED) - return() -endif() - - -# Search the path set during the superbuild for the EP. -set(ZLIB_PATHS ${TILEDB_EP_INSTALL_PREFIX}) - -# Try the builtin find module unless built w/ EP superbuild -# Built-in module only supports shared zlib, so using it -# w/in superbuild we end up linking zlib.dll. -# https://gitlab.kitware.com/cmake/cmake/issues/18029) -if (((NOT TILEDB_FORCE_ALL_DEPS) AND (NOT TILEDB_ZLIB_EP_BUILT)) OR DEFINED VCPKG_CMAKE_SYSTEM_NAME) - find_package(ZLIB ${TILEDB_DEPS_NO_DEFAULT_PATH}) -endif() - -# Next try finding the superbuild external project -if (NOT ZLIB_FOUND) - find_path(ZLIB_INCLUDE_DIR - NAMES zlib.h - PATHS ${ZLIB_PATHS} - PATH_SUFFIXES include - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - - # Link statically if installed with the EP. - find_library(ZLIB_LIBRARIES - NAMES - libz${CMAKE_STATIC_LIBRARY_SUFFIX} - zlibstatic${CMAKE_STATIC_LIBRARY_SUFFIX} - zlibstaticd${CMAKE_STATIC_LIBRARY_SUFFIX} - PATHS ${ZLIB_PATHS} - PATH_SUFFIXES lib - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Zlib - REQUIRED_VARS ZLIB_LIBRARIES ZLIB_INCLUDE_DIR - ) -endif() - -# If not found, add it as an external project -if (NOT ZLIB_FOUND) - if (TILEDB_SUPERBUILD) - message(STATUS "Adding Zlib as an external project") - - if (WIN32) - set(CFLAGS_DEF "") - else() - set(CFLAGS_DEF "${CMAKE_C_FLAGS} -fPIC") - endif() - - ExternalProject_Add(ep_zlib - PREFIX "externals" - URL - "https://github.com/TileDB-Inc/tiledb-deps-mirror/releases/download/2.10-deps/zlib1211.zip" - "https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib1211.zip" - URL_HASH SHA1=bccd93ad3cee39c3d08eee68d45b3e11910299f2 - DOWNLOAD_NAME "zlib1211.zip" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=Release - "-DCMAKE_C_FLAGS=${CFLAGS_DEF}" - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_zlib) - list(APPEND FORWARD_EP_CMAKE_ARGS - -DTILEDB_ZLIB_EP_BUILT=TRUE - ) - - set(TILEDB_ZLIB_DIR "${TILEDB_EP_INSTALL_PREFIX}") - - else() - message(FATAL_ERROR "Unable to find Zlib") - endif() -endif() - -if (ZLIB_FOUND AND NOT TARGET ZLIB::ZLIB ) - message(STATUS "Found Zlib, adding imported target: ${ZLIB_LIBRARIES}") - add_library(ZLIB::ZLIB UNKNOWN IMPORTED) - set_target_properties(ZLIB::ZLIB PROPERTIES - IMPORTED_LOCATION "${ZLIB_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIR}" - ) -endif() diff --git a/cmake/inputs/patches/ep_bzip2/CMakeLists.txt b/cmake/Modules/FindZstd.cmake similarity index 56% rename from cmake/inputs/patches/ep_bzip2/CMakeLists.txt rename to cmake/Modules/FindZstd.cmake index 1b2ac844cbb..a994263027a 100644 --- a/cmake/inputs/patches/ep_bzip2/CMakeLists.txt +++ b/cmake/Modules/FindZstd.cmake @@ -1,10 +1,9 @@ # -# CMakeLists.txt -# +# FindZstd.cmake # # The MIT License # -# Copyright (c) 2017 TileDB, Inc. +# Copyright (c) 2024 TileDB, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,32 +23,14 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # +# Finds the Zstd library. +# This module defines: +# - The ${ZSTD_TARGET} imported target -project(bzip2) -cmake_minimum_required(VERSION 3.21) - -set(SOURCES "blocksort.c" "huffman.c" "crctable.c" "randtable.c" -"compress.c" "decompress.c" "bzlib.c") -file(GLOB HEADERS "bzlib.h") - -# Set build flags -if (WIN32) - set(CMAKE_C_FLAGS "/DWIN32 /D_FILE_OFFSET_BITS=64 /MD /Ox /nologo") +find_package(zstd CONFIG REQUIRED) +# Unified target introduced in zstd 1.5.6. +if (TARGET zstd::libzstd) + set(ZSTD_TARGET zstd::libzstd) else() - set(CMAKE_C_FLAGS "-D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -g") + set(ZSTD_TARGET $,zstd::libzstd_shared,zstd::libzstd_static>) endif() - -# Create libraries -add_library(bzip2_static STATIC ${SOURCES}) -set_target_properties(bzip2_static PROPERTIES OUTPUT_NAME "libbz2static") -add_library(bzip2_shared SHARED ${SOURCES} libbz2.def) -set_target_properties(bzip2_shared PROPERTIES OUTPUT_NAME "libbz2") - -# Install libraries -install( - TARGETS bzip2_static bzip2_shared - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) -install(FILES ${HEADERS} DESTINATION include) diff --git a/cmake/Modules/FindZstd_EP.cmake b/cmake/Modules/FindZstd_EP.cmake deleted file mode 100644 index bd43cab030f..00000000000 --- a/cmake/Modules/FindZstd_EP.cmake +++ /dev/null @@ -1,138 +0,0 @@ -# -# FindZstd_EP.cmake -# -# -# The MIT License -# -# Copyright (c) 2017-2021 TileDB, Inc. -# Copyright (c) 2016 MIT and Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# Finds the Zstd library, installing with an ExternalProject as necessary. -# This module defines: -# - ZSTD_INCLUDE_DIR, directory containing headers -# - ZSTD_LIBRARIES, the Zstd library path -# - ZSTD_FOUND, whether Zstd has been found -# - The ${ZSTD_TARGET} imported target - -# Include some common helper functions. -include(TileDBCommon) - -if (TILEDB_VCPKG) - find_package(zstd CONFIG REQUIRED) - if (TARGET zstd::libzstd_static) - set(ZSTD_TARGET zstd::libzstd_static) - else() - set(ZSTD_TARGET zstd::libzstd_shared) - endif() - return() -endif() - -# First check for a static version in the EP prefix. -find_library(ZSTD_LIBRARIES - NAMES - libzstd${CMAKE_STATIC_LIBRARY_SUFFIX} - zstd_static${CMAKE_STATIC_LIBRARY_SUFFIX} - PATHS ${TILEDB_EP_INSTALL_PREFIX} - PATH_SUFFIXES lib - NO_DEFAULT_PATH -) - -if (ZSTD_LIBRARIES) - set(ZSTD_STATIC_EP_FOUND TRUE) - find_path(ZSTD_INCLUDE_DIR - NAMES zstd.h - PATHS ${TILEDB_EP_INSTALL_PREFIX} - PATH_SUFFIXES include - NO_DEFAULT_PATH - ) -elseif(NOT TILEDB_FORCE_ALL_DEPS) - set(ZSTD_STATIC_EP_FOUND FALSE) - # Static EP not found, search in system paths. - find_library(ZSTD_LIBRARIES - NAMES - zstd libzstd - PATH_SUFFIXES lib bin - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) - find_path(ZSTD_INCLUDE_DIR - NAMES zstd.h - PATH_SUFFIXES include - ${TILEDB_DEPS_NO_DEFAULT_PATH} - ) -endif() - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Zstd - REQUIRED_VARS ZSTD_LIBRARIES ZSTD_INCLUDE_DIR -) - -if (NOT ZSTD_FOUND) - if (TILEDB_SUPERBUILD) - message(STATUS "Adding Zstd as an external project") - - if (WIN32) - set(ARCH_SPEC -A X64) - set(CFLAGS_DEF "") - else() - set(CFLAGS_DEF "${CMAKE_C_FLAGS} -fPIC") - endif() - - ExternalProject_Add(ep_zstd - PREFIX "externals" - # Set download name to avoid collisions with only the version number in the filename - DOWNLOAD_NAME ep_zstd.zip - URL "https://github.com/facebook/zstd/archive/v1.4.8.zip" - URL_HASH SHA1=8323c212a779ada25f5d587349326e84b047b536 - CONFIGURE_COMMAND - ${CMAKE_COMMAND} - ${ARCH_SPEC} - "-DCMAKE_C_FLAGS=${CFLAGS_DEF}" - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX} - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - # Disable building ZSTD shared library as this is not used by superbuild - # When using superbuild for zstd + curl the shared library was being selected - # on some envs due to ordering of search paths. - # This caused linker errors for projects using libtiledb because of missing shared zstd library. - -DZSTD_BUILD_SHARED=OFF - ${TILEDB_EP_BASE}/src/ep_zstd/build/cmake - UPDATE_COMMAND "" - LOG_DOWNLOAD TRUE - LOG_CONFIGURE TRUE - LOG_BUILD TRUE - LOG_INSTALL TRUE - LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE} - ) - list(APPEND TILEDB_EXTERNAL_PROJECTS ep_zstd) - set(TILEDB_ZSTD_DIR "${TILEDB_EP_INSTALL_PREFIX}") - else() - message(FATAL_ERROR "Unable to find Zstd") - endif() -endif() - -if (ZSTD_FOUND AND NOT ZSTD_TARGET) - add_library(zstd::libzstd UNKNOWN IMPORTED) - set_target_properties(zstd::libzstd PROPERTIES - IMPORTED_LOCATION "${ZSTD_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}" - ) - set(ZSTD_TARGET zstd::libzstd) -endif() diff --git a/cmake/Options/BuildOptions.cmake b/cmake/Options/BuildOptions.cmake index d428dde1e10..cf8880d72d7 100644 --- a/cmake/Options/BuildOptions.cmake +++ b/cmake/Options/BuildOptions.cmake @@ -7,9 +7,6 @@ include(CMakeDependentOption) -option(TILEDB_SUPERBUILD "If true, perform a superbuild (builds all missing dependencies)." ON) -option(TILEDB_VCPKG "If true, use vcpkg to download and build dependencies." ON) -cmake_dependent_option(TILEDB_FORCE_ALL_DEPS "If true, force superbuild to download and build all dependencies, even those installed on the system." OFF "NOT TILEDB_VCPKG" OFF) option(TILEDB_SANITIZER "Sets the sanitizers to use. Only address is currently supported." "") option(TILEDB_VCPKG_BASE_TRIPLET "Sets the base vcpkg triplet when building with sanitizers." "") option(TILEDB_REMOVE_DEPRECATIONS "If true, do not build deprecated APIs." OFF) @@ -21,7 +18,6 @@ option(TILEDB_HDFS "Enables HDFS support using the official Hadoop JNI bindings" option(TILEDB_WERROR "Enables the -Werror flag during compilation." ON) option(TILEDB_ASSERTIONS "Build with assertions enabled (default off for release, on for debug build)." OFF) option(TILEDB_CPP_API "Enables building of the TileDB C++ API." ON) -option(TILEDB_CMAKE_IDE "(Used for CLion builds). Disables superbuild and sets the EP install dir." OFF) option(TILEDB_STATS "Enables internal TileDB statistics gathering." ON) option(BUILD_SHARED_LIBS "Enables building TileDB as a shared library." ON) option(TILEDB_TESTS "If true, enables building the TileDB unit test suite" ON) @@ -30,8 +26,6 @@ option(TILEDB_SERIALIZATION "If true, enables building with support for query se option(TILEDB_CCACHE "If true, enables use of 'ccache' (if present)" OFF) option(TILEDB_ARROW_TESTS "If true, enables building the arrow adapter unit tests" OFF) option(TILEDB_WEBP "If true, enables building webp and a simple linkage test" ON) -option(TILEDB_LOG_OUTPUT_ON_FAILURE "If true, print error logs if dependency sub-project build fails" ON) -option(TILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK "If true, skip check needed path length for awssdk (TILEDB_S3) dependent builds" OFF) option(TILEDB_EXPERIMENTAL_FEATURES "If true, build and include experimental features" OFF) option(TILEDB_TESTS_AWS_S3_CONFIG "Use an S3 config appropriate for AWS in tests" OFF) option(TILEDB_DISABLE_AUTO_VCPKG "Do not automatically download vcpkg. Ignored if CMAKE_TOOLCHAIN_FILE or ENV{VCPKG_ROOT} is set." OFF) @@ -49,7 +43,7 @@ if (DEFINED TILEDB_STATIC) endif() endif() -if (NOT TILEDB_VCPKG) +if (DEFINED TILEDB_VCPKG AND NOT TILEDB_VCPKG) message(FATAL_ERROR "Disabling TILEDB_VCPKG is not supported. To disable automatically downloading vcpkg, enable the TILEDB_DISABLE_AUTO_VCPKG option, or set ENV{TILEDB_DISABLE_AUTO_VCPKG} to any value.") endif() diff --git a/cmake/Options/TileDBToolchain.cmake b/cmake/Options/TileDBToolchain.cmake index 2a566b58f58..f9cd9d186fb 100644 --- a/cmake/Options/TileDBToolchain.cmake +++ b/cmake/Options/TileDBToolchain.cmake @@ -27,15 +27,6 @@ # TileDB Toolchain Setup ############################################################ -if (NOT TILEDB_VCPKG) - return() -endif() - -# We've already run vcpkg by the time the super build is finished -if (NOT TILEDB_SUPERBUILD) - return() -endif() - if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) if(DEFINED ENV{VCPKG_ROOT}) set(CMAKE_TOOLCHAIN_FILE diff --git a/cmake/TileDB-Superbuild.cmake b/cmake/TileDB-Superbuild.cmake deleted file mode 100644 index 9f0d894536d..00000000000 --- a/cmake/TileDB-Superbuild.cmake +++ /dev/null @@ -1,189 +0,0 @@ -include (ExternalProject) - -############################################################ -# Common variables -############################################################ - -# Build paths for external projects -set(TILEDB_EP_BASE "${CMAKE_CURRENT_BINARY_DIR}/externals") -set(TILEDB_EP_SOURCE_DIR "${TILEDB_EP_BASE}/src") -set(TILEDB_EP_INSTALL_PREFIX "${TILEDB_EP_BASE}/install") - -# A variable that will hold the paths to all the dependencies that are built -# during the superbuild. These paths are passed to the regular non-superbuild -# build process as CMake arguments. -set(FORWARD_EP_CMAKE_ARGS) - -# Variable that will hold a list of all the external projects added -# as a part of the superbuild. -set(TILEDB_EXTERNAL_PROJECTS) - -# Passing lists through ExternalProject_Add requires using a separator -# character other than a semicolon. -list(JOIN CMAKE_PREFIX_PATH "|" CMAKE_PREFIX_PATH_STR) - -# Forward any additional CMake args to the non-superbuild. -set(INHERITED_CMAKE_ARGS - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH_STR} - -DCMAKE_BUILD_TYPE=$ - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} - -DCOMPILER_SUPPORTS_AVX2=${COMPILER_SUPPORTS_AVX2} - -DTILEDB_EXTRA_CMAKE_INCLUDE=${TILEDB_EXTRA_CMAKE_INCLUDE} - -DTILEDB_VCPKG=${TILEDB_VCPKG} - -DTILEDB_VERBOSE=${TILEDB_VERBOSE} - -DTILEDB_ASSERTIONS=${TILEDB_ASSERTIONS} - -DTILEDB_S3=${TILEDB_S3} - -DTILEDB_AZURE=${TILEDB_AZURE} - -DTILEDB_GCS=${TILEDB_GCS} - -DTILEDB_HDFS=${TILEDB_HDFS} - -DTILEDB_WERROR=${TILEDB_WERROR} - -DTILEDB_CPP_API=${TILEDB_CPP_API} - -DTILEDB_FORCE_ALL_DEPS=${TILEDB_FORCE_ALL_DEPS} - -DTILEDB_REMOVE_DEPRECATIONS=${TILEDB_REMOVE_DEPRECATIONS} - -DTILEDB_SANITIZER=${TILEDB_SANITIZER} - -DTILEDB_EP_BASE=${TILEDB_EP_BASE} - -DTILEDB_STATS=${TILEDB_STATS} - -DTILEDB_TESTS=${TILEDB_TESTS} - -DTILEDB_TOOLS=${TILEDB_TOOLS} - -DTILEDB_SERIALIZATION=${TILEDB_SERIALIZATION} - -DTILEDB_ARROW_TESTS=${TILEDB_ARROW_TESTS} - -DTILEDB_WEBP=${TILEDB_WEBP} - -DTILEDB_INSTALL_LIBDIR=${TILEDB_INSTALL_LIBDIR} - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - -DTILEDB_EXPERIMENTAL_FEATURES=${TILEDB_EXPERIMENTAL_FEATURES} - -DTILEDB_TESTS_AWS_S3_CONFIG=${TILEDB_TESTS_AWS_S3_CONFIG} -) - -if (libxml2_DIR) - list(APPEND INHERITED_CMAKE_ARGS - -Dlibxml2_DIR=${libxml2_DIR} - ) -endif() - -if (TILEDB_TESTS) - list(APPEND INHERITED_CMAKE_ARGS - -DTILEDB_TESTS_AWS_S3_CONFIG=${TILEDB_TESTS_AWS_S3_CONFIG} - ) -endif() - -# MSVC_MP_FLAG is defined by bootstrap.ps1 -if (DEFINED MSVC_MP_FLAG) - list(APPEND INHERITED_CMAKE_ARGS - -DMSVC_MP_FLAG=${MSVC_MP_FLAG} - ) -endif() - -if (TILEDB_CCACHE) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindCcache.cmake) - list(APPEND INHERITED_CMAKE_ARGS - -DCMAKE_CXX_COMPILER_LAUNCHER=${CCACHE_FOUND} - ) -endif() - -############################################################ -# Set up external projects for dependencies -############################################################ - -if (TILEDB_FORCE_ALL_DEPS) - message(STATUS "Forcing superbuild to build all dependencies as ExternalProjects.") -endif() - -# These includes modify the TILEDB_EXTERNAL_PROJECTS and FORWARD_EP_CMAKE_ARGS -# variables. - -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindBzip2_EP.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindLZ4_EP.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindSpdlog_EP.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindZlib_EP.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindZstd_EP.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindMagic_EP.cmake) - -if(TILEDB_WEBP) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindWebp_EP.cmake) -endif() - -if (TILEDB_SERIALIZATION) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindCapnp_EP.cmake) -endif() - -if (NOT WIN32) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindOpenSSL_EP.cmake) -endif() - -if ((TILEDB_S3 AND NOT WIN32 AND NOT TILEDB_VCPKG) OR TILEDB_AZURE OR TILEDB_GCS OR TILEDB_SERIALIZATION) - # Need libcurl either with GCS or serialization support. - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindCurl_EP.cmake) -endif() - -if (TILEDB_S3 AND NOT TILEDB_VCPKG) - # Note on Win32: AWS SDK uses builtin WinHTTP instead of libcurl, - # and builtin BCrypt instead of OpenSSL. - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindAWSSDK_EP.cmake) -endif() - -if (TILEDB_TESTS) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindCatch_EP.cmake) -endif() - -if (TILEDB_TOOLS) - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindClipp_EP.cmake) -endif() - -############################################################ -# Set up the regular build (i.e. non-superbuild). -############################################################ - -ExternalProject_Add(tiledb - SOURCE_DIR ${PROJECT_SOURCE_DIR} - CMAKE_ARGS - -DTILEDB_SUPERBUILD=OFF - ${INHERITED_CMAKE_ARGS} - ${FORWARD_EP_CMAKE_ARGS} - INSTALL_COMMAND "" - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/tiledb - DEPENDS ${TILEDB_EXTERNAL_PROJECTS} - LIST_SEPARATOR "|" -) - -############################################################ -# Convenience superbuild targets that invoke TileDB targets -############################################################ - -# make install-tiledb -add_custom_target(install-tiledb - COMMAND ${CMAKE_COMMAND} --build . --target install --config $ - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tiledb -) - -# make examples -add_custom_target(examples - COMMAND ${CMAKE_COMMAND} --build . --target examples --config $ - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tiledb -) - -# make experimental/examples/ -add_custom_target(experimental-examples - COMMAND ${CMAKE_COMMAND} --build . --target experimental_examples --config $ - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tiledb -) - -# make check -if (TILEDB_TESTS) - add_custom_target(check - COMMAND ${CMAKE_COMMAND} --build . --target check --config $ - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tiledb - ) -endif() - -# make package (.tar.gz for Linux and MacOS, .zip for Windows) -add_custom_target(package - DEPENDS tiledb - COMMAND ${CMAKE_CPACK_COMMAND} --config CPackConfig.cmake -G "$,ZIP,TGZ>" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tiledb -) diff --git a/cmake/inputs/configure-curl.sh.in b/cmake/inputs/configure-curl.sh.in deleted file mode 100755 index 96780a9358b..00000000000 --- a/cmake/inputs/configure-curl.sh.in +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# Script that will run curl's configure script after setting the -# LIBS environment variable. This is used by CMake at build time, -# which will expand all of the @VAR@ variables. - -export LIBS="@TILEDB_CURL_LIBS@" -$@ diff --git a/cmake/inputs/patches/README.md b/cmake/inputs/patches/README.md deleted file mode 100644 index 9f7e07689b9..00000000000 --- a/cmake/inputs/patches/README.md +++ /dev/null @@ -1,28 +0,0 @@ -TileDB patches --------------- - -TileDB dependencies must be built against source packages of released software versions. - -To simplify patchset maintenance, we may also fork a specific repository version in -the TileDB-Inc organization. - -Several illustrative examples, using the AWS SDK dependency: -- applying a patchset to a repo fork: - - ``` - git clone https://github.com/aws/aws-sdk-cpp.git - cd aws-sdk-cpp - git am /path/to/TileDB/cmake/inputs/patches/ep_awssdk/awsccommon.patch - ``` - -- re-creating the patchset from updated fork: - - ``` - cd aws-sdk-cpp - # commit or cherry-pick changes - git format-patch v0.3.0 --stdout > /path/to/TileDB/cmake/inputs/patches/ep_awssdk/awsccommon.patch - # git add, commit, push to TileDB-Inc fork - ``` - - Note that the target branch above is for illustration only. The target version should match the version - of the dependency used in the `cmake/Modules/Find.cmake` file. diff --git a/cmake/inputs/patches/ep_capnp/disable-C-20-co-routines.patch b/cmake/inputs/patches/ep_capnp/disable-C-20-co-routines.patch deleted file mode 100644 index ab292af0799..00000000000 --- a/cmake/inputs/patches/ep_capnp/disable-C-20-co-routines.patch +++ /dev/null @@ -1,25 +0,0 @@ -From da5b439b558e354a8fc59d09dff6a9eb657f54fd Mon Sep 17 00:00:00 2001 -From: Stig Hornang -Date: Mon, 28 Aug 2023 22:28:43 +0200 -Subject: [PATCH] Disable C++20 co-routines - ---- - c++/src/kj/async-prelude.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/c++/src/kj/async-prelude.h b/c++/src/kj/async-prelude.h -index 6289bf3f..c9845cdc 100644 ---- a/c++/src/kj/async-prelude.h -+++ b/c++/src/kj/async-prelude.h -@@ -36,7 +36,7 @@ - #if (__cpp_impl_coroutine >= 201902L) && __has_include() - // C++20 Coroutines detected. - #include --#define KJ_HAS_COROUTINE 1 -+// #define KJ_HAS_COROUTINE 1 - #define KJ_COROUTINE_STD_NAMESPACE std - #elif (__cpp_coroutines >= 201703L) && __has_include() - // Coroutines TS detected. --- -2.41.0.windows.3 - diff --git a/cmake/inputs/patches/ep_capnp/undef-KJ_USE_EPOLL-for-ANDROID_PLATFORM-23.patch b/cmake/inputs/patches/ep_capnp/undef-KJ_USE_EPOLL-for-ANDROID_PLATFORM-23.patch deleted file mode 100644 index 6fdc15a1701..00000000000 --- a/cmake/inputs/patches/ep_capnp/undef-KJ_USE_EPOLL-for-ANDROID_PLATFORM-23.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 306220e57881064da99f89ad4192b3e19c7953a9 Mon Sep 17 00:00:00 2001 -From: Stig Hornang -Date: Thu, 31 Aug 2023 21:20:09 +0200 -Subject: [PATCH] Undef KJ_USE_EPOLL for ANDROID_PLATFORM < 23 - ---- - c++/src/kj/async-unix.h | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/c++/src/kj/async-unix.h b/c++/src/kj/async-unix.h -index 665305ea..c5f195cf 100644 ---- a/c++/src/kj/async-unix.h -+++ b/c++/src/kj/async-unix.h -@@ -34,7 +34,10 @@ - KJ_BEGIN_HEADER - - #if !defined(KJ_USE_EPOLL) && !defined(KJ_USE_KQUEUE) --#if __linux__ -+ -+// Android NDK less than API version 23 doesn't have sigtimedwait -+// sigtimedwait is used in async-unix.c++ if KJ_USE_EPOLL is defined -+#if __linux__ && !(__ANDROID__ && __ANDROID_API__ < 23) - // Default to epoll on Linux. - #define KJ_USE_EPOLL 1 - #elif __APPLE__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __DragonFly__ --- -2.41.0.windows.3 - diff --git a/cmake/inputs/patches/ep_spdlog/spdlog.patch b/cmake/inputs/patches/ep_spdlog/spdlog.patch deleted file mode 100644 index b8c4d752157..00000000000 --- a/cmake/inputs/patches/ep_spdlog/spdlog.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/spdlog/logger-inl.h b/include/spdlog/logger-inl.h -index d01c08da..5cd01176 100644 ---- a/include/spdlog/logger-inl.h -+++ b/include/spdlog/logger-inl.h -@@ -250,7 +250,7 @@ SPDLOG_INLINE void logger::err_handler_(const std::string &msg) - #if defined(USING_R) && defined(R_R_H) // if in R environment - REprintf("[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str()); - #else -- std::fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str()); -+ std::fprintf(stderr, "[*** LOG ERROR #%04lu ***] [%s] [%s] {%s}\n", (unsigned long)err_counter, date_buf, name().c_str(), msg.c_str()); - #endif - } - } diff --git a/cmake/unit_test.cmake b/cmake/unit_test.cmake index a79a92629e4..0dd19c7e5f0 100644 --- a/cmake/unit_test.cmake +++ b/cmake/unit_test.cmake @@ -166,7 +166,7 @@ macro(TileDB_Environment_unit_test_end) # Sources, library dependencies, compile definitions target_sources(${TileDB_Environment_unit_test_end_Unit_Test} PRIVATE ${TileDB_Environment_unit_test_end_Sources}) # Catch2 is always a dependency of our unit tests - find_package(Catch_EP REQUIRED) + find_package(Catch2 REQUIRED) target_link_libraries(${TileDB_Environment_unit_test_end_Unit_Test} PUBLIC Catch2::Catch2WithMain) foreach(Object_Library IN LISTS TileDB_Environment_unit_test_end_OL_Dependencies) target_link_libraries(${TileDB_Environment_unit_test_end_Unit_Test} PUBLIC ${Object_Library}) diff --git a/doc/dev/BUILD.md b/doc/dev/BUILD.md index 8d1380fbcb0..245bd0a3ee0 100644 --- a/doc/dev/BUILD.md +++ b/doc/dev/BUILD.md @@ -100,22 +100,21 @@ The supported vcpkg base triplet values are: Once the build tree has been configured, you can build and install TileDB by running the following commands from the build tree: ```bash -cmake --build . -j -cmake --build . --target install-tiledb +cmake --build . -j --target install +cmake --build . ``` If you are building with a multi-config generator (e.g., Visual Studio), you will have to specify the configuration to build with the `--config` option. Also you can directly invoke the underlying build tool: ```bash -make -j4 -make install-tiledb +make -j4 install ``` The following are the most important targets: |Target|Description| |------|-----------| -|`install-tiledb`|Installs the TileDB library and headers.| +|`install`|Installs the TileDB library and headers.| |`check`|Builds and runs all TileDB tests.| |`examples`|Builds all TileDB examples.| @@ -149,7 +148,7 @@ TileDB can be built with [clang sanitizers](https://clang.llvm.org/docs/AddressS ```bash cd TileDB && mkdir build-asan && cd build-asan ../bootstrap --enable-sanitizer=address --vcpkg-base-triplet=x64-linux -make && make check +make check ``` > [!IMPORTANT] diff --git a/examples/cpp_api/CMakeLists.txt b/examples/cpp_api/CMakeLists.txt index 1b1a6964296..f0eb3c4d372 100644 --- a/examples/cpp_api/CMakeLists.txt +++ b/examples/cpp_api/CMakeLists.txt @@ -67,7 +67,7 @@ foreach(EXAMPLE_SOURCE ${TILEDB_EXAMPLE_SOURCES_CPPAPI}) target_link_libraries(png_ingestion_webp_cpp PRIVATE "${PNG_LIBRARIES}") target_include_directories(png_ingestion_webp_cpp PRIVATE "${PNG_INCLUDE_DIRS}") target_compile_definitions(png_ingestion_webp_cpp PRIVATE "${PNG_DEFINITIONS}") - find_package(Webp_EP REQUIRED) + find_package(WebP REQUIRED) target_link_libraries(png_ingestion_webp_cpp PRIVATE WebP::webp) target_compile_definitions(png_ingestion_webp_cpp PRIVATE -DTILEDB_WEBP) endif() diff --git a/examples/png_ingestion/CMakeLists.txt b/examples/png_ingestion/CMakeLists.txt index 6bdf16546c2..2332de3178f 100644 --- a/examples/png_ingestion/CMakeLists.txt +++ b/examples/png_ingestion/CMakeLists.txt @@ -53,7 +53,7 @@ add_executable(tiledb_png "src/main.cc") target_link_libraries(tiledb_png TileDB::tiledb) # Find and link with libpng. -find_package(Zlib_EP REQUIRED) +find_package(ZLIB REQUIRED) find_package(PNG REQUIRED) target_link_libraries(tiledb_png "${PNG_LIBRARIES}") target_include_directories(tiledb_png PRIVATE "${PNG_INCLUDE_DIRS}") diff --git a/experimental/experimental_examples/CMakeLists.txt b/experimental/experimental_examples/CMakeLists.txt index 44a2348c2a1..55a753aeb1e 100644 --- a/experimental/experimental_examples/CMakeLists.txt +++ b/experimental/experimental_examples/CMakeLists.txt @@ -25,15 +25,12 @@ # THE SOFTWARE. # -if (WIN32) +if (MSVC) # Disable MSVC warnings not present with gcc. # C4204: non-constant aggregate initializer # C4221: aggregate initializer with local variable # C4305: implicit truncation of double to float add_compile_options(/wd4204 /wd4221 /wd4305) -else() - #TODO: Remove when KV API has been removed. - add_compile_options(-Wno-deprecated-declarations) endif() add_custom_target(experimental_examples) @@ -41,3 +38,7 @@ if (TILEDB_CPP_API) add_subdirectory(cpp_api) add_dependencies(experimental_examples experimental_examples_cpp) endif() + +# Add alias for compatibility. +add_custom_target(experimental-examples) +add_dependencies(experimental-examples experimental_examples) diff --git a/experimental/experimental_examples/cpp_api/CMakeLists.txt b/experimental/experimental_examples/cpp_api/CMakeLists.txt index 192c3189282..ae6dc507cc3 100644 --- a/experimental/experimental_examples/cpp_api/CMakeLists.txt +++ b/experimental/experimental_examples/cpp_api/CMakeLists.txt @@ -27,7 +27,7 @@ add_custom_target(experimental_examples_cpp) -find_package(Bzip2_EP REQUIRED) +find_package(BZip2 REQUIRED) # Function that builds an executable per example function(build_TileDB_experimental_example_cppapi TARGET) diff --git a/experimental/tiledb/common/dag/CMakeLists.txt b/experimental/tiledb/common/dag/CMakeLists.txt index 8e4ff601885..7d7a4c77906 100644 --- a/experimental/tiledb/common/dag/CMakeLists.txt +++ b/experimental/tiledb/common/dag/CMakeLists.txt @@ -91,7 +91,7 @@ if (TILEDB_TESTS) # # All unit tests depend on Catch # - find_package(Catch_EP REQUIRED) + find_package(Catch2 REQUIRED) endif() add_subdirectory(data_block) diff --git a/ports/libfaketime/CMakeLists.txt b/ports/libfaketime/CMakeLists.txt index a5d6f20858c..59882445136 100644 --- a/ports/libfaketime/CMakeLists.txt +++ b/ports/libfaketime/CMakeLists.txt @@ -11,6 +11,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux") target_link_libraries( ${PROJECT_NAME} rt + m ) endif() diff --git a/scripts/ci/bootstrap_libtiledb.sh b/scripts/ci/bootstrap_libtiledb.sh index 818df336a33..a3f3322e754 100644 --- a/scripts/ci/bootstrap_libtiledb.sh +++ b/scripts/ci/bootstrap_libtiledb.sh @@ -25,17 +25,6 @@ # set -xeuo pipefail -# Check for clean configure with tests disabled -# This will not validate linkage, but we can't -# build all variations separately right now. - -CONFIG_TMP_PATH=`mktemp -d` -pushd $CONFIG_TMP_PATH -$GITHUB_WORKSPACE/bootstrap $bootstrap_args --disable-tests -popd - -############################################### - # Build and test libtiledb # Set up arguments for bootstrap.sh diff --git a/scripts/ci/build_libtiledb.sh b/scripts/ci/build_libtiledb.sh index f94bf3e10f7..4da6d130582 100644 --- a/scripts/ci/build_libtiledb.sh +++ b/scripts/ci/build_libtiledb.sh @@ -31,13 +31,8 @@ set -xeuo pipefail cd $GITHUB_WORKSPACE/build -cmake --build . -j4 - -cmake --build tiledb --target install +cmake --build . -j4 --target install ls -la -cmake --build tiledb -j4 --target tiledb_unit -cmake --build tiledb -j4 --target unit_vfs -cmake --build tiledb -j4 --target tiledb_regression -cmake --build tiledb -j4 --target all_link_complete +cmake --build . -j4 --target tiledb_unit unit_vfs tiledb_regression all_link_complete diff --git a/scripts/run-nix-examples.sh b/scripts/run-nix-examples.sh index b99cabd1b83..61226b11bc4 100755 --- a/scripts/run-nix-examples.sh +++ b/scripts/run-nix-examples.sh @@ -3,8 +3,8 @@ SourceDir="$(dirname $0)/.." BaseDir="$(pwd)" -TestAppDir="$(pwd)/tiledb/examples/c_api" -TestAppDataDir="$(pwd)/tiledb/examples/c_api/test_app_data" +TestAppDir="$(pwd)/examples/c_api" +TestAppDataDir="$(pwd)/examples/c_api/test_app_data" for example in $(ls ${SourceDir}/examples/c_api/*.c) ; do cd ${TestAppDir} @@ -13,7 +13,7 @@ do cd ${TestAppDataDir} exampleexe=${example%.c}_c exampleexe=${exampleexe##*/} - cmake --build ${BaseDir}/tiledb --target ${exampleexe} + cmake --build ${BaseDir} --target ${exampleexe} echo $TestAppDir/$exampleexe $TestAppDir/$exampleexe; status=$? @@ -29,8 +29,8 @@ cd ${TestAppDir} rm -rf ${TestAppDataDir} cd ${BaseDir} -TestAppDir="$(pwd)/tiledb/examples/cpp_api" -TestAppDataDir="$(pwd)/tiledb/examples/cpp_api/test_app_data" +TestAppDir="$(pwd)/examples/cpp_api" +TestAppDataDir="$(pwd)/examples/cpp_api/test_app_data" for example in $(ls ${SourceDir}/examples/cpp_api/*.cc) ; do # Skip running WebP example with no input @@ -44,7 +44,7 @@ do cd ${TestAppDataDir} exampleexe=${example%.cc}_cpp exampleexe=${exampleexe##*/} - cmake --build ${BaseDir}/tiledb --target ${exampleexe} + cmake --build ${BaseDir} --target ${exampleexe} echo $TestAppDir/$exampleexe $TestAppDir/$exampleexe; status=$? diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c265c1af705..bf7c60f6b22 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,7 +26,7 @@ # THE SOFTWARE. # -find_package(Catch_EP REQUIRED) +find_package(Catch2 REQUIRED) # Arrow integration test config and dependencies # Override from environment if not set in cache @@ -339,7 +339,7 @@ endif() if (TILEDB_WEBP) target_compile_definitions(tiledb_unit PRIVATE -DTILEDB_WEBP) - find_package(Zlib_EP) # We need PNG to use our Zlib so that static link works correctly if applicable + find_package(ZLIB) # We need PNG to use our Zlib so that static link works correctly if applicable find_package(PNG) if (PNG_FOUND) target_compile_definitions(tiledb_unit PRIVATE -DPNG_FOUND) @@ -377,7 +377,7 @@ if (LIBFAKETIME) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) - set_property(TEST tiledb_timing_unit PROPERTY ENVIRONMENT_MODIFICATION "FAKETIME=set:2020-12-24 20:30:00;LD_PRELOAD=set:${LIBFAKETIME}") + set_property(TEST tiledb_timing_unit PROPERTY ENVIRONMENT_MODIFICATION "FAKETIME=set:2020-12-24 20:30:00;LD_PRELOAD=path_list_append:${LIBFAKETIME}") endif() add_test( diff --git a/test/benchmarking/README.md b/test/benchmarking/README.md index ce4643dc542..522d3da1aad 100644 --- a/test/benchmarking/README.md +++ b/test/benchmarking/README.md @@ -8,7 +8,7 @@ This directory contains simple benchmarking programs intended for quick apples-a ```bash $ cd TileDB/build - $ ../bootstrap && make -j4 && make install-tiledb + $ ../bootstrap && make -j4 install $ cd ../dist ``` diff --git a/test/ci/CMakeLists.txt b/test/ci/CMakeLists.txt index b53c02f9e93..e90efedcc22 100644 --- a/test/ci/CMakeLists.txt +++ b/test/ci/CMakeLists.txt @@ -1,6 +1,6 @@ include(TileDBAssertions) -find_package(Catch_EP REQUIRED) +find_package(Catch2 REQUIRED) add_executable( test_assert diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index cb8ecd773ce..d0caf9f1011 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -26,7 +26,7 @@ # THE SOFTWARE. # -find_package(Catch_EP REQUIRED) +find_package(Catch2 REQUIRED) # These options not exposed in bootstrap script. option(TILEDB_TESTS_AWS_S3_CONFIG "Use an S3 config appropriate for AWS in tests" OFF) diff --git a/test/performance/msys_handle_leakage/trials.bat b/test/performance/msys_handle_leakage/trials.bat index cb53a94eb82..87e924b64e4 100644 --- a/test/performance/msys_handle_leakage/trials.bat +++ b/test/performance/msys_handle_leakage/trials.bat @@ -1,14 +1,14 @@ rem run from root of build tree... -if not exist .\tiledb\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe goto err -rem .\tiledb\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=0 --consolidate-sparse-iters=1 --wait-for-keypress both -.\tiledb\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=0 --consolidate-sparse-iters=1 -.\tiledb\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=1 --consolidate-sparse-iters=1 -.\tiledb\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=150 --perform-query=1 --consolidate-sparse-iters=1 -.\tiledb\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=300 --perform-query=1 --consolidate-sparse-iters=1 +if not exist .\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe goto err +rem .\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=0 --consolidate-sparse-iters=1 --wait-for-keypress both +.\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=0 --consolidate-sparse-iters=1 +.\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=1 --consolidate-sparse-iters=1 +.\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=150 --perform-query=1 --consolidate-sparse-iters=1 +.\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=300 --perform-query=1 --consolidate-sparse-iters=1 goto done :err -echo "Failed to find %cd%\tiledb\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe +echo "Failed to find %cd%\test\performance\RelWithDebInfo\tiledb_explore_msys_handle_leakage.exe goto done :done diff --git a/test/performance/msys_handle_leakage/trials.sh b/test/performance/msys_handle_leakage/trials.sh index 6b48c27a5fc..43e66b05a64 100644 --- a/test/performance/msys_handle_leakage/trials.sh +++ b/test/performance/msys_handle_leakage/trials.sh @@ -1,11 +1,11 @@ # run from root of build tree -if [ ! -f ./tiledb/test/performance/tiledb_explore_msys_handle_leakage.exe ]; then - echo "failed to find `pwd`/tiledb/test/performance/tiledb_explore_msys_handle_leakage.exe" +if [ ! -f ./test/performance/tiledb_explore_msys_handle_leakage.exe ]; then + echo "failed to find `pwd`/test/performance/tiledb_explore_msys_handle_leakage.exe" return 1 fi set -x -# ./tiledb/test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=1 --consolidate-sparse-iters=1 --wait-for-keypress both -./tiledb/test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=0 --consolidate-sparse-iters=1 -./tiledb/test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=1 --consolidate-sparse-iters=1 -./tiledb/test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=150 --perform-query=1 --consolidate-sparse-iters=1 -./tiledb/test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=300 --perform-query=1 --consolidate-sparse-iters=1 +# ./test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=1 --consolidate-sparse-iters=1 --wait-for-keypress both +./test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=0 --consolidate-sparse-iters=1 +./test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=1 --perform-query=1 --consolidate-sparse-iters=1 +./test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=150 --perform-query=1 --consolidate-sparse-iters=1 +./test/performance/tiledb_explore_msys_handle_leakage.exe --read-sparse-iters=300 --perform-query=1 --consolidate-sparse-iters=1 diff --git a/test/regression/CMakeLists.txt b/test/regression/CMakeLists.txt index 99bf3f358af..e7ecf827fe9 100644 --- a/test/regression/CMakeLists.txt +++ b/test/regression/CMakeLists.txt @@ -28,7 +28,7 @@ set(TILEDB_CORE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") list(APPEND TILEDB_CORE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/tiledb/") -find_package(Catch_EP REQUIRED) +find_package(Catch2 REQUIRED) set(SOURCES targets/sc-12024.cc @@ -78,7 +78,6 @@ target_include_directories(tiledb_regression PRIVATE ${CMAKE_INSTALL_PREFIX}/include "${TILEDB_CORE_INCLUDE_DIR}" - ${TILEDB_EP_INSTALL_PREFIX}/include ) add_test( diff --git a/test/support/CMakeLists.txt b/test/support/CMakeLists.txt index 96a59b15131..8ffc4028043 100644 --- a/test/support/CMakeLists.txt +++ b/test/support/CMakeLists.txt @@ -25,7 +25,7 @@ # THE SOFTWARE. # -find_package(Catch_EP REQUIRED) +find_package(Catch2 REQUIRED) # Include TileDB core header directories set(TILEDB_CORE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}") diff --git a/tiledb/CMakeLists.txt b/tiledb/CMakeLists.txt index 064a76c6ab0..c879b63cfcc 100644 --- a/tiledb/CMakeLists.txt +++ b/tiledb/CMakeLists.txt @@ -438,11 +438,6 @@ target_link_libraries(TILEDB_CORE_OBJECTS target_link_libraries(TILEDB_CORE_OBJECTS INTERFACE configuration_definitions) -############################################################ -# provide actions/target for preparation of magic.mgc data for embedding/build - -find_package(Magic_EP REQUIRED) - add_dependencies(TILEDB_CORE_OBJECTS gen_mgc_unarch) target_include_directories(TILEDB_CORE_OBJECTS @@ -483,10 +478,6 @@ endif() if (TILEDB_SERIALIZATION) add_definitions(-DTILEDB_SERIALIZATION) message(STATUS "The TileDB library is compiled with query serialization enabled.") - - if(MSVC AND TILEDB_CURL_EP_BUILT) - target_compile_definitions(TILEDB_CORE_OBJECTS PRIVATE -DCURL_STATICLIB=1) - endif() endif() ############################################################ @@ -506,14 +497,15 @@ target_link_libraries(TILEDB_CORE_OBJECTS_ILIB INTERFACE ${TileDB_blosc_LINK_OPT # Find OpenSSL first in case it's needed for S3 or Azure if (NOT WIN32) - find_package(OpenSSL_EP REQUIRED) + find_package(OpenSSL REQUIRED) endif() # S3 dependencies if (TILEDB_S3) message(STATUS "The TileDB library is compiled with S3 support.") - find_package(AWSSDK_EP REQUIRED) + set(AWS_SERVICES identity-management sts s3) + find_package(AWSSDK REQUIRED QUIET COMPONENTS ${AWS_SERVICES}) target_link_libraries(TILEDB_CORE_OBJECTS_ILIB INTERFACE ${AWSSDK_LINK_LIBRARIES} @@ -542,7 +534,7 @@ endif() # Libcurl if (TILEDB_SERIALIZATION) - find_package(Curl_EP REQUIRED) + find_package(CURL REQUIRED) target_link_libraries(TILEDB_CORE_OBJECTS_ILIB INTERFACE CURL::libcurl @@ -581,11 +573,12 @@ endif() # Required dependencies. These come last as any prior dependencies relying on # these must be listed first for Linux. E.g. AWSSDK and Curl depend on Zlib, # which is installed here. -find_package(Bzip2_EP REQUIRED) -find_package(LZ4_EP REQUIRED) -find_package(Spdlog_EP REQUIRED) -find_package(Zlib_EP REQUIRED) -find_package(Zstd_EP REQUIRED) +find_package(BZip2 REQUIRED) +find_package(LZ4 MODULE REQUIRED) +find_package(spdlog REQUIRED) +find_package(ZLIB REQUIRED) +find_package(Zstd MODULE REQUIRED) +find_package(LibMagic MODULE REQUIRED) target_link_libraries(TILEDB_CORE_OBJECTS_ILIB INTERFACE BZip2::BZip2 @@ -597,7 +590,7 @@ target_link_libraries(TILEDB_CORE_OBJECTS_ILIB ) if(TILEDB_WEBP) - find_package(Webp_EP REQUIRED) + find_package(WebP REQUIRED) target_link_libraries(TILEDB_CORE_OBJECTS_ILIB INTERFACE WebP::webp @@ -646,101 +639,13 @@ target_include_directories(TILEDB_CORE_OBJECTS $ ) -############################################################ -# Append Curl linking information -############################################################ - -# Find curl link dependencies. -# This needs to be done after curl is built because we use -# curl-config to query the dependency libraries and then add -# those to the target. Ref: -# - https://github.com/TileDB-Inc/TileDB/issues/1080 -# - https://github.com/TileDB-Inc/TileDB/pull/1253 -# NOTE: just like the static dependencies in TileDBConfig create above -# (via TILEDB_DEP_STRING), this linkage embeds absolute paths. -if ((TILEDB_S3 OR TILEDB_GCS OR TILEDB_SERIALIZATION) AND NOT WIN32) - if (TILEDB_CURL_EP_BUILT) - set(CURL_CONFIG_BINARY "${TILEDB_EP_BASE}/install/bin/curl-config") - - if (NOT EXISTS "${CURL_CONFIG_BINARY}") - message(WARNING "Missing '${CURL_CONFIG_BINARY}': TileDB targets may have linker errors!") - else() - message(STATUS "Found curl-config: '${CURL_CONFIG_BINARY}'") - - if(${CURL_LIBRARIES} MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$") - execute_process( - COMMAND ${CURL_CONFIG_BINARY} --libs - OUTPUT_VARIABLE CURL_APPEND_LIBS - RESULT_VARIABLE CMD_RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - else() - execute_process( - COMMAND ${CURL_CONFIG_BINARY} --static-libs - OUTPUT_VARIABLE CURL_APPEND_LIBS - RESULT_VARIABLE CMD_RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - endif() - - if (NOT CMD_RESULT EQUAL 0) - message(WARNING - "TileDB::tiledb_static link target may lack transitive link dependencies" - "'${CURL_CONFIG_BINARY} --static-libs' failed with error: " - "${CMD_RESULT}") - elseif (CURL_APPEND_LIBS) - # ^ must check output, because it might be empty and break regex below - # Make a list. The variable passed to target_link_libraries *must* be a list. - string(REGEX REPLACE "[ \t\r\n]" ";" CURL_APPEND_LIBS ${CURL_APPEND_LIBS}) - - message(STATUS "Computed initial transitive Curl library links to TileDB targets: '${CURL_APPEND_LIBS}'") - endif() - endif() - endif() - -endif() - -if (CURL_APPEND_LIBS) - # OpenSSL is always linked on POSIX for encryption. If we include curl's - # linkage we might double link if we built openssl in superbuild - # but the system library exists. This happens on macOS 10.14 and 10.15 - # where openssl is deprecated but the library still ships. OpenSSL headers - # are not shipped, thus we build a superbuild of openssl. The -lcrypto then - # ends up trying to link against the system shared library while we already - # linked the static lib from TileDB supper build. - # End result, we remove the -lssl and -lcrypto from the list of curl extra libs - # The same problem exists for libz, so we remove -lz also. - list(REMOVE_ITEM CURL_APPEND_LIBS "-lssl" "-lcrypto" "-lz") - - # If we are cross compiling curl likely includes the arch details in the linker - # commands. In this case we want to remove them from the link libs as cmake - # will handle any linker flags for cross compilation. - SET(index 0) - foreach(CURL_APPEND_LIB ${CURL_APPEND_LIBS}) - if(${CURL_APPEND_LIB} STREQUAL "-arch") - # remove "-arch" - LIST(REMOVE_AT CURL_APPEND_LIBS ${index}) - # remove arch i.e. arm64 or x86_64 - # there are two items because we split on space above - LIST(REMOVE_AT CURL_APPEND_LIBS ${index}) - endif() - MATH(EXPR index "${index}+1") - endforeach() - - message(STATUS "Adding final transitive Curl library links to TileDB targets: '${CURL_APPEND_LIBS}'") - target_link_libraries(TILEDB_CORE_OBJECTS_ILIB - INTERFACE - ${CURL_APPEND_LIBS}) -endif() - ############################################################ # capnproto generated sources ############################################################ # Serialization if(TILEDB_SERIALIZATION) - find_package(Capnp_EP REQUIRED) + find_package(CapnProto REQUIRED) target_link_libraries(TILEDB_CORE_OBJECTS_ILIB INTERFACE CapnProto::capnp @@ -767,14 +672,8 @@ if(TILEDB_SERIALIZATION) # the capnp driver needs to be able to find the plugin executables (eg capnpc-c++). # For system installed capnp binaries we rely on the user to have their PATH # include the directory with CapNProto plugin binaries. - if(TILEDB_CAPNP_EP_BUILT) - list(APPEND CAPNP_COMPILE_COMMAND "${CMAKE_COMMAND}" -E env PATH="${TILEDB_EP_BASE}/install/bin" "${CAPNP_EXECUTABLE}" compile -I "${TILEDB_EP_BASE}/install/include") - elseif(TILEDB_VCPKG) - set(CAPNP_PLUGIN_DIR $) - list(APPEND CAPNP_COMPILE_COMMAND "${CMAKE_COMMAND}" -E env PATH="${CAPNP_PLUGIN_DIR}" "${CAPNP_EXECUTABLE}" compile "-I${CAPNP_INCLUDE_DIRECTORY}") - else() - list(APPEND CAPNP_COMPILE_COMMAND "${CAPNP_EXECUTABLE}" compile) - endif() + set(CAPNP_PLUGIN_DIR $) + list(APPEND CAPNP_COMPILE_COMMAND "${CMAKE_COMMAND}" -E env PATH="${CAPNP_PLUGIN_DIR}" "${CAPNP_EXECUTABLE}" compile "-I${CAPNP_INCLUDE_DIRECTORY}") # Add the rest of the capnp compile command list(APPEND CAPNP_COMPILE_COMMAND -oc++:"${TILEDB_SERIALIZATION_GENERATED_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/sm/serialization/tiledb-rest.capnp" --src-prefix="${CMAKE_CURRENT_SOURCE_DIR}/sm/serialization") @@ -785,8 +684,6 @@ if(TILEDB_SERIALIZATION) COMMAND "${CAPNP_COMPILE_COMMAND}" DEPENDS ${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/serialization/tiledb-rest.capnp - WORKING_DIRECTORY - ${TILEDB_EP_BASE}/.. COMMAND_EXPAND_LISTS COMMENT "Re-generate tiledb-rest.capnp. files for serialization support" ) @@ -855,7 +752,10 @@ endif() # Link the dependencies specified earlier target_link_libraries(tiledb PRIVATE - $ + # ZSTD_TARGET might be a generator expression. We need to evaluate it here again. + # TODO: TILEDB_CORE_OBJECTS_ILIB should be removed and dependencies should be specified + # without directly getting target_properties. + $> $ ) @@ -1027,3 +927,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tiledb.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) include(${CMAKE_SOURCE_DIR}/cmake/package.cmake) + +# Add alias for compatibility with earlier TileDB versions. +add_custom_target(install-tiledb + COMMENT "The install-tiledb target is deprecated and can lead to worse performance. Use install instead." + COMMAND ${CMAKE_COMMAND} --build . --target install --config $ + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) diff --git a/tiledb/api/c_api/array/test/CMakeLists.txt b/tiledb/api/c_api/array/test/CMakeLists.txt index c6f5c0a1694..95d84a29b2b 100644 --- a/tiledb/api/c_api/array/test/CMakeLists.txt +++ b/tiledb/api/c_api/array/test/CMakeLists.txt @@ -27,7 +27,7 @@ include(common NO_POLICY_SCOPE) include(unit_test) -find_package(Catch_EP REQUIRED) +find_package(Catch2 REQUIRED) # Maturity # diff --git a/tiledb/api/c_api_support/handle/test/CMakeLists.txt b/tiledb/api/c_api_support/handle/test/CMakeLists.txt index 157b2a3779d..9152bb498f7 100644 --- a/tiledb/api/c_api_support/handle/test/CMakeLists.txt +++ b/tiledb/api/c_api_support/handle/test/CMakeLists.txt @@ -25,7 +25,7 @@ # add_executable(unit_capi_handle EXCLUDE_FROM_ALL) -find_package(Catch_EP REQUIRED) +find_package(Catch2 REQUIRED) target_link_libraries(unit_capi_handle PUBLIC Catch2::Catch2WithMain) # Sources for code under test diff --git a/tiledb/common/CMakeLists.txt b/tiledb/common/CMakeLists.txt index 9cb5b1952ce..bcfe1f394da 100644 --- a/tiledb/common/CMakeLists.txt +++ b/tiledb/common/CMakeLists.txt @@ -69,7 +69,7 @@ commence(object_library baseline) if (TILEDB_USE_CPP17_PMR) this_target_sources(polymorphic_allocator/polymorphic_allocator.cc) endif() - find_package(Spdlog_EP REQUIRED) + find_package(spdlog REQUIRED) target_link_libraries(baseline PUBLIC spdlog::spdlog) target_link_libraries(baseline PUBLIC common) conclude(object_library) diff --git a/tiledb/common/governor/CMakeLists.txt b/tiledb/common/governor/CMakeLists.txt index 5d1ceae3456..57ac2b27ff5 100644 --- a/tiledb/common/governor/CMakeLists.txt +++ b/tiledb/common/governor/CMakeLists.txt @@ -28,7 +28,7 @@ include(common NO_POLICY_SCOPE) if (FALSE AND TILEDB_TESTS) # reserved for later - find_package(Catch_EP REQUIRED) + find_package(Catch2 REQUIRED) add_executable(unit_governor EXCLUDE_FROM_ALL) target_link_libraries(unit_governor PUBLIC Catch2::Catch2WithMain) diff --git a/tiledb/sm/compressors/CMakeLists.txt b/tiledb/sm/compressors/CMakeLists.txt index 6df47f697e8..ca42d431f42 100644 --- a/tiledb/sm/compressors/CMakeLists.txt +++ b/tiledb/sm/compressors/CMakeLists.txt @@ -36,10 +36,10 @@ commence(object_library compressors) dict_compressor.cc gzip_compressor.cc lz4_compressor.cc rle_compressor.cc zstd_compressor.cc) this_target_object_libraries(baseline buffer) - find_package(Bzip2_EP REQUIRED) - find_package(LZ4_EP REQUIRED) - find_package(Zlib_EP REQUIRED) - find_package(Zstd_EP REQUIRED) + find_package(BZip2 REQUIRED) + find_package(LZ4 MODULE REQUIRED) + find_package(ZLIB REQUIRED) + find_package(Zstd MODULE REQUIRED) this_target_link_libraries(BZip2::BZip2 lz4::lz4 ZLIB::ZLIB ${ZSTD_TARGET}) conclude(object_library) diff --git a/tiledb/sm/crypto/CMakeLists.txt b/tiledb/sm/crypto/CMakeLists.txt index e1fa9044a6b..1647dca95a0 100644 --- a/tiledb/sm/crypto/CMakeLists.txt +++ b/tiledb/sm/crypto/CMakeLists.txt @@ -36,7 +36,7 @@ commence(object_library tiledb_crypto) if(WIN32) this_target_link_libraries(bcrypt) else() - find_package(OpenSSL_EP REQUIRED) + find_package(OpenSSL REQUIRED) #this_target_link_libraries(OpenSSL::Crypto) target_link_libraries(tiledb_crypto PRIVATE OpenSSL::Crypto) endif() diff --git a/tiledb/sm/filter/CMakeLists.txt b/tiledb/sm/filter/CMakeLists.txt index 02543597ea4..ae68f6e2e92 100644 --- a/tiledb/sm/filter/CMakeLists.txt +++ b/tiledb/sm/filter/CMakeLists.txt @@ -129,7 +129,7 @@ conclude(object_library) #target_link_libraries(webp_filter PUBLIC tile $) #if(TILEDB_WEBP) # target_compile_definitions(webp_filter PUBLIC -DTILEDB_WEBP) -# find_package(Webp_EP REQUIRED) +# find_package(WebP REQUIRED) # target_link_libraries(webp_filter PRIVATE WebP::webp) #endif() @@ -138,7 +138,7 @@ commence(object_library webp_filter) this_target_object_libraries(filter misc_types tile) if(TILEDB_WEBP) this_target_compile_definitions(-DTILEDB_WEBP) - find_package(Webp_EP REQUIRED) + find_package(WebP REQUIRED) this_target_link_libraries(WebP::webp) endif() conclude(object_library) diff --git a/tiledb/sm/misc/CMakeLists.txt b/tiledb/sm/misc/CMakeLists.txt index 0e22dde09a0..92714ecfb66 100644 --- a/tiledb/sm/misc/CMakeLists.txt +++ b/tiledb/sm/misc/CMakeLists.txt @@ -26,7 +26,7 @@ include(common NO_POLICY_SCOPE) include(object_library) -find_package(Magic_EP REQUIRED) +find_package(LibMagic MODULE REQUIRED) # # `cancelable_tasks` object library @@ -43,6 +43,9 @@ commence(object_library constants) this_target_sources(constants.cc) conclude(object_library) +############################################################ +# provide actions/target for preparation of magic.mgc data for embedding/build + # # `mgc_dict` object library # diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index a2bf0edd0c9..154f753d732 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -25,11 +25,7 @@ # THE SOFTWARE. # -if(TILEDB_VCPKG) - find_package(Clipp CONFIG REQUIRED) -else() - find_package(Clipp_EP REQUIRED) -endif() +find_package(Clipp CONFIG REQUIRED) add_executable(tiledb-cli EXCLUDE_FROM_ALL src/commands/help_command.cc diff --git a/tools/README.md b/tools/README.md index 4774cfe1c28..6349fc865bd 100644 --- a/tools/README.md +++ b/tools/README.md @@ -10,7 +10,7 @@ To build the `tiledb` CLI executable, first configure TileDB with the CMake vari ```bash $ cmake -DTILEDB_TOOLS=ON .. -$ make && make -C tiledb tools +$ make tools ``` This will produce the binary `tiledb/tools/tiledb`.