Skip to content

Commit

Permalink
Build mac release for a lower mac version
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-alexandrov committed Jul 15, 2024
1 parent c7a4dbb commit 1e752ae
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 34 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/build_isis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,31 @@ else
fi

# Fetch the ASP depenedencies. Must keep $tag in sync with build_test.sh.
tag=mac_conda_env7
tag=mac_conda_env8
wget https://github.com/NeoGeographyToolkit/BinaryBuilder/releases/download/${tag}/asp_deps.tar.gz > /dev/null 2>&1 # this is verbose
/usr/bin/time tar xzf asp_deps.tar.gz -C / > /dev/null 2>&1 # this is verbose

# Build ale. It is assumed the compiler is set up as above.
# Build ale. It is assumed the compiler is set up as above. May need to save the
# curent ~/.ssh/id_rsa.pub key to Github in the user settings for recursive
# cloning of the submodules to work.
cd
git clone https://github.com/DOI-USGS/ale.git --recursive
cd ale
git submodule update --recursive # if refreshing the repo later
git rebase origin/main
#git rebase origin/main
git reset --hard 0ba7b24
export PREFIX=$HOME/miniconda3/envs/asp_deps
export PATH=$PREFIX/bin:$PATH
mkdir -p build && cd build
cmake .. \
-DCMAKE_C_COMPILER=${PREFIX}/bin/$cc_comp \
-DCMAKE_CXX_COMPILER=${PREFIX}/bin/$cxx_comp \
-DALE_USE_EXTERNAL_EIGEN=ON \
-DALE_USE_EXTERNAL_JSON=ON \
-DALE_BUILD_DOCS=OFF \
-DALE_BUILD_TESTS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
cmake .. \
-DCMAKE_C_COMPILER=${PREFIX}/bin/$cc_comp \
-DCMAKE_CXX_COMPILER=${PREFIX}/bin/$cxx_comp \
-DALE_USE_EXTERNAL_EIGEN=ON \
-DCMAKE_CXX_FLAGS='-mmacosx-version-min=10.10' \
-DALE_USE_EXTERNAL_JSON=ON \
-DALE_BUILD_DOCS=OFF \
-DALE_BUILD_TESTS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DCMAKE_INSTALL_PREFIX=${PREFIX}
make -j 20 install

Expand All @@ -50,20 +54,25 @@ cd
git clone https://github.com/DOI-USGS/usgscsm.git --recursive
cd usgscsm
git submodule update --recursive # if refreshing the repo later
git rebase origin/main
#git rebase origin/main
git reset --hard 568ea46
mkdir -p build && cd build
export PREFIX=$HOME/miniconda3/envs/asp_deps
export PATH=$PREFIX/bin:$PATH
cmake .. \
-DCMAKE_C_COMPILER=${PREFIX}/bin/$cc_comp \
-DCMAKE_CXX_COMPILER=${PREFIX}/bin/$cxx_comp \
-DUSGSCSM_EXTERNAL_DEPS=ON \
-DUSGSCSM_BUILD_DOCS=OFF \
-DUSGSCSM_BUILD_TESTS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
cmake .. \
-DCMAKE_C_COMPILER=${PREFIX}/bin/$cc_comp \
-DCMAKE_CXX_COMPILER=${PREFIX}/bin/$cxx_comp \
-DCMAKE_CXX_FLAGS='-mmacosx-version-min=10.10' \
-DUSGSCSM_EXTERNAL_DEPS=ON \
-DUSGSCSM_BUILD_DOCS=OFF \
-DUSGSCSM_BUILD_TESTS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DCMAKE_INSTALL_PREFIX=${PREFIX}
make -j 20 install

# Stop here this time. Other dependencies have been built.
exit 0

# Build ISIS3
cd
git clone https://github.com/DOI-USGS/ISIS3.git
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/build_test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/bash

# Fetch the ASP depenedencies
tag=mac_conda_env7
tag=mac_conda_env8
wget https://github.com/NeoGeographyToolkit/BinaryBuilder/releases/download/${tag}/asp_deps.tar.gz > /dev/null 2>&1 # this is verbose
/usr/bin/time tar xzf asp_deps.tar.gz -C / > /dev/null 2>&1 # this is verbose

# Note: The ASP dependencies at the location above are updated using
# the script save_mac_deps.sh. See that script for how to do the preparations.
# Here is how the script is called::
# tag=mac_conda_env7 # must match the tag above, and also in build_isis.sh
# The ASP dependencies at the location above are updated using the script
# save_mac_deps.sh. See that script for how to do the preparations.
# Here is how the script is called, from a local machine (which need not be a Mac).
# The tag set here must match the tag above, and also in build_isis.sh.
# If changing here, must later change in the other places.
# tag=mac_conda_env8
# workflow="ssh.yml" # manual workflow
# #workflow="build_isis.yml" # automatic workflow
# $HOME/projects/StereoPipeline/.github/workflows/save_mac_deps.sh $workflow $tag
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/save_mac_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ans=$($gh run list -R $repo --workflow=${workflow} | grep -v STATUS | head -n 1)
completed=$(echo $ans | awk '{print $1}')
success=$(echo $ans | awk '{print $2}')
id=$(echo $ans | awk '{print $7}')
echo Completed is $completed
echo Success is $success
echo Stage: $completed
echo Status: $success
echo Id is $id
if [ "$success" != "success" ]; then
echo "Error: The ${workflow} workflow did not succeed"
Expand All @@ -65,7 +65,12 @@ fi
# Can use a new tag here, or overwrite the existing tarball
# If making a new one, must make sure to update the tag in build_test.sh and build_isis.sh
repo=git@github.com:NeoGeographyToolkit/BinaryBuilder.git
# Wipe old version
$gh release -R $repo delete $tag

# Wipe any old version
echo If present, deleting the old release for tag: $tag
$gh release -R $repo delete $tag 2>/dev/null # hide any error message for missing release

# Upload the new version
notes="$tag"
echo Uploading a new version for tag: $tag
/usr/bin/time $gh release -R $repo create $tag $binaries --title $tag --notes "$notes"
13 changes: 7 additions & 6 deletions .github/workflows/ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ jobs:
build:
runs-on: macos-13
steps:
# Fetch miniconda
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
activate-environment: ""
# Fetch the code
- uses: actions/checkout@v3
# No caching of dependencies, as the cache does not change when it is
# modified, and it can expire. See build_test.sh how to fetch an
# offline tarball with dependencies, and how to update that one if need
# be.
# modified, and it can expire. See build_test.sh how to fetch an offline
# tarball with dependencies, and how to update that one if need be.
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3 # disconnects after about 40 minutes
#uses: owenthereal/action-upterm@v1 # disconnects after 30 minutes
timeout-minutes: 600
with:
limit-access-to-actor: true
# Upload the artifacts in the directory below. Useful for saving any results
# produced in this session. Can be later downloaded manually and saved to a
# permanent location.
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
# Useful for saving any results produced in this session. Can be later
# downloaded.
name: ASP-dependencies-${{ runner.os }}
path: ~/work/StereoPipeline/packages
retention-days: 2
Expand Down

0 comments on commit 1e752ae

Please sign in to comment.