From 1e752ae559153c5c9fd24d93e4c67bc7d9327174 Mon Sep 17 00:00:00 2001 From: Oleg Alexandrov Date: Mon, 15 Jul 2024 10:50:24 -0700 Subject: [PATCH] Build mac release for a lower mac version --- .github/workflows/build_isis.sh | 47 ++++++++++++++++++------------ .github/workflows/build_test.sh | 12 ++++---- .github/workflows/save_mac_deps.sh | 13 ++++++--- .github/workflows/ssh.yml | 13 +++++---- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build_isis.sh b/.github/workflows/build_isis.sh index 38a0ca333..09fa850c6 100755 --- a/.github/workflows/build_isis.sh +++ b/.github/workflows/build_isis.sh @@ -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 @@ -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 diff --git a/.github/workflows/build_test.sh b/.github/workflows/build_test.sh index 9340e654f..27a63bcb4 100755 --- a/.github/workflows/build_test.sh +++ b/.github/workflows/build_test.sh @@ -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 diff --git a/.github/workflows/save_mac_deps.sh b/.github/workflows/save_mac_deps.sh index 149b9728c..f0515a6da 100755 --- a/.github/workflows/save_mac_deps.sh +++ b/.github/workflows/save_mac_deps.sh @@ -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" @@ -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" diff --git a/.github/workflows/ssh.yml b/.github/workflows/ssh.yml index 23f1d491f..f14d6fd92 100644 --- a/.github/workflows/ssh.yml +++ b/.github/workflows/ssh.yml @@ -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