source: trunk/GDE/SINA/builddir/ci_scripts/install_conda.sh

Last change on this file was 19170, checked in by westram, 2 years ago
  • sina source
    • unpack + remove tarball
    • no longer ignore sina builddir.
  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/bash
2#
3# Installs Bio-Conda and all dependencies
4# - adds miniconda PATH to bashrc (for CircleCI)
5# - manages a tarball if file `LOCAL` present (for ./cicleci build)
6# - creates conda_state.txt for caching with circleci "{{checksum}}"
7# - updates packages with every run
8# - needs BASH_ENV to point to the bashrc
9# - needs MINICONDA to point to the miniconda install path
10
11CONDA_PACKAGES="autoconf automake libtool pkg-config boost arb-bio-devel lcov"
12CONDA_PACKAGES="$CONDA_PACKAGES git tbb tbb-devel glib libiconv bc sed sphinx nomkl"
13
14CONDA_BASEURL=https://repo.anaconda.com/miniconda
15
16# expand '~' in MINICONDA path (alternatives to eval are too long)
17eval MINICONDA=$MINICONDA
18export MINICONDA
19
20case "$(uname)" in
21    Linux)
22        CONDA_OSNAME=Linux
23        CONDA_PACKAGES="$CONDA_PACKAGES gxx_linux-64 patchelf coreutils"
24        ;;
25    Darwin)
26        CONDA_OSNAME=MacOSX
27        CONDA_PACKAGES="$CONDA_PACKAGES clangxx_osx-64"
28        ;;
29esac
30
31# Install Miniconda if missing
32if test -d $MINICONDA; then
33    echo "Found conda install"
34else
35    echo "Downloading Miniconda"
36    curl $CONDA_BASEURL/Miniconda3-latest-$CONDA_OSNAME-x86_64.sh -o miniconda.sh
37    echo "Installing Miniconda"
38    bash miniconda.sh -b -p $MINICONDA
39    source $MINICONDA/etc/profile.d/conda.sh
40
41    $MINICONDA/bin/conda config --system --set always_yes yes --set changeps1 no
42    $MINICONDA/bin/conda config --system --add channels defaults
43    $MINICONDA/bin/conda config --system --add channels bioconda
44    $MINICONDA/bin/conda config --system --add channels conda-forge
45    $MINICONDA/bin/conda update -q conda
46fi
47
48# Setup Conda
49if test -z "$BASH_ENV"; then
50    BASH_ENV="/tmp/bash_env"
51fi
52cat >>$BASH_ENV <<EOF
53    export MINICONDA=$MINICONDA
54    source \$MINICONDA/etc/profile.d/conda.sh
55    conda activate base
56    export CPPFLAGS="\$CPPFLAGS -I\$CONDA_PREFIX/include"
57    export LDFLAGS="\$LDFLAGS -L\$CONDA_PREFIX/lib"
58    export CXXFLAGS="\$CXXFLAGS -std=c++14"
59EOF
60
61cat $BASH_ENV
62source $BASH_ENV
63
64# Install/update package
65conda install -q conda $CONDA_PACKAGES
66conda update -q conda $CONDA_PACKAGES
67conda info
68conda clean --yes --all
69
70# Dump status
71mkdir -p conda
72conda info > conda/info.txt
73conda list > conda/root.txt
74ls -1 $MINICONDA/pkgs > conda/pkgs.txt
75
76## Fix for as yet incomplete removal of .la files by conda-forge
77find $MINICONDA/lib -name \*.la -delete
78
79
80
Note: See TracBrowser for help on using the repository browser.