-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify TileDB installation scripts and cache outputs.
This change unifies the build scripts between Mac OS and Linux, and caches build outputs. This means that future builds of the same version don’t need to rerun the entire build process; they can use the previously-built version. We do a few things to accomplish this: - Move compilation/installation into the `~/tiledb-core/install` directory. This allows us to cache it. - Set appropriate `CGO_*FLAGS` variables to point to that directory. This includes the `rpath` directive, which embeds the full path to the dynamic library in the binary, so it knows it needs to look in `~/tiledb-core/install/lib` for `libtiledb.so`. - Matrixes things out to reduce repetition.
- Loading branch information
1 parent
95977bb
commit 524675b
Showing
10 changed files
with
157 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Subroutine to set up environment variables. | ||
|
||
CORE_ROOT="$HOME/tiledb-core" | ||
|
||
case "$(uname -s)" in | ||
Linux) | ||
OS="linux" | ||
;; | ||
Darwin) | ||
OS="macos" | ||
;; | ||
*) | ||
echo 'Unknown OS!' | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
. "${BASH_SOURCE%/*}/env.sh" | ||
mkdir "$CORE_ROOT" | ||
cd "$CORE_ROOT" | ||
mkdir install | ||
curl --location -o tiledb.tar.gz "https://github.com/TileDB-Inc/TileDB/releases/download/${CORE_VERSION}/tiledb-${OS}-x86_64-${CORE_VERSION}-${CORE_HASH}.tar.gz" | ||
tar -C ./install -xf tiledb.tar.gz |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
. "${BASH_SOURCE%/*}/env.sh" | ||
mkdir "$CORE_ROOT" | ||
cd "$CORE_ROOT" | ||
case "$OS" in | ||
linux) | ||
NPROC="$(nproc)" | ||
;; | ||
macos) | ||
NPROC="$(sysctl -n hw.ncpu)" | ||
;; | ||
esac | ||
git clone --depth 1 -b "$CORE_VERSION" https://github.com/TileDB-Inc/TileDB.git | ||
cd TileDB | ||
mkdir build | ||
cd build | ||
# BUILD_FLAGS is unquoted because it needs to expand into multiple strings. | ||
cmake $BUILD_FLAGS -DCMAKE_INSTALL_PREFIX="${CORE_ROOT}/install" .. | ||
make -j"$NPROC" | ||
|
||
mkdir "${CORE_ROOT}/install" | ||
make -C tiledb install |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
. "${BASH_SOURCE%/*}/env.sh" | ||
|
||
# Sets up the environment after installing or extracting TileDB. | ||
|
||
if [ "$OS" = "linux" ]; then | ||
/sbin/ldconfig -n "${CORE_ROOT}/install/lib" | ||
fi | ||
|
||
go env -w "CGO_CFLAGS=-I${CORE_ROOT}/install/include" | ||
go env -w "CGO_LDFLAGS=-L${CORE_ROOT}/install/lib/ -Wl,-rpath,${CORE_ROOT}/install/lib/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters