Skip to content

Commit

Permalink
Include Google Colab installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Pechnikov committed Aug 2, 2024
1 parent b5c58d6 commit 2ce790a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions pygmtsar/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include pygmtsar/data/geoid_egm96_icgem.grd
include pygmtsar/data/google_colab.sh
30 changes: 30 additions & 0 deletions pygmtsar/pygmtsar/data/google_colab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

# Install GMTSAR if needed
count=$(ls /usr/local | grep -c GMTSAR)
if [ "$count" -eq 0 ]; then
export DEBIAN_FRONTEND=noninteractive
apt-get update > /dev/null
apt install -y csh autoconf gfortran \
libtiff5-dev libhdf5-dev liblapack-dev libgmt-dev gmt > /dev/null
# GMTSAR codes are not so good to be compiled by modern GCC
apt install gcc-9 > /dev/null
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10
update-alternatives --config gcc
gcc --version | head -n 1
git config --global advice.detachedHead false
cd /usr/local && git clone -q --branch master https://github.com/gmtsar/gmtsar GMTSAR
# revert recent broken commit
cd /usr/local/GMTSAR && git checkout e98ebc0f4164939a4780b1534bac186924d7c998 > /dev/null
cd /usr/local/GMTSAR && autoconf > /dev/null
cd /usr/local/GMTSAR && ./configure --with-orbits-dir=/tmp > /dev/null
cd /usr/local/GMTSAR && make 1>/dev/null 2>/dev/null
cd /usr/local/GMTSAR && make install >/dev/null
# test one GMTSAR binary
/usr/local/GMTSAR/bin/make_s1a_tops 2>&1 | head -n 2
fi

# Install virtual framebuffer for interactive 3D visualization
apt install -y xvfb > /dev/null
pip3 install -q pyvista xvfbwrapper jupyter_bokeh
# note: jupyter_bokeh for panel interactive visualization backend blocks tqdm progressbar

0 comments on commit 2ce790a

Please sign in to comment.