From 0c36a4c82240c7aa722bd054f15c9b71d1a7c7cb Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Mon, 14 Nov 2022 17:23:40 +0200 Subject: [PATCH 01/25] Start writing an MSBuild script that creates NuGet packages for the core. For now it downloads the artifacts from GitHub Releases. --- .gitignore | 2 ++ scripts/nuget/GenerateNuGetPackages.proj | 45 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 scripts/nuget/GenerateNuGetPackages.proj diff --git a/.gitignore b/.gitignore index 9b471447..040e8776 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ tiledb.pc .DS_Store include +scripts/nuget/temp +*.binlog diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj new file mode 100644 index 00000000..423bbfaf --- /dev/null +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -0,0 +1,45 @@ + + + 2.12.2 + 0.0.0-dev + a9d60c8 + ./temp + ./packages + + + + + + + + + + + + + + + https://github.com/TileDB-Inc/TileDB/releases/download/$(Version)/TileDB-%(NativePlatform.Identity)-$(Version)-$(VersionTag).%(NativePlatform.ArchiveExtension) + $(TempDir)/%(NativePlatform.Identity) + + + + + + + + + + + + + From 1d7d3b077b540dd48db4e58a6d57f6b5fcde332a Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Mon, 14 Nov 2022 19:04:20 +0200 Subject: [PATCH 02/25] Support creating the native packages. --- .editorconfig | 2 +- .gitignore | 1 + scripts/nuget/GenerateNuGetPackages.proj | 21 ++++++++++++++++++- .../TileDB.Native.runtime.template.nuspec | 19 +++++++++++++++++ .../nuget/TileDB.Native.runtime.template.proj | 9 ++++++++ 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 scripts/nuget/TileDB.Native.runtime.template.nuspec create mode 100644 scripts/nuget/TileDB.Native.runtime.template.proj diff --git a/.editorconfig b/.editorconfig index ec865ba1..0f2e6ed7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ indent_style = space indent_size = 4 insert_final_newline = true -[*.{xml,*proj,props,targets,yml}] +[*.{xml,*proj,props,targets,yml,nuspec}] indent_size = 2 [*.cs] diff --git a/.gitignore b/.gitignore index 040e8776..891ffe12 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,4 @@ tiledb.pc include scripts/nuget/temp *.binlog +*.nupkg diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj index 423bbfaf..dfed80c7 100644 --- a/scripts/nuget/GenerateNuGetPackages.proj +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -1,4 +1,4 @@ - + 2.12.2 0.0.0-dev @@ -39,6 +39,25 @@ Command="tar -xf @(DownloadedFile) -C $(ExtractDir)" /> + + + + + + + + + + diff --git a/scripts/nuget/TileDB.Native.runtime.template.nuspec b/scripts/nuget/TileDB.Native.runtime.template.nuspec new file mode 100644 index 00000000..15b61c67 --- /dev/null +++ b/scripts/nuget/TileDB.Native.runtime.template.nuspec @@ -0,0 +1,19 @@ + + + + TileDB.Native.runtime.$rid$ + $version$ + TileDB Inc + false + MIT + logo.png + https://tiledb.com + + Native binaries of TileDB Embedded for $rid$. + tiledb + + + + + + diff --git a/scripts/nuget/TileDB.Native.runtime.template.proj b/scripts/nuget/TileDB.Native.runtime.template.proj new file mode 100644 index 00000000..ad26e45a --- /dev/null +++ b/scripts/nuget/TileDB.Native.runtime.template.proj @@ -0,0 +1,9 @@ + + + true + false + netstandard2.0 + TileDB.Native.runtime.template.nuspec + rid=$(RuntimeId);version=$(Version);nativelib=$(NativeLibraryPath) + + From 61b517822824679a94c681af5a73fa3495ca23e0 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 11:52:27 +0200 Subject: [PATCH 03/25] Support creating the metapackage. --- scripts/nuget/GenerateNuGetPackages.proj | 34 +++++++++++++++++++++--- scripts/nuget/TileDB.Native.nuspec | 19 +++++++++++++ scripts/nuget/TileDB.Native.proj | 9 +++++++ 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 scripts/nuget/TileDB.Native.nuspec create mode 100644 scripts/nuget/TileDB.Native.proj diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj index dfed80c7..c6150f41 100644 --- a/scripts/nuget/GenerateNuGetPackages.proj +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -5,16 +5,19 @@ a9d60c8 ./temp ./packages + $(TempDir)/runtime.json - + + - + + + + + + + + + + + + + + + + + DependsOnTargets="PackNativePackages;PackMetapackage" /> diff --git a/scripts/nuget/TileDB.Native.nuspec b/scripts/nuget/TileDB.Native.nuspec new file mode 100644 index 00000000..f259f1aa --- /dev/null +++ b/scripts/nuget/TileDB.Native.nuspec @@ -0,0 +1,19 @@ + + + + TileDB.Native + $version$ + TileDB Inc + false + MIT + logo.png + https://tiledb.com + + The TileDB Embedded library. This is a metapackage that will route to the appropriate native package based on the runtime identifier. + tiledb + + + + + + diff --git a/scripts/nuget/TileDB.Native.proj b/scripts/nuget/TileDB.Native.proj new file mode 100644 index 00000000..1fa02792 --- /dev/null +++ b/scripts/nuget/TileDB.Native.proj @@ -0,0 +1,9 @@ + + + true + false + netstandard2.0 + TileDB.Native.nuspec + version=$(Version) + + From 2a06a808d6bb111ee22c536b15ae35b6d4fc2976 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 12:47:45 +0200 Subject: [PATCH 04/25] (REMOVE BEFORE MERGE) Add a temporary MyGet feed for the TileDB native packages. --- .gitignore | 1 + nuget.config | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 nuget.config diff --git a/.gitignore b/.gitignore index 891ffe12..845a72ee 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ include scripts/nuget/temp *.binlog *.nupkg +packages diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..384bbcc8 --- /dev/null +++ b/nuget.config @@ -0,0 +1,11 @@ + + + + + + + + + + + From b72b8dc587df9050222fe7e9a4292d2f78318d00 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 13:08:13 +0200 Subject: [PATCH 05/25] Use the TileDB Embedded page for the project URL in the native packages. --- scripts/nuget/TileDB.Native.nuspec | 2 +- scripts/nuget/TileDB.Native.runtime.template.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/nuget/TileDB.Native.nuspec b/scripts/nuget/TileDB.Native.nuspec index f259f1aa..af379dd6 100644 --- a/scripts/nuget/TileDB.Native.nuspec +++ b/scripts/nuget/TileDB.Native.nuspec @@ -7,7 +7,7 @@ false MIT logo.png - https://tiledb.com + https://tiledb.com/products/tiledb-embedded/ The TileDB Embedded library. This is a metapackage that will route to the appropriate native package based on the runtime identifier. tiledb diff --git a/scripts/nuget/TileDB.Native.runtime.template.nuspec b/scripts/nuget/TileDB.Native.runtime.template.nuspec index 15b61c67..baea163b 100644 --- a/scripts/nuget/TileDB.Native.runtime.template.nuspec +++ b/scripts/nuget/TileDB.Native.runtime.template.nuspec @@ -7,7 +7,7 @@ false MIT logo.png - https://tiledb.com + https://tiledb.com/products/tiledb-embedded/ Native binaries of TileDB Embedded for $rid$. tiledb From cad8b057fe315d88778aafd8f2d65151adde0556 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 13:22:58 +0200 Subject: [PATCH 06/25] Use the `TileDB.Native` NuGet package and remove the nuspec of `TileDB.CSharp`. --- sources/TileDB.CSharp/TileDB.CSharp.csproj | 15 +++++++--- sources/TileDB.CSharp/TileDB.CSharp.nuspec | 29 ------------------- sources/TileDB.CSharp/TileDB.CSharp.targets | 29 ------------------- .../runtimes/linux-x64/native/README.md | 1 - .../runtimes/osx-x64/native/README.md | 1 - .../runtimes/win-x64/native/README.md | 1 - 6 files changed, 11 insertions(+), 65 deletions(-) delete mode 100644 sources/TileDB.CSharp/TileDB.CSharp.nuspec delete mode 100644 sources/TileDB.CSharp/TileDB.CSharp.targets delete mode 100644 sources/TileDB.CSharp/runtimes/linux-x64/native/README.md delete mode 100644 sources/TileDB.CSharp/runtimes/osx-x64/native/README.md delete mode 100644 sources/TileDB.CSharp/runtimes/win-x64/native/README.md diff --git a/sources/TileDB.CSharp/TileDB.CSharp.csproj b/sources/TileDB.CSharp/TileDB.CSharp.csproj index 9dba3961..dc0c2a54 100644 --- a/sources/TileDB.CSharp/TileDB.CSharp.csproj +++ b/sources/TileDB.CSharp/TileDB.CSharp.csproj @@ -1,4 +1,4 @@ - + net5.0 true @@ -6,13 +6,20 @@ Major TileDB.CSharp 5.3.0 - TileDB.CSharp.nuspec - version=$(Version) + TileDB Inc + MIT + logo.png + https://tiledb.com/products/tiledb-embedded/ + C# wrapper of the TileDB Embedded universal data engine. + tiledb ./lib - + + + + diff --git a/sources/TileDB.CSharp/TileDB.CSharp.nuspec b/sources/TileDB.CSharp/TileDB.CSharp.nuspec deleted file mode 100644 index e808b9d6..00000000 --- a/sources/TileDB.CSharp/TileDB.CSharp.nuspec +++ /dev/null @@ -1,29 +0,0 @@ - - - - TileDB.CSharp - $version$ - TileDB Inc - false - MIT - logo.png - https://github.com/TileDB-Inc/TileDB-CSharp - CSharp wrapper of TileDB universal data engine - This package is the csharp wrapper of TileDB 2.12.0. - tiledb - - - - - - - - - - - - - - - - diff --git a/sources/TileDB.CSharp/TileDB.CSharp.targets b/sources/TileDB.CSharp/TileDB.CSharp.targets deleted file mode 100644 index d402a0e6..00000000 --- a/sources/TileDB.CSharp/TileDB.CSharp.targets +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - PreserveNewest - tiledb.dll - false - - - - - - PreserveNewest - libtiledb.so - false - - - - - - PreserveNewest - libtiledb.dylib - false - - - diff --git a/sources/TileDB.CSharp/runtimes/linux-x64/native/README.md b/sources/TileDB.CSharp/runtimes/linux-x64/native/README.md deleted file mode 100644 index d336705d..00000000 --- a/sources/TileDB.CSharp/runtimes/linux-x64/native/README.md +++ /dev/null @@ -1 +0,0 @@ -# this directory is for linux native library diff --git a/sources/TileDB.CSharp/runtimes/osx-x64/native/README.md b/sources/TileDB.CSharp/runtimes/osx-x64/native/README.md deleted file mode 100644 index 141f426e..00000000 --- a/sources/TileDB.CSharp/runtimes/osx-x64/native/README.md +++ /dev/null @@ -1 +0,0 @@ -# this directory is for macos native library diff --git a/sources/TileDB.CSharp/runtimes/win-x64/native/README.md b/sources/TileDB.CSharp/runtimes/win-x64/native/README.md deleted file mode 100644 index 37abea99..00000000 --- a/sources/TileDB.CSharp/runtimes/win-x64/native/README.md +++ /dev/null @@ -1 +0,0 @@ -# this directory is for windows native library From 74a1520923a3f356311b73b6181f526cc5b6a8f3 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 14:15:33 +0200 Subject: [PATCH 07/25] Set `UseCurrentRuntimeIdentifier` in the executable projects. --- examples/TileDB.CSharp.Example/TileDB.CSharp.Example.csproj | 1 + .../QuickstartSparseString/QuickstartSparseString.csproj | 1 + tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj | 1 + 3 files changed, 3 insertions(+) diff --git a/examples/TileDB.CSharp.Example/TileDB.CSharp.Example.csproj b/examples/TileDB.CSharp.Example/TileDB.CSharp.Example.csproj index 9be9c503..8253ac83 100644 --- a/examples/TileDB.CSharp.Example/TileDB.CSharp.Example.csproj +++ b/examples/TileDB.CSharp.Example/TileDB.CSharp.Example.csproj @@ -5,6 +5,7 @@ Major TileDB.CSharp.Examples net5.0;net6.0 + true diff --git a/examples/bindings/QuickstartSparseString/QuickstartSparseString.csproj b/examples/bindings/QuickstartSparseString/QuickstartSparseString.csproj index 777be6ea..cf99b86b 100644 --- a/examples/bindings/QuickstartSparseString/QuickstartSparseString.csproj +++ b/examples/bindings/QuickstartSparseString/QuickstartSparseString.csproj @@ -5,6 +5,7 @@ Exe Major net5.0;net6.0 + true diff --git a/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj b/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj index 3a25a685..c521cc53 100644 --- a/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj +++ b/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj @@ -5,6 +5,7 @@ Major TileDB.CSharp.Test net5.0;net6.0 + true From 2ec7fe91aa2a4870cd48bc96c982e1f9fa8528fd Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 15:08:38 +0200 Subject: [PATCH 08/25] Restore the template packages. And add a property to them that seems to save time. --- scripts/nuget/GenerateNuGetPackages.proj | 15 ++++++++++++--- scripts/nuget/TileDB.Native.proj | 1 + scripts/nuget/TileDB.Native.runtime.template.proj | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj index c6150f41..ad0d9739 100644 --- a/scripts/nuget/GenerateNuGetPackages.proj +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -6,6 +6,8 @@ ./temp ./packages $(TempDir)/runtime.json + ./TileDB.Native.proj + ./TileDB.Native.runtime.template.proj @@ -47,7 +49,7 @@ Inputs="@(NativePlatform->'$(TempDir)/%(Identity)/%(LibraryPath)')" Outputs="@(NativePlatform->'$(OutDir)/TileDB.Native.runtime.%(RuntimeId).$(Version).nupkg')"> - @@ -75,10 +77,10 @@ @@ -86,6 +88,13 @@ + + + + diff --git a/scripts/nuget/TileDB.Native.proj b/scripts/nuget/TileDB.Native.proj index 1fa02792..62d5e122 100644 --- a/scripts/nuget/TileDB.Native.proj +++ b/scripts/nuget/TileDB.Native.proj @@ -2,6 +2,7 @@ true false + true netstandard2.0 TileDB.Native.nuspec version=$(Version) diff --git a/scripts/nuget/TileDB.Native.runtime.template.proj b/scripts/nuget/TileDB.Native.runtime.template.proj index ad26e45a..4bef0039 100644 --- a/scripts/nuget/TileDB.Native.runtime.template.proj +++ b/scripts/nuget/TileDB.Native.runtime.template.proj @@ -2,6 +2,7 @@ true false + true netstandard2.0 TileDB.Native.runtime.template.nuspec rid=$(RuntimeId);version=$(Version);nativelib=$(NativeLibraryPath) From 287a4acdcccef3a17da00f1802b6028b7feecc6f Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 15:20:04 +0200 Subject: [PATCH 09/25] Remove the ValueSeparator hack. --- scripts/nuget/GenerateNuGetPackages.proj | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj index ad0d9739..ead1fe1f 100644 --- a/scripts/nuget/GenerateNuGetPackages.proj +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -11,15 +11,13 @@ - - + - + - - - - - - - + + {"runtimes": {@(NativePlatform-> '"%(RuntimeId)":{"TileDB.Native":{"TileDB.Native.runtime.%(RuntimeId)":"$(Version)"}}')}} + $(RuntimeJsonPayload.Replace(';',',')) + From 0e4ca34ef13df89c0e64ab8d488949769ce0e05f Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 15 Nov 2022 15:21:10 +0200 Subject: [PATCH 10/25] Remove the "Install/Download tiledb" steps from CI. And disable fail-fast in the Run-Tests action matrix. --- .github/scripts/download_tiledb.sh | 18 - .github/scripts/install_tiledb.sh | 4 - .github/workflows/tiledb-csharp.yml | 10 +- cpp/CMakeLists.txt | 72 ---- cpp/cmake/TileDB.cmake | 566 ---------------------------- 5 files changed, 1 insertion(+), 669 deletions(-) delete mode 100755 .github/scripts/download_tiledb.sh delete mode 100755 .github/scripts/install_tiledb.sh delete mode 100644 cpp/CMakeLists.txt delete mode 100644 cpp/cmake/TileDB.cmake diff --git a/.github/scripts/download_tiledb.sh b/.github/scripts/download_tiledb.sh deleted file mode 100755 index 3d0b8569..00000000 --- a/.github/scripts/download_tiledb.sh +++ /dev/null @@ -1,18 +0,0 @@ -set -e -x -TAG=2.12.0 -ID=ac8a0df - -RELEASE=x86_64-$TAG-$ID -wget https://github.com/TileDB-Inc/TileDB/releases/download/$TAG/tiledb-windows-$RELEASE.zip -unzip tiledb-windows-$RELEASE.zip -d tiledb-windows -cp ./tiledb-windows/bin/tiledb.dll ./sources/TileDB.CSharp/runtimes/win-x64/native/ - -wget https://github.com/TileDB-Inc/TileDB/releases/download/$TAG/tiledb-linux-$RELEASE.tar.gz -mkdir tiledb-linux -tar xvfz tiledb-linux-$RELEASE.tar.gz --directory tiledb-linux -cp ./tiledb-linux/lib/libtiledb.so* ./sources/TileDB.CSharp/runtimes/linux-x64/native/ - -wget https://github.com/TileDB-Inc/TileDB/releases/download/$TAG/tiledb-macos-$RELEASE.tar.gz -mkdir tiledb-macos -tar xvfz tiledb-macos-$RELEASE.tar.gz --directory tiledb-macos -cp ./tiledb-macos/lib/libtiledb.dylib ./sources/TileDB.CSharp/runtimes/osx-x64/native/ diff --git a/.github/scripts/install_tiledb.sh b/.github/scripts/install_tiledb.sh deleted file mode 100755 index 9fa09f19..00000000 --- a/.github/scripts/install_tiledb.sh +++ /dev/null @@ -1,4 +0,0 @@ -set -e -x -cd cpp -cmake . -cmake --build . --target install \ No newline at end of file diff --git a/.github/workflows/tiledb-csharp.yml b/.github/workflows/tiledb-csharp.yml index a90e83f3..5a9db62f 100644 --- a/.github/workflows/tiledb-csharp.yml +++ b/.github/workflows/tiledb-csharp.yml @@ -11,6 +11,7 @@ on: jobs: Run-Tests: strategy: + fail-fast: false matrix: # Will be checking following versions dotnet: ['net5.0', 'net6.0'] @@ -21,11 +22,6 @@ jobs: # Checks out repository - uses: actions/checkout@v3 - # Install tiledb - - name: Install tiledb - shell: bash - run: ./.github/scripts/install_tiledb.sh - - name: Remove existing .NET versions shell: bash run: | @@ -65,10 +61,6 @@ jobs: - name: Display dotnet versions run: dotnet --info - # Download tiledb - - name: Download tiledb - run: ./.github/scripts/download_tiledb.sh - # DotNet build - name: Dotnet build for TileDB.CSharp run: | diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt deleted file mode 100644 index bb70a002..00000000 --- a/cpp/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -# -# CMakeLists.txt -# -# -# setup -cmake_minimum_required(VERSION 3.16) - -set(TILEDB_VERSION "2.12.0" CACHE STRING "TileDB version") -set(TILEDB_GIT_TAG "dev" CACHE STRING "git branch") - -project(TileDB-CSharp) - -# C++11 -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED 11) -set(CMAKE_CXX_EXTENSIONS OFF) - -# Release build by default -set(default_build_type "Release") -if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE ${default_build_type}) -endif() - -# installation prefix -message(STATUS "CMAKE_SYSTEM_NAME:${CMAKE_SYSTEM_NAME}") -option(OVERRIDE_INSTALL_PREFIX "override default installation directory to ../dist" ON) -if (OVERRIDE_INSTALL_PREFIX) -# set(PREFIX_REL_PATH "${CMAKE_SOURCE_DIR}/../dist/${CMAKE_SYSTEM_NAME}") - set(PREFIX_REL_PATH "${CMAKE_SOURCE_DIR}/../sources/TileDB.CSharp") - get_filename_component(DEFAULT_PREFIX "${PREFIX_REL_PATH}" ABSOLUTE) - set(CMAKE_INSTALL_PREFIX "${DEFAULT_PREFIX}" CACHE PATH "Default install prefix" FORCE) - message(STATUS "Using default install prefix ${CMAKE_INSTALL_PREFIX}. To control CMAKE_INSTALL_PREFIX, set OVERRIDE_INSTALL_PREFIX=OFF") - -endif() - -if (WIN32) # Windows - set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}/runtimes/win-x64/native") - set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/runtimes/win-x64/native") -elseif(APPLE) # OSX - set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}/runtimes/osx-x64/native") - set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/runtimes/osx-x64/native") -else() # Linux - set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}/runtimes/linux-x64/native") - set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/runtimes/linux-x64/native") -endif() - -message(STATUS "CMAKE_INSTALL_BINDIR: ${CMAKE_INSTALL_BINDIR}") -message(STATUS "CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}") - -# compiler flags -string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE) -message(STATUS "BUILD_TYPE:${BUILD_TYPE}") -if(BUILD_TYPE STREQUAL "RELEASE") - add_compile_options(-DNDEBUG) -endif() - -if(BUILD_TYPE STREQUAL "DEBUG") - add_compile_options(-DDEBUG ) -endif() - -## relative path -if(NOT APPLE) - set(CMAKE_BUILD_RPATH "$\{ORIGIN\}") -endif() - -########################################### -# Download released tiledb or build tiledb -########################################## - -# src -include(./cmake/TileDB.cmake) - diff --git a/cpp/cmake/TileDB.cmake b/cpp/cmake/TileDB.cmake deleted file mode 100644 index 154ed93c..00000000 --- a/cpp/cmake/TileDB.cmake +++ /dev/null @@ -1,566 +0,0 @@ -include(FetchContent) -include(GNUInstallDirs) - -############################ -# Download pre-build tiledb or build from source -############################ -message(STATUS "start to set tiledb for version:${TILEDB_VERSION}") - -if(${TILEDB_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") -message(STATUS "start to set TILEDB_DOWNLOAD_URL and TILEDB_DOWNLOAD_SHA1") - -if(${TILEDB_VERSION} STREQUAL "2.12.0") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.12.0/tiledb-windows-x86_64-2.12.0-ac8a0df.zip") - SET(TILEDB_DOWNLOAD_SHA1 "b82ed9593a04d2e0950d4267a77412055fce320a") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.12.0/tiledb-macos-x86_64-2.12.0-ac8a0df.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "6811578e847f6e4a1e0ecd16229970f4d4e7ffde") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.12.0/tiledb-linux-x86_64-2.12.0-ac8a0df.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "23e6ed9c397096a2368974de5eaccb0b3e66ce0b") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.11.3") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.3/tiledb-windows-x86_64-2.11.3-a55a910.zip") - SET(TILEDB_DOWNLOAD_SHA1 "0bd042b1c56da9fc1c20b2156e942c23ba1865ac") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.3/tiledb-macos-x86_64-2.11.3-a55a910.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "f0f091f8401cb1b4060fb3068fe7fc4afdc262b7") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.3/tiledb-linux-x86_64-2.11.3-a55a910.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "5c2f44d9ca9b34e61230fd0f0a763f0fffa04702") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.11.2") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-windows-x86_64-2.11.2-6ad6f76.zip") - SET(TILEDB_DOWNLOAD_SHA1 "2a8a35782e73dce77c539c75db9a5736fc796ca8") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-macos-x86_64-2.11.2-6ad6f76.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "55f4e4b478f44ce84abe467fe8ed3d7fffc7a1a0") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-linux-x86_64-2.11.2-6ad6f76.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "e6840cccd280b5c57695c359033d56df38fb3f1b") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.11.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.1/tiledb-windows-x86_64-2.11.1-15a1161.zip") - SET(TILEDB_DOWNLOAD_SHA1 "f88420f4269aaac69a1dfb53e20f4848c407fa3f") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.1/tiledb-macos-x86_64-2.11.1-15a1161.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "95439b79e6f27cd9441403429161b8fc962e03ea") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.1/tiledb-linux-x86_64-2.11.1-15a1161.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "909a579420abcd490c54b486f10a1791499f30d8") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.11.0") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.0/tiledb-windows-x86_64-2.11.0-34e5dbc.zip") - SET(TILEDB_DOWNLOAD_SHA1 "ae60d7bea72472716cb85631c27f8d2ddc7d7dd7") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.0/tiledb-macos-x86_64-2.11.0-34e5dbc.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "56e865574404cb11cbd631c7c25ab0cfd413f9b3") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.0/tiledb-linux-x86_64-2.11.0-34e5dbc.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "c2eb91e352905728edfeb8dc0a6fbfd7bc69ef66") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.10.4") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.4/tiledb-windows-x86_64-2.10.4-f2b5d11.zip") - SET(TILEDB_DOWNLOAD_SHA1 "68b4a8a22a3964efb8ef254854cf7d73f4fa2c50") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.4/tiledb-macos-x86_64-2.10.4-f2b5d11.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "7dffaf2ca3e3585641f1b6840618f3563b821041") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.4/tiledb-linux-x86_64-2.10.4-f2b5d11.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "b765f9bd29dceaf29be9bca098c18cb74c7c1c37") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.10.3") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.3/tiledb-windows-x86_64-2.10.3-7a5d1cd.zip") - SET(TILEDB_DOWNLOAD_SHA1 "aa4030a55339d23ef25a0d9593dbad76e9246742") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.3/tiledb-macos-x86_64-2.10.3-7a5d1cd.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "897c17caec445f74114ac1c6e7d453d6f6d1c2e7") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.3/tiledb-linux-x86_64-2.10.3-7a5d1cd.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "49387ad851693a748d17d638a7d716ad62ac8706") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.10.2") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.2/tiledb-windows-x86_64-2.10.2-9ab84f9.zip") - SET(TILEDB_DOWNLOAD_SHA1 "fe6dac320afb08dd3f2f40f2705306f6eb245f8b") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.2/tiledb-macos-x86_64-2.10.2-9ab84f9.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "2be62a6c48c0bd7aeea786414aa32aef26fe6a64") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.2/tiledb-linux-x86_64-2.10.2-9ab84f9.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "03f6d4892f11cbd939660b78c923325396bd600f") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.10.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.1/tiledb-windows-x86_64-2.10.1-6535d4c.zip") - SET(TILEDB_DOWNLOAD_SHA1 "d0c5ed50f3c5215cae8a4dd82f756624e43252aa") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.1/tiledb-macos-x86_64-2.10.1-6535d4c.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "68a43a62544ac849e1ca1b7c724f129dd7c8e50d") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.1/tiledb-linux-x86_64-2.10.1-6535d4c.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "8c48232cd52934724b2b7a254ebad6c27e5a7683") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.9.4") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.9.4/tiledb-windows-x86_64-2.9.4-4e14c01.zip") - SET(TILEDB_DOWNLOAD_SHA1 "f5280ce74b52cdc5071e03c98f9251d635e27fa4") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.9.4/tiledb-macos-x86_64-2.9.4-4e14c01.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "cc1db32693de9d8311ed245889d2aa3bb3eb5df9") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.9.4/tiledb-linux-x86_64-2.9.4-4e14c01.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "74b72ecd136490bd5aeedc75502efef95d27293b") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.9.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.9.1/tiledb-windows-x86_64-2.9.1-1855f7c.zip") - SET(TILEDB_DOWNLOAD_SHA1 "515661B7121CF1E73F2A079143E9AE4D2DF54EDB") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.9.1/tiledb-macos-x86_64-2.9.1-1855f7c.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "92C89D5FC5024CDF158E0534227C9037A1742919") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.9.1/tiledb-linux-x86_64-2.9.1-1855f7c.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "EEC2066E0CEC7F9BABEA0B5CDFC03DCA834B9F5D") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.8.2") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.2/tiledb-windows-x86_64-2.8.2-6f382df.zip") - SET(TILEDB_DOWNLOAD_SHA1 "32D8EDDAACF017B99D96F04746484D5A23974E9D") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.2/tiledb-macos-x86_64-2.8.2-6f382df.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "6852E8829117DCAB6E89067E4C1A26C7B151CCF2") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.2/tiledb-linux-x86_64-2.8.2-6f382df.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "9AF5C8DB1B5E7D7F16E39976AA433544BC78E7EC") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.8.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.1/tiledb-windows-x86_64-2.8.1-e9a945c.zip") - SET(TILEDB_DOWNLOAD_SHA1 "2D759909A7693626388F6FD5528FFF2823CA8450") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.1/tiledb-macos-x86_64-2.8.1-e9a945c.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "67F07C0EFA757FA0ECB3917ED2E60A56D477C5E9") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.1/tiledb-linux-x86_64-2.8.1-e9a945c.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "F60C8DFDDDF4EEDBFA414FE16F1ABE4A1A2D46F1") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.8.0") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.0/tiledb-windows-x86_64-2.8.0-f8efd39.zip") - SET(TILEDB_DOWNLOAD_SHA1 "EE28B243E1B025A1966643A4C924CB7485418285") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.0/tiledb-macos-x86_64-2.8.0-f8efd39.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "6E6033B26BCEA96B8A9D0948833958D5E8609E56") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.8.0/tiledb-linux-x86_64-2.8.0-f8efd39.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "8FE5E69D825829F10A4C35F529A9839DA0C254B0") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.7.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.1/tiledb-windows-x86_64-2.7.1-a942c71.zip") - SET(TILEDB_DOWNLOAD_SHA1 "FD3CD7C72A8C7056445B402622264CA3C3DA89CC") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.1/tiledb-macos-x86_64-2.7.1-a942c71.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "07074BAF703440C0A54D2EB41EB1F59C53A519F0") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.1/tiledb-linux-x86_64-2.7.1-a942c71.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "D61B01FDD6944F5AE3816426CF66350C54A2D737") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.6.4") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.4/tiledb-windows-x86_64-2.6.4-477532b.zip") - SET(TILEDB_DOWNLOAD_SHA1 "0A12236ACFB6F45CBCF1842464781A3F0F897E4E") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.4/tiledb-macos-x86_64-2.6.4-477532b.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "9783E3C3E574C146A42A673E8680D04B03D6D450") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.4/tiledb-linux-x86_64-2.6.4-477532b.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "5028B159F6EE6B8ABDE115EE3C431C6ABC396214") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.6.2") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.2/tiledb-windows-x86_64-2.6.2-bf10e49.zip") - SET(TILEDB_DOWNLOAD_SHA1 "4892B62C44CF897AC6C851703143C045D5AC3E82") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.2/tiledb-macos-x86_64-2.6.2-bf10e49.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "8312ECE1A7832E24E0B3B556B173B78255505E0E") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.2/tiledb-linux-x86_64-2.6.2-bf10e49.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "2596A6825D16A9E0119C8DB280EA7D4A64458072") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.6.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.1/tiledb-windows-x86_64-2.6.1-2f6b7f6.zip") - SET(TILEDB_DOWNLOAD_SHA1 "D59084906DC34E8B2416DCE7A203B125609286FB") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.1/tiledb-macos-x86_64-2.6.1-2f6b7f6.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "FC3B6642001C2AE036F8CFB990382F7BCFE27CD9") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.1/tiledb-linux-x86_64-2.6.1-2f6b7f6.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "F773AE6D4BFD9182CBA5F6879F595EAFBDA26006") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.6.0") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.0/tiledb-windows-x86_64-2.6.0-66f4b41.zip") - SET(TILEDB_DOWNLOAD_SHA1 "7FF516F55E19F460CE68EB1DCB52E17F72F845A3") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.0/tiledb-macos-x86_64-2.6.0-66f4b41.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "3C3A80AA2217B0C38E0FCCCA5C8FC4E63433E9FA") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.0/tiledb-linux-x86_64-2.6.0-66f4b41.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "57FDA45FD19F9E0DD7734DE2F1A8ECA427DE0B10") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.5.3") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.3/tiledb-windows-x86_64-2.5.3-dd6a41b.zip") - SET(TILEDB_DOWNLOAD_SHA1 "AE26920E9D7DEDCBAD3C0E5681DECD7A66D3DCF6") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.3/tiledb-macos-x86_64-2.5.3-dd6a41b.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "D29E2EE28AE9316FCB6710CA93C9E5D5A6C65795") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.3/tiledb-linux-x86_64-2.5.3-dd6a41b.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "AC28E99F0E1B445E72E2D2F0D84791CB3F40FF2E") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.5.2") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.2/tiledb-windows-x86_64-2.5.2-f9c058f.zip") - SET(TILEDB_DOWNLOAD_SHA1 "6DA1A3BC5BE2855EDD74CC521E6076A26F60ED19") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.2/tiledb-macos-x86_64-2.5.2-f9c058f.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "581168DF22F0F507DF87B8E52CEFD51630A99A70") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.2/tiledb-linux-x86_64-2.5.2-f9c058f.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "904D28E5480E0AFA04AE772D75AF737AF2ACC5E5") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.5.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.1/tiledb-windows-x86_64-2.5.1-5b65a96.zip") - SET(TILEDB_DOWNLOAD_SHA1 "D08658D08FAB8DA1C6D21C6C7AF68B02D9D5D9E7") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.1/tiledb-macos-x86_64-2.5.1-5b65a96.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "66521CCF7B5E6FE9BE29C0107E8BB433BB50CFAD") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.5.1/tiledb-linux-x86_64-2.5.1-5b65a96.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "D276396E0242C64D54479018517AD93206DC9E1B") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.4.4") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.4/tiledb-windows-x86_64-2.4.4-7257605.zip") - SET(TILEDB_DOWNLOAD_SHA1 "4E85442762F2B00761BDF08ADF47B2DF849D5B49") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.4/tiledb-macos-x86_64-2.4.4-7257605.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "188A5633E3E316782271B3BE770C8ABB92219A11") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.4/tiledb-linux-x86_64-2.4.4-7257605.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "F7A3FB9D72E17941103EC176B7B1F7F4770F71F9") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.4.2") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.2/tiledb-windows-x86_64-2.4.2-81a0286.zip") - SET(TILEDB_DOWNLOAD_SHA1 "2A1CE6FCDE6C2E6A744EB6F68914121EDFB33B94") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.2/tiledb-macos-x86_64-2.4.2-81a0286.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "54B13C8D6F57E2B8AF310F5C0331F8D95B0BEEA1") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.2/tiledb-linux-x86_64-2.4.2-81a0286.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "035AD2D81A2ED3B84B00125586ED68F8D75958E8") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.4.0") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.0/tiledb-windows-x86_64-2.4.0-baf64e1.zip") - SET(TILEDB_DOWNLOAD_SHA1 "CE9247503A7DF2A876717FD091CD23BBE1C32593") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.0/tiledb-macos-x86_64-2.4.0-baf64e1.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "78D74D6D3C3A259087CA00707554AC8545AA9311") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.4.0/tiledb-linux-x86_64-2.4.0-baf64e1.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "8FB19EFFA55BF4E7DAA38205C0C9CE32890CC821") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.3.0") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.0/tiledb-windows-2.3.0-a87da7f-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "CBE6F41108B49DA6ECA516A9A12BAD2064BD2240") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.0/tiledb-macos-2.3.0-a87da7f-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "BFA0247199BD6E2E08104534B45FF83123B7D4AB") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.0/tiledb-linux-2.3.0-a87da7f-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "15592594E38560A55FD7E3B7A052D9FF79F59A49") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.3.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.1/tiledb-windows-x86_64-2.3.1-6d36169.zip") - SET(TILEDB_DOWNLOAD_SHA1 "FF1DB0E556B2922D7DD0C2D7ECE6FDD03AEA1258") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.1/tiledb-macos-x86_64-2.3.1-6d36169.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "E9086167F6B9B5B304F3A724BAC08E9128AA7913") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.1/tiledb-linux-x86_64-2.3.1-6d36169.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "DD65523F22632161B43E2263AD6080F338F759D1") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.3.2") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.2/tiledb-windows-x86_64-2.3.2-4b563fe.zip") - SET(TILEDB_DOWNLOAD_SHA1 "5C0F8C7FDBD927151DFA927129ED87B7C073C5EE") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.2/tiledb-macos-x86_64-2.3.2-4b563fe.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "7610017E1835903286942C388FE58BF55CF8EC5C") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.2/tiledb-linux-x86_64-2.3.2-4b563fe.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "06360C3F6D6B96B2BE8038DE6E56ABB3C1A00E43") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.3.3") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.3/tiledb-windows-x86_64-2.3.3-9336d3f.zip") - SET(TILEDB_DOWNLOAD_SHA1 "7C777FC98E40E72400A590EF8EB9C23046D18689") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.3/tiledb-macos-x86_64-2.3.3-9336d3f.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "AE0D1606DAA6D984333E06D42DF25044BF7E347E") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.3/tiledb-linux-x86_64-2.3.3-9336d3f.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "803368D31C2EADF1B866A362CE0514073F84DAD9") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.3.4") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.4/tiledb-windows-x86_64-2.3.4-e19855e.zip") - SET(TILEDB_DOWNLOAD_SHA1 "C0F3D834519B2FB7D58CFB5BC8EB03F5004EDFAA") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.4/tiledb-macos-x86_64-2.3.4-e19855e.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "7B674AD6DE878017B400F0F3DCC3B8D6CF9982B3") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.3.4/tiledb-linux-x86_64-2.3.4-e19855e.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "B2BBDCBBAEF341AC7E14D428A2302D06BC899CF0") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.2.9") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.9/tiledb-windows-2.2.9-dc3bb54-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "41D72B04A2C503AEEEB45A893DD82B071C732D45") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.9/tiledb-macos-2.2.9-dc3bb54-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "6E6A04351A6DDA4C22BE15B639F48931423F3B86") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.9/tiledb-linux-2.2.9-dc3bb54-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "CB0AD1D6D942F926260B580F2C3073740DEAAD9F") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.2.8") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.8/tiledb-windows-2.2.8-6e7a5a2-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "54633F19A142FFB507E030633C8C713FB529169E") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.8/tiledb-macos-2.2.8-6e7a5a2-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "0037958A043F21B9392E3261C7495F81C6780C5B") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.8/tiledb-linux-2.2.8-6e7a5a2-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "C8CEF21926EE9860B307ACD200961DB0B5E693A3") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.2.7") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.7/tiledb-windows-2.2.7-a788ce5-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "67878e0274db413d22b738a45b6cc228badf084e") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.7/tiledb-macos-2.2.7-a788ce5-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "e1e0c78a3cdd25c7f9357125b67871fcfd5a8bfa") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.7/tiledb-linux-2.2.7-a788ce5-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "ad3ecd762fbd5ff6adf2fada5f923d2056a33a2f") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.2.6") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.6/tiledb-windows-2.2.6-b6926bc-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "700e5cdbaa77b00d31f498dbab353b06d4890ae7") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.6/tiledb-macos-2.2.6-b6926bc-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "348d56dede19a22e351571f1b5bdc5c1cba70684") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.6/tiledb-linux-2.2.6-b6926bc-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "198c84e74638d46949aad63881902eff095282f9") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.2.3") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.3/tiledb-windows-2.2.3-dbaf5ff-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "82eabce749f070f3a48095e229ec5f3389beee2f") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.3/tiledb-macos-2.2.3-dbaf5ff-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "8b07960e274d5eb156279edafc6f6ebc5d219ec8") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.3/tiledb-linux-2.2.3-dbaf5ff-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "817dfcbfc873a1728a66525d8c275e66d6742300") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.2.1") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.1/tiledb-windows-2.2.1-4744a3f-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "6b30dbd909ba92e78b9805434e316b5b93765442") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.1/tiledb-macos-2.2.1-4744a3f-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "66d81a4efba76966a8e37786f79b9825588e1e92") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.2.1/tiledb-windows-2.2.1-4744a3f-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "79f671ab8af89e6b2f270c59bbda4af0b973c2fc") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.1.0") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.1.0/tiledb-windows-2.1.0-1073faa-full.zip") - SET(TILEDB_DOWNLOAD_SHA1 "1d3e5437d105822b29a0881f5599512a59d50120") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.1.0/tiledb-macos-2.1.0-1073faa-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "bbce94181f3cf1ea279dd255f596dd3e90dcd7cb") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.1.0/tiledb-linux-2.1.0-1073faa-full.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "b748a1bb5aec052d9ec7c2ad4b39b50ae100cd9b") - endif() -elseif(${TILEDB_VERSION} STREQUAL "2.0.7") - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.0.7/tiledb-windows-2.0.7-2058d3d.zip") - SET(TILEDB_DOWNLOAD_SHA1 "4E3BEED60F2F29B31DDA04CAA21DDE22B96B77B9") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.0.7/tiledb-macos-2.0.7-2058d3d.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "B5CF25FC57B89009D3F5E21AC902C7642BA295E6") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.0.7/tiledb-linux-2.0.7-2058d3d.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "556CCD6265A9F62884A8F798753625D7352ACCD5") - endif() -else() - if (WIN32) # Windows - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.12.0/tiledb-windows-x86_64-2.12.0-ac8a0df.zip") - SET(TILEDB_DOWNLOAD_SHA1 "b82ed9593a04d2e0950d4267a77412055fce320a") - elseif(APPLE) # OSX - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.12.0/tiledb-macos-x86_64-2.12.0-ac8a0df.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "6811578e847f6e4a1e0ecd16229970f4d4e7ffde") - else() # Linux - SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.12.0/tiledb-linux-x86_64-2.12.0-ac8a0df.tar.gz") - SET(TILEDB_DOWNLOAD_SHA1 "23e6ed9c397096a2368974de5eaccb0b3e66ce0b") - endif() -endif() - -message(STATUS "TILEDB_DOWNLOAD_URL: ${TILEDB_DOWNLOAD_URL}") -message(STATUS "TILEDB_DOWNLOAD_SHA1: ${TILEDB_DOWNLOAD_SHA1}") - -endif() - -### fetch prebuilt tiledb -if(${TILEDB_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") - - ##fetch tiledb - FetchContent_Declare( - tiledb_prebuilt - URL ${TILEDB_DOWNLOAD_URL} - URL_HASH SHA1=${TILEDB_DOWNLOAD_SHA1} - ) - FetchContent_GetProperties(tiledb_prebuilt) - - if(NOT tiledb_prebuilt_POPULATED) - FetchContent_Populate(tiledb_prebuilt) - message(STATUS "tiledb_prebuilt_SOURCE_DIR:${tiledb_prebuilt_SOURCE_DIR}") - message(STATUS "tiledb_prebuilt_BINARY_DIR:${tiledb_prebuilt_BINARY_DIR}") - endif() - include(${tiledb_prebuilt_SOURCE_DIR}/lib/cmake/TileDB/TileDBConfig.cmake) - - #get_target_property(TILEDB_BINARY_DIR TileDB::tiledb_shared BINARY_DIR) - #get_target_property(TILEDB_IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE TileDB::tiledb_shared IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE) - get_target_property(TILEDB_IMPORTED_LOCATION_RELEASE TileDB::tiledb_shared IMPORTED_LOCATION_RELEASE) - get_filename_component(TILEDB_RELEASE_BINARY_DIR ${TILEDB_IMPORTED_LOCATION_RELEASE} PATH) - message(STATUS "TILEDB_BINARY_DIR:${TILEDB_RELEASE_BINARY_DIR}") - #message(STATUS "TILEDB dependent:${TILEDB_IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE}") - #message(STATUS "TILEDB location release:${TILEDB_IMPORTED_LOCATION_RELEASE}") - #message(STATUS "TILEDB_RELEASE_BINARY_DIR:${TILEDB_RELEASE_BINARY_DIR}") - - file(GLOB TILEDB_BIN_FILES_AND_DIRS "${TILEDB_RELEASE_BINARY_DIR}/*") - -else() - message(STATUS "start to build tiledb from source") - FetchContent_Declare( - tiledb - GIT_REPOSITORY https://github.com/TileDB-Inc/TileDB.git - GIT_TAG ${TILEDB_GIT_TAG} - ) - FetchContent_GetProperties(tiledb) - if(NOT tiledb_POPULATED) - FetchContent_Populate(tiledb) - message(STATUS "tiledb_SOURCE_DIR:${tiledb_SOURCE_DIR}, cmake_generator:${CMAKE_GENERATOR}") - message(STATUS "tiledb_BINARY_DIR:${tiledb_BINARY_DIR}") - set(SUPERBUILD OFF) - message("start to build tiledb at ${tiledb_BINARY_DIR}, buildtype:${CMAKE_BUILD_TYPE}...") - if(WIN32) - execute_process( - COMMAND - "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" -A x64 - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DTILEDB_S3=${TILEDB_S3} - -DTILEDB_AZURE=${TILEDB_AZURE} - -DTILEDB_TESTS=OFF - -DTILEDB_WERROR=OFF - ${tiledb_SOURCE_DIR} - WORKING_DIRECTORY - ${tiledb_BINARY_DIR} - ) - else() - execute_process( - COMMAND - "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DTILEDB_S3=${TILEDB_S3} - -DTILEDB_AZURE=${TILEDB_AZURE} - -DTILEDB_TESTS=OFF - -DTILEDB_WERROR=OFF - ${tiledb_SOURCE_DIR} - WORKING_DIRECTORY - ${tiledb_BINARY_DIR} - ) - endif() - - message("start to build tiledb at ${tiledb_BINARY_DIR} ...") - execute_process( - COMMAND - "${CMAKE_COMMAND}" --build . --config Release - WORKING_DIRECTORY - ${tiledb_BINARY_DIR} - ) - - message("start to build install-tiledb at ${tiledb_BINARY_DIR} ...") - execute_process( - COMMAND - "${CMAKE_COMMAND}" --build . --target install-tiledb --config Release - WORKING_DIRECTORY - ${tiledb_BINARY_DIR} - ) - - endif() - - message("start to include TileDBConfig.cmake") - include( ${CMAKE_INSTALL_LIBDIR}/cmake/TileDB/TileDBConfig.cmake) - - file(GLOB TILEDB_BIN_FILES_AND_DIRS "${CMAKE_INSTALL_PREFIX}/bin/*") - -endif() - - -### copy files from /bin to /lib -foreach(item ${TILEDB_BIN_FILES_AND_DIRS}) - if(IS_DIRECTORY "${item}") - LIST(APPEND TILEDB_BIN_DIRS "${item}") - else() - LIST(APPEND TILEDB_BIN_FILES "${item}") - endif() -endforeach() - -message(STATUS "TILEDB install ${TILEDB_BIN_FILES} to lib directory:${CMAKE_INSTALL_BINDIR}") -install(FILES ${TILEDB_BIN_FILES} - DESTINATION ${CMAKE_INSTALL_LIBDIR} -) - -if(TILEDB_BIN_DIRS) - message(STATUS "TILEDB install ${TILEDB_BIN_DIRS} to lib directory:${CMAKE_INSTALL_BINDIR}") - install( DIRECTORY ${TILEDB_BIN_DIRS} - DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) -endif() From c14741d5189f725f03a4fd2e1ea52e334196284e Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 16 Nov 2022 12:15:49 +0200 Subject: [PATCH 11/25] Remove all CI jobs except of Run-Tests. Now that we don't use a nuspec to pack the C# library there are little reasons to specifically test it with a packed NuGet package. The Release job also went away; it would upload the 0.0.0-local package. We need a dedicated release workflow. --- .github/workflows/tiledb-csharp.yml | 92 +------------------ .../TileDB.CSharp.Test.NuGet.csproj | 18 ---- tests/TileDB.CSharp.Test.NuGet/nuget.config | 9 -- 3 files changed, 1 insertion(+), 118 deletions(-) delete mode 100644 tests/TileDB.CSharp.Test.NuGet/TileDB.CSharp.Test.NuGet.csproj delete mode 100644 tests/TileDB.CSharp.Test.NuGet/nuget.config diff --git a/.github/workflows/tiledb-csharp.yml b/.github/workflows/tiledb-csharp.yml index 5a9db62f..d5803d08 100644 --- a/.github/workflows/tiledb-csharp.yml +++ b/.github/workflows/tiledb-csharp.yml @@ -2,7 +2,6 @@ name: TileDB-CSharp on: push: - tags: [ '*' ] branches: [ main ] pull_request: branches: [ main ] @@ -36,7 +35,7 @@ jobs: # DotNet build - name: Dotnet build for TileDB.CSharp run: | - dotnet build /p:Platform=x64 -c Release sources/TileDB.CSharp + dotnet build -c Release sources/TileDB.CSharp # DotNet test - name: Test TileDB.CSharp @@ -47,92 +46,3 @@ jobs: shell: bash run: | find examples/ -name *.csproj | xargs -I{} dotnet run --project {} -f ${{ matrix.dotnet }} - - Stage-Release-Candidate: - needs: Run-Tests - runs-on: ubuntu-latest - steps: - # Checks out repository - - uses: actions/checkout@v3 - - - name: Set up .NET SDK from global.json - uses: actions/setup-dotnet@v3 - - - name: Display dotnet versions - run: dotnet --info - - # DotNet build - - name: Dotnet build for TileDB.CSharp - run: | - dotnet build /p:Platform=x64 -c Release sources/TileDB.CSharp - - # DotNet pack - - name: Dotnet pack for TileDB.CSharp - run: | - dotnet pack ./sources/TileDB.CSharp/TileDB.CSharp.csproj -p:Version=0.0.0-local -c Release - - - name: Archive nuget artifact - uses: actions/upload-artifact@v3 - with: - name: TileDB NuGet Package - path: sources/TileDB.CSharp/lib/TileDB.CSharp.*.nupkg - - Test-NuGet-Release: - needs: Stage-Release-Candidate - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - dotnet: ['net5.0', 'net6.0'] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout TileDB-CSharp repository - uses: actions/checkout@v3 - - - name: Download TileDB.CSharp NuGet artifact - uses: actions/download-artifact@v3 - with: - name: TileDB NuGet Package - path: packages - - # GitHub runners come with several versions of .NET preinstalled; Remove them to target version - - name: Remove existing .NET versions - shell: bash - run: | - rm -rf $DOTNET_ROOT - - - name: Set up .NET SDK from global.json - uses: actions/setup-dotnet@v3 - - - name: Display dotnet versions - run: dotnet --info - - - name: Setup NuGet - uses: nuget/setup-nuget@v1 - - # Run tests using NuGet release candidate - - name: Test TileDB.CSharp - run: | - dotnet test -c Release tests/TileDB.CSharp.Test.NuGet -f ${{ matrix.dotnet }} - - Release: - # Only run this job if a tag was provided - if: startsWith(github.ref, 'refs/tags/') - needs: Test-NuGet-Release - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v3 - with: - name: TileDB NuGet Package - - - name: Create Release - id: create_release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - files: ./*.nupkg - tag_name: ${{ github.ref_name }} - name: ${{ github.ref_name }} - body: ${{ steps.github_release.outputs.changelog }} - draft: false - prerelease: false diff --git a/tests/TileDB.CSharp.Test.NuGet/TileDB.CSharp.Test.NuGet.csproj b/tests/TileDB.CSharp.Test.NuGet/TileDB.CSharp.Test.NuGet.csproj deleted file mode 100644 index e05ae2b2..00000000 --- a/tests/TileDB.CSharp.Test.NuGet/TileDB.CSharp.Test.NuGet.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - false - enable - Major - TileDB.CSharp.Test - net5.0;net6.0 - - - - - - - - - - - diff --git a/tests/TileDB.CSharp.Test.NuGet/nuget.config b/tests/TileDB.CSharp.Test.NuGet/nuget.config deleted file mode 100644 index b16bbf21..00000000 --- a/tests/TileDB.CSharp.Test.NuGet/nuget.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - From 3c33ffe3f4aeea2a8aa2e95248257671e6d9f58f Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 16 Nov 2022 12:31:08 +0200 Subject: [PATCH 12/25] Remove RollForward from TileDB.CSharp. It does not apply to libraries. --- sources/TileDB.CSharp/TileDB.CSharp.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/TileDB.CSharp/TileDB.CSharp.csproj b/sources/TileDB.CSharp/TileDB.CSharp.csproj index dc0c2a54..409bb1a9 100644 --- a/sources/TileDB.CSharp/TileDB.CSharp.csproj +++ b/sources/TileDB.CSharp/TileDB.CSharp.csproj @@ -3,7 +3,6 @@ net5.0 true enable - Major TileDB.CSharp 5.3.0 TileDB Inc From e655b268f58dfd935eef744e0e5968bb7042e8cd Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 09:23:45 +0200 Subject: [PATCH 13/25] Update package metadata and move them to a dedicated file. I had originally removed the nuspec files from the native packages but changed my mind for aesthetic reasons since they generate an empty .NET Standard 2.0 dependency group. --- scripts/nuget/TileDB.Native.nuspec | 6 ++++-- scripts/nuget/TileDB.Native.runtime.template.nuspec | 2 +- sources/NuGet.props | 12 ++++++++++++ sources/TileDB.CSharp/TileDB.CSharp.csproj | 7 +------ 4 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 sources/NuGet.props diff --git a/scripts/nuget/TileDB.Native.nuspec b/scripts/nuget/TileDB.Native.nuspec index af379dd6..32543316 100644 --- a/scripts/nuget/TileDB.Native.nuspec +++ b/scripts/nuget/TileDB.Native.nuspec @@ -8,8 +8,10 @@ MIT logo.png https://tiledb.com/products/tiledb-embedded/ - - The TileDB Embedded library. This is a metapackage that will route to the appropriate native package based on the runtime identifier. + + The TileDB Embedded library. This is a metapackage that will route to the appropriate native package based on the runtime identifier. + +To do that you have to make an RID-specific build by setting the RuntimeIdentifier or the UseCurrentRuntimeIdentifier project properties, or by using the -r or -ucr .NET SDK command-line options. tiledb diff --git a/scripts/nuget/TileDB.Native.runtime.template.nuspec b/scripts/nuget/TileDB.Native.runtime.template.nuspec index baea163b..4b58573e 100644 --- a/scripts/nuget/TileDB.Native.runtime.template.nuspec +++ b/scripts/nuget/TileDB.Native.runtime.template.nuspec @@ -8,7 +8,7 @@ MIT logo.png https://tiledb.com/products/tiledb-embedded/ - + Native binaries of TileDB Embedded for $rid$. tiledb diff --git a/sources/NuGet.props b/sources/NuGet.props new file mode 100644 index 00000000..f947a0ec --- /dev/null +++ b/sources/NuGet.props @@ -0,0 +1,12 @@ + + + TileDB Inc + MIT + logo.png + https://tiledb.com/products/tiledb-embedded/ + tiledb + + + + + diff --git a/sources/TileDB.CSharp/TileDB.CSharp.csproj b/sources/TileDB.CSharp/TileDB.CSharp.csproj index 409bb1a9..47199c1e 100644 --- a/sources/TileDB.CSharp/TileDB.CSharp.csproj +++ b/sources/TileDB.CSharp/TileDB.CSharp.csproj @@ -1,16 +1,12 @@ + net5.0 true enable TileDB.CSharp 5.3.0 - TileDB Inc - MIT - logo.png - https://tiledb.com/products/tiledb-embedded/ C# wrapper of the TileDB Embedded universal data engine. - tiledb @@ -18,7 +14,6 @@ - From d0764a6b753d40822d690704e3aa1655b0cf5e4d Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 09:27:24 +0200 Subject: [PATCH 14/25] Add support for generating development editions of the native packages. They have SemVer 2.0 versions that identify the branch. --- scripts/nuget/GenerateNuGetPackages.proj | 26 +++++++++++++++---- scripts/nuget/TileDB.Native.nuspec | 2 +- scripts/nuget/TileDB.Native.proj | 2 +- .../TileDB.Native.runtime.template.nuspec | 2 +- .../nuget/TileDB.Native.runtime.template.proj | 2 +- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj index ead1fe1f..9cfc974e 100644 --- a/scripts/nuget/GenerateNuGetPackages.proj +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -1,7 +1,6 @@ 2.12.2 - 0.0.0-dev a9d60c8 ./temp ./packages @@ -10,6 +9,13 @@ ./TileDB.Native.runtime.template.proj + + 0.0.0-local+$(VersionTag) + + Local. + + @@ -20,9 +26,19 @@ + + + + + + + + Condition="$(DevelopmentBuild) != true"> https://github.com/TileDB-Inc/TileDB/releases/download/$(Version)/TileDB-%(NativePlatform.Identity)-$(Version)-$(VersionTag).%(NativePlatform.ArchiveExtension) $(TempDir)/%(NativePlatform.Identity) @@ -55,12 +71,12 @@ Projects="@(ProjectsToBuild)" BuildInParallel="true" Targets="Pack" - Properties="PackageOutputPath=$(OutDir);Version=$(Version)" /> + Properties="PackageIdPrefix=$(PackageIdPrefix);PackageOutputPath=$(OutDir);Version=$(Version)" /> - {"runtimes": {@(NativePlatform-> '"%(RuntimeId)":{"TileDB.Native":{"TileDB.Native.runtime.%(RuntimeId)":"$(Version)"}}')}} + {"runtimes": {@(NativePlatform-> '"%(RuntimeId)":{"$(PackageIdPrefix)TileDB.Native":{"$(PackageIdPrefix)TileDB.Native.runtime.%(RuntimeId)":"$(Version)"}}')}} $(RuntimeJsonPayload.Replace(';',',')) + Properties="PackageIdPrefix=$(PackageIdPrefix);PackageOutputPath=$(OutDir);Version=$(Version)" /> - TileDB.Native + $idPrefix$TileDB.Native $version$ TileDB Inc false diff --git a/scripts/nuget/TileDB.Native.proj b/scripts/nuget/TileDB.Native.proj index 62d5e122..4024361a 100644 --- a/scripts/nuget/TileDB.Native.proj +++ b/scripts/nuget/TileDB.Native.proj @@ -5,6 +5,6 @@ true netstandard2.0 TileDB.Native.nuspec - version=$(Version) + idPrefix=$(PackageIdPrefix);version=$(Version) diff --git a/scripts/nuget/TileDB.Native.runtime.template.nuspec b/scripts/nuget/TileDB.Native.runtime.template.nuspec index 4b58573e..19eac00f 100644 --- a/scripts/nuget/TileDB.Native.runtime.template.nuspec +++ b/scripts/nuget/TileDB.Native.runtime.template.nuspec @@ -1,7 +1,7 @@ - TileDB.Native.runtime.$rid$ + $idPrefix$TileDB.Native.runtime.$rid$ $version$ TileDB Inc false diff --git a/scripts/nuget/TileDB.Native.runtime.template.proj b/scripts/nuget/TileDB.Native.runtime.template.proj index 4bef0039..5684114f 100644 --- a/scripts/nuget/TileDB.Native.runtime.template.proj +++ b/scripts/nuget/TileDB.Native.runtime.template.proj @@ -5,6 +5,6 @@ true netstandard2.0 TileDB.Native.runtime.template.nuspec - rid=$(RuntimeId);version=$(Version);nativelib=$(NativeLibraryPath) + idPrefix=$(PackageIdPrefix);rid=$(RuntimeId);version=$(Version);nativelib=$(NativeLibraryPath) From 4d853907884f61a037a67221478399d92aa54bf4 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 14:29:23 +0200 Subject: [PATCH 15/25] Enable Central Package Management with package source mapping. And support changing the native package under a different name in development builds. --- .github/workflows/nightly.yml | 3 ++ Directory.Build.props | 3 -- Directory.Packages.props | 30 +++++++++++++++++++ nuget.config | 14 ++++++++- sources/TileDB.CSharp/TileDB.CSharp.csproj | 3 +- .../TileDB.CSharp.Test.csproj | 8 ++--- 6 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 Directory.Packages.props diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 79d03471..a2309c2e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,5 +1,8 @@ name: Nightly-Build +env: + TILEDB_NIGHTLY_BUILD: 1 + on: schedule: - cron: "15 2 * * *" diff --git a/Directory.Build.props b/Directory.Build.props index 1391ea2a..586c5e29 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,4 @@ latest - - - diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..2dc5dae9 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,30 @@ + + + true + TileDB.Native + 2.12.2 + + + true + + + + + + Local.$(TileDBNativePackageName) + [0.0.0-local] + + + + + + + + + + diff --git a/nuget.config b/nuget.config index 384bbcc8..ad9fcb3d 100644 --- a/nuget.config +++ b/nuget.config @@ -5,7 +5,19 @@ - + + + + + + + + + + + + + diff --git a/sources/TileDB.CSharp/TileDB.CSharp.csproj b/sources/TileDB.CSharp/TileDB.CSharp.csproj index 47199c1e..7593c1ad 100644 --- a/sources/TileDB.CSharp/TileDB.CSharp.csproj +++ b/sources/TileDB.CSharp/TileDB.CSharp.csproj @@ -2,6 +2,7 @@ net5.0 + false true enable TileDB.CSharp @@ -14,6 +15,6 @@ - + diff --git a/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj b/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj index c521cc53..a0ccd8d6 100644 --- a/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj +++ b/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj @@ -9,10 +9,10 @@ - - - - + + + + From f848e0923517408bf1bbc32c7a181587d99c4530 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 13:29:35 +0200 Subject: [PATCH 16/25] Add release notes in the packages. --- scripts/nuget/TileDB.Native.nuspec | 1 + scripts/nuget/TileDB.Native.runtime.template.nuspec | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/nuget/TileDB.Native.nuspec b/scripts/nuget/TileDB.Native.nuspec index 5563bd67..c6cae9bb 100644 --- a/scripts/nuget/TileDB.Native.nuspec +++ b/scripts/nuget/TileDB.Native.nuspec @@ -12,6 +12,7 @@ The TileDB Embedded library. This is a metapackage that will route to the appropriate native package based on the runtime identifier. To do that you have to make an RID-specific build by setting the RuntimeIdentifier or the UseCurrentRuntimeIdentifier project properties, or by using the -r or -ucr .NET SDK command-line options. + https://github.com/TileDB-Inc/TileDB/releases tiledb diff --git a/scripts/nuget/TileDB.Native.runtime.template.nuspec b/scripts/nuget/TileDB.Native.runtime.template.nuspec index 19eac00f..2c4a4760 100644 --- a/scripts/nuget/TileDB.Native.runtime.template.nuspec +++ b/scripts/nuget/TileDB.Native.runtime.template.nuspec @@ -10,6 +10,7 @@ https://tiledb.com/products/tiledb-embedded/ Native binaries of TileDB Embedded for $rid$. + https://github.com/TileDB-Inc/TileDB/releases tiledb From 88697495a94021b4cfbb3c5695cf7cf6a97de388 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 15:25:10 +0200 Subject: [PATCH 17/25] Refactor the nightly build workflow to use native development NuGet packages. The core is built in separate jobs and not once for each .NET version. --- .github/workflows/nightly.yml | 126 ++++++++++++++++++++++------------ 1 file changed, 84 insertions(+), 42 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a2309c2e..7c0ecbdf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -9,85 +9,127 @@ on: workflow_dispatch: jobs: - Build: + Build-Native: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] include: - - os: ubuntu-22.04 - HOST: linux - BOOTSTRAP: ../bootstrap --enable-s3 --enable-serialization + - BOOTSTRAP: ../bootstrap --enable-s3 --enable-serialization - os: ubuntu-latest - HOST: linux - BOOTSTRAP: ../bootstrap --enable-s3 --enable-serialization + platform: linux-x86_64 - os: macos-latest - HOST: osx - BOOTSTRAP: ../bootstrap --enable-s3 --enable-serialization + platform: macos-x86_64 - os: windows-latest - HOST: win + platform: windows-x86_64 BOOTSTRAP: ../bootstrap.ps1 -EnableS3 -EnableSerialization tag: [release-2.12, dev] - dotnet: ['net5.0', 'net6.0'] runs-on: ${{ matrix.os }} - steps: - - name: Checkout TileDB-CSharp - uses: actions/checkout@v3 - with: - path: tiledb-csharp - - name: Checkout TileDB uses: actions/checkout@v3 with: repository: TileDB-Inc/TileDB ref: ${{ matrix.tag }} - path: tiledb + + - name: Build TileDB + run: | + mkdir -p build + cd build + ${{ matrix.BOOTSTRAP }} + cmake --build . --config Release + cmake --build . --config Release --target install-tiledb + cd ../ + mkdir -p artifacts/${{ matrix.platform }} + mv dist/* artifacts/${{ matrix.platform }} + + # We combine the binaries of the many platforms per tag by uploading them to the same artifact. + - name: Upload native artifacts + uses: actions/upload-artifact@v3 + with: + name: tiledb-native-${{ matrix.tag }} + path: artifacts/ + + Pack-NuGet: + needs: Build-Native + strategy: + fail-fast: false + matrix: + tag: [release-2.12, dev] + runs-on: ubuntu-latest + steps: + - name: Checkout TileDB-CSharp + uses: actions/checkout@v3 # GitHub runners come with several versions of .NET preinstalled; Remove them to target version - name: Remove existing .NET versions shell: bash - run: | - rm -rf $DOTNET_ROOT + run: rm -rf $DOTNET_ROOT - name: Set up .NET SDK from global.json uses: actions/setup-dotnet@v3 - with: - global-json-file: tiledb-csharp/global.json - name: Display dotnet versions run: dotnet --info - - name: Build TileDB - run: | - mkdir -p tiledb/build - cd tiledb/build - ${{ matrix.BOOTSTRAP }} - cmake --build . --config Release - cmake --build . --config Release --target install-tiledb - cd ../../ - cp -r tiledb/dist/lib/* tiledb-csharp/sources/TileDB.CSharp/runtimes/${{ matrix.HOST }}-x64/native/ + - name: Download native artifacts + uses: actions/download-artifact@v3 + with: + name: tiledb-native-${{ matrix.tag }} + path: scripts/nuget/temp - - name: Copy Windows tiledb.dll - if: matrix.HOST == 'win' - run: | - cp tiledb/dist/bin/tiledb.dll tiledb-csharp/sources/TileDB.CSharp/runtimes/${{ matrix.HOST }}-x64/native/ + - name: Build native NuGet packages + shell: bash + run: dotnet pack ./scripts/nuget/GenerateNuGetPackages.proj -p:DevelopmentBuild=true -p:VersionTag=${{ matrix.tag }} + + - name: Upload native NuGet packages + uses: actions/upload-artifact@v3 + with: + name: tiledb-nuget-${{ matrix.tag }} + path: scripts/nuget/packages/ + + Test-NuGet: + needs: Pack-NuGet + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest] + tag: [release-2.12, dev] + dotnet: ['net5.0', 'net6.0'] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout TileDB-CSharp + uses: actions/checkout@v3 + + # GitHub runners come with several versions of .NET preinstalled; Remove them to target version + - name: Remove existing .NET versions + shell: bash + run: rm -rf $DOTNET_ROOT + + - name: Set up .NET SDK from global.json + uses: actions/setup-dotnet@v3 + + - name: Display dotnet versions + run: dotnet --info + + - name: Download native NuGet packages + uses: actions/download-artifact@v3 + with: + name: tiledb-nuget-${{ matrix.tag }} + path: packages - name: Build TileDB-CSharp - run: | - dotnet build tiledb-csharp/sources/TileDB.CSharp/TileDB.CSharp.csproj /p:Platform=x64 -c Release + run: dotnet build sources/TileDB.CSharp/TileDB.CSharp.csproj -c Release - name: Test TileDB-CSharp - run: | - dotnet test tiledb-csharp/tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj -c Release -f ${{ matrix.dotnet }} + run: dotnet test tests/TileDB.CSharp.Test/TileDB.CSharp.Test.csproj -c Release -f ${{ matrix.dotnet }} - name: Run examples shell: bash - run: | - find tiledb-csharp/examples/ -name *.csproj -execdir dotnet run \; + run: find examples/ -name *.csproj | xargs -I{} dotnet run --project {} -f ${{ matrix.dotnet }} Create-Issue: - needs: Build + needs: Test-NuGet if: failure() runs-on: ubuntu-latest steps: From fffdd3c628c808570729812529542ecdee274de7 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 12:50:50 +0200 Subject: [PATCH 18/25] Update the repository README and add a package README. --- README.md | 32 ++++++++------- sources/TileDB.CSharp/README.md | 46 ++++++++++++++++++++++ sources/TileDB.CSharp/TileDB.CSharp.csproj | 2 + 3 files changed, 65 insertions(+), 15 deletions(-) create mode 100644 sources/TileDB.CSharp/README.md diff --git a/README.md b/README.md index 6f7539f3..800364bc 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,29 @@ -TileDB-CSharp +![Licensed under the MIT License](https://img.shields.io/github/license/TileDB-Inc/TileDB-CSharp.svg) +[![NuGet](https://img.shields.io/nuget/v/TileDB.CSharp.svg)](https://nuget.org/packages/TileDB.CSharp) +[![Test](https://github.com/TileDB-Inc/TileDB-CSharp/actions/workflows/tiledb-csharp.yml/badge.svg?branch=main&event=push)](https://github.com/TileDB-Inc/TileDB-CSharp/actions/workflows/tiledb-csharp.yml) -# Build -## Download or build tiledb core library +# TileDB-CSharp -```bash -cd cpp -mkdir build && cd build -cmake .. -cmake --build . --target install -``` -## Build TileDB.CSharp +This repository contains the official C# bindings of the [TileDB Embedded](https://tiledb.com/products/tiledb-embedded) storage engine. See more information in [the README of the library project](sources/TileDB.CSharp/README.md). + +## Install + +The library is available on [NuGet](https://nuget.org/packages/TileDB.CSharp). + +## Build ```bash cd sources/TileDB.CSharp -dotnet build /p:Platform=x64 -c Release +dotnet build -c Release ``` -## Test TileDB.CSharp + +## Test ```bash cd tests/TileDB.CSharp.Test dotnet test -c Release ``` -# Old version -The SWIG-based 2.x version of this codebase is available in the -[archive](https://github.com/TileDB-Inc/TileDB-CSharp/tree/archive) branch. +## Old version + +The SWIG-based 2.x version of this codebase is available in the [`archive`](https://github.com/TileDB-Inc/TileDB-CSharp/tree/archive) branch. diff --git a/sources/TileDB.CSharp/README.md b/sources/TileDB.CSharp/README.md new file mode 100644 index 00000000..21bf5737 --- /dev/null +++ b/sources/TileDB.CSharp/README.md @@ -0,0 +1,46 @@ +# TileDB.CSharp + +This package provides a C# interface to the [TileDB Embedded](https://tiledb.com/products/tiledb-embedded) storage engine. + +## Usage + +After installing the package, see [the official documentation](https://docs.tiledb.com/main/) and [the C# example project](https://github.com/TileDB-Inc/TileDB-CSharp/tree/main/examples/TileDB.CSharp.Example) to learn how to use it. + +### Resolving `DllNotFoundException`s + +For space reasons the TileDB Embedded native library is downloaded only on [RID](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog)-specific builds. If you are getting `DllNotFoundException`s that the library `tiledb` is not found, you have to specify an RID. There are many ways to do it: + +* + __From the project file:__ + + Add one of the following properties to your project: + + ```xml + + + win-x64 + + win-x64;linux-x64 + + true + + ``` + +* + __From the .NET CLI:__ + + When building or publishing a project you can to specify the `-r ` option to provide an RID, or the `--use-current-runtime true` option to use the RID of the building machine. + +> Consult the .NET documentation for more info. + +The supported RIDs are: + +* `win-x64` +* `linux-x64` +* `osx-x64` +* `osx-arm64` + +### Updating TileDB Embedded + +TileDB Embedded is distributed in a separate NuGet package from the C# interface, which means that you can use a newer version of it by updating the `TileDB.Native` package in your project. diff --git a/sources/TileDB.CSharp/TileDB.CSharp.csproj b/sources/TileDB.CSharp/TileDB.CSharp.csproj index 7593c1ad..abc92d3e 100644 --- a/sources/TileDB.CSharp/TileDB.CSharp.csproj +++ b/sources/TileDB.CSharp/TileDB.CSharp.csproj @@ -8,6 +8,7 @@ TileDB.CSharp 5.3.0 C# wrapper of the TileDB Embedded universal data engine. + README.md @@ -15,6 +16,7 @@ + From 4f3601fd8407f90beb620c9d0d91e24402cb745c Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 14:40:30 +0200 Subject: [PATCH 19/25] Require `Version` and `VersionTag` to be specified. Make the version tag optional for development builds. And fail if no native binaries were found in development builds. --- scripts/nuget/GenerateNuGetPackages.proj | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj index 9cfc974e..9a3e79e1 100644 --- a/scripts/nuget/GenerateNuGetPackages.proj +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -1,7 +1,5 @@ - + - 2.12.2 - a9d60c8 ./temp ./packages $(TempDir)/runtime.json @@ -10,7 +8,8 @@ - 0.0.0-local+$(VersionTag) + 0.0.0-local + $(Version)+$(VersionTag) Local. @@ -34,11 +33,19 @@ + + + + https://github.com/TileDB-Inc/TileDB/releases/download/$(Version)/TileDB-%(NativePlatform.Identity)-$(Version)-$(VersionTag).%(NativePlatform.ArchiveExtension) $(TempDir)/%(NativePlatform.Identity) From f787a3c5c44d5aaff3b94421e08186bbb28ac421 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 17 Nov 2022 14:41:04 +0200 Subject: [PATCH 20/25] Add a README describing the native NuGet package generator. --- scripts/nuget/README.md | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 scripts/nuget/README.md diff --git a/scripts/nuget/README.md b/scripts/nuget/README.md new file mode 100644 index 00000000..74d46324 --- /dev/null +++ b/scripts/nuget/README.md @@ -0,0 +1,44 @@ +# TileDB native NuGet package generator + +This directory contains a script that: + +* Downloads the Core binaries from GitHub Releases. +* Creates one NuGet package for each supported platform. +* Creates one NuGet metapackage that routes to the packages above according to the platform. + +The script's source is in `GenerateNuGetPackages.proj`. The other files specify the properties of the packages. + +## Usage + +``` +dotnet pack ./GenerateNuGetPackages.proj -p:Version= -p:VersionTag= +``` + +> `version-tag` is the seven-character commit hash of the release. + +The packages will be written in the `packages` subdirectory. You can change the output path with the `-p:OutDir=` option. + +The script is incremental, which means that it will try to avoid doing work that is already done. To be extra sure that no stale data is being used, run `dotnet clean` before packing. + +## Supporting new platforms + +At the beginning of the file there is an `ItemGroup` that specifies `NativePlatform` items. To add support for a new platform you have to add a new item to this group. These are the metadata you have to define: + +|Name|Value| +|----|-----| +|`Include` (referred in the script as `Identity`; technically not part of metadata)|The platform's name as written in the GitHub Releases.| +|`RuntimeId`|The platform's [.NET Runtime Identifier](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog).| +|`LibraryPath`|The native library's path, relative from the downloaded GitHub Releases artifact.| +|`ArchiveExtension`|The artifact archive's extension, without the leading dot. Optional, defaults to `tar.gz`.| + +## Development packages + +The script also supports generating development editions of the packages. This is used in nightly builds to allow testing with the binaries built from the `dev` and `release` branches. They have `Local.` prepended to their ID and their version is always `0.0.0-local+`. The build metadata that come after the `+` are used for informative purposes and are not a required part of the package's version. + +Grabbing the development packages from the nightly build's artifacts is preferred over manually creating them, but if you want to (for example to test Core binaries from a different branch), you can follow these steps: + +1. Build the Core. +2. Copy the Core's `dist` folder to the `temp` subdirectory of this repository, renaming it to the _GitHub Releases_ name of the platform. +3. Run `dotnet pack -p:DevelopmentBuild=true -p:VersionTag=`. `VersionTag` is optional. + +When building development packages you don't have to include the artifacts for all platforms; the script will skip those whose artifacts do not exist. From abf06035430bb7c28dc919af1251681083f49a86 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 23 Nov 2022 13:19:18 +0200 Subject: [PATCH 21/25] Demand Core version 2.12.x. --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2dc5dae9..ab1fa8c5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,7 +2,7 @@ true TileDB.Native - 2.12.2 + [2.12.2,2.13.0) win-x64 - - win-x64;linux-x64 - + true ``` @@ -30,17 +26,17 @@ For space reasons the TileDB Embedded native library is downloaded only on [RID] * __From the .NET CLI:__ - When building or publishing a project you can to specify the `-r ` option to provide an RID, or the `--use-current-runtime true` option to use the RID of the building machine. + When building or publishing a project you can specify the `-r ` option to provide an RID. -> Consult the .NET documentation for more info. +> Consult the .NET documentation for more information. -The supported RIDs are: +Native binaries are provided for the following RIDs, and all that derive from them such as `win10-x64` or `ubuntu-x64`: * `win-x64` * `linux-x64` * `osx-x64` * `osx-arm64` -### Updating TileDB Embedded +### Patching TileDB Embedded -TileDB Embedded is distributed in a separate NuGet package from the C# interface, which means that you can use a newer version of it by updating the `TileDB.Native` package in your project. +You can update to a newer patch version of TileDB Embedded by explicitly specifying a version of the [`TileDB.Native`](https://nuget.org/packages/TIleDB.Native) package in your project. diff --git a/sources/TileDB.CSharp/TileDB.CSharp.csproj b/sources/TileDB.CSharp/TileDB.CSharp.csproj index abc92d3e..82b79f5b 100644 --- a/sources/TileDB.CSharp/TileDB.CSharp.csproj +++ b/sources/TileDB.CSharp/TileDB.CSharp.csproj @@ -17,6 +17,8 @@ + + diff --git a/sources/TileDB.CSharp/build/TileDB.CSharp.targets b/sources/TileDB.CSharp/build/TileDB.CSharp.targets new file mode 100644 index 00000000..8d66cf70 --- /dev/null +++ b/sources/TileDB.CSharp/build/TileDB.CSharp.targets @@ -0,0 +1,7 @@ + + + + + diff --git a/sources/TileDB.CSharp/buildTransitive/TileDB.CSharp.targets b/sources/TileDB.CSharp/buildTransitive/TileDB.CSharp.targets new file mode 100644 index 00000000..19ca85dc --- /dev/null +++ b/sources/TileDB.CSharp/buildTransitive/TileDB.CSharp.targets @@ -0,0 +1,3 @@ + + + From ec1ddab80eb22863841d0833ee1e4562af86e5df Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 24 Nov 2022 17:11:04 +0200 Subject: [PATCH 23/25] Remove the RID-specific build instructions in the metapackage's description. This package is not intended to be directly referenced by the average developer, at least not without `TileDB.CSharp`. --- scripts/nuget/TileDB.Native.nuspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/nuget/TileDB.Native.nuspec b/scripts/nuget/TileDB.Native.nuspec index c6cae9bb..6b790973 100644 --- a/scripts/nuget/TileDB.Native.nuspec +++ b/scripts/nuget/TileDB.Native.nuspec @@ -9,9 +9,7 @@ logo.png https://tiledb.com/products/tiledb-embedded/ - The TileDB Embedded library. This is a metapackage that will route to the appropriate native package based on the runtime identifier. - -To do that you have to make an RID-specific build by setting the RuntimeIdentifier or the UseCurrentRuntimeIdentifier project properties, or by using the -r or -ucr .NET SDK command-line options. + The TileDB Embedded library. This is a metapackage that will route to the appropriate native package based on the runtime identifier. https://github.com/TileDB-Inc/TileDB/releases tiledb From 24b425d68e988545a748dc67616c08f7e7f36eff Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 1 Dec 2022 10:23:06 +0200 Subject: [PATCH 24/25] Remove the MyGet feed; we are now using the official TileDB binaries from NuGet. --- nuget.config | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nuget.config b/nuget.config index ad9fcb3d..d5049088 100644 --- a/nuget.config +++ b/nuget.config @@ -6,16 +6,12 @@ - - - - From dd9213ae8fefa930bb9fff8e906305c0a119f6c4 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 1 Dec 2022 11:54:55 +0200 Subject: [PATCH 25/25] Use MSBuild's custom item separator feature instead of a `string.Replace` hack. --- scripts/nuget/GenerateNuGetPackages.proj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/nuget/GenerateNuGetPackages.proj b/scripts/nuget/GenerateNuGetPackages.proj index 9a3e79e1..f06b65cb 100644 --- a/scripts/nuget/GenerateNuGetPackages.proj +++ b/scripts/nuget/GenerateNuGetPackages.proj @@ -83,8 +83,7 @@ - {"runtimes": {@(NativePlatform-> '"%(RuntimeId)":{"$(PackageIdPrefix)TileDB.Native":{"$(PackageIdPrefix)TileDB.Native.runtime.%(RuntimeId)":"$(Version)"}}')}} - $(RuntimeJsonPayload.Replace(';',',')) + {"runtimes": {@(NativePlatform-> '"%(RuntimeId)":{"$(PackageIdPrefix)TileDB.Native":{"$(PackageIdPrefix)TileDB.Native.runtime.%(RuntimeId)":"$(Version)"}}', ',')}}