File: setup.sh

package info (click to toggle)
pbbam 2.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,060 kB
  • sloc: cpp: 59,614; xml: 2,908; ansic: 799; sh: 275; python: 203; makefile: 187
file content (98 lines) | stat: -rwxr-xr-x 2,687 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env bash
set -vex

export ENABLED_TESTS="true"

case "${bamboo_planRepository_branchName}" in
  master)
    _pbcopper_module="pbcopper/master"
    ;;
  *)
    _pbcopper_module="pbcopper/develop"
    ;;
esac

case "${GCC_VERSION}" in
  next)
    module load gcc/8.1.0
    module load gtest
    module load ${_pbcopper_module}
    ;;

  PA)
    # have to build htslib for PA
    module unload htslib
    module load zlib
    module load gtest/gcc48

    # load SCL GCC
    source /opt/rh/devtoolset-6/enable

    export NEXUS_PROJECT=pacbio/seq/pa/pbbam
    export NEXUS_TC=""
    export _artifact_versionprepend="true"
    ;;

  ICC*)
    module load devtoolset/6
    module load composer_xe/${GCC_VERSION#ICC}
    module load gtest/gcc48

    CC="icc"
    CXX="icpc"
    ;;

  clang)
    module load gtest/gcc48

    source /opt/rh/llvm-toolset-6.0/enable
    CC="clang"
    CXX="clang++"
    ;;

  *)
    module load gcc

    if [[ ${ENABLED_WRAP_MODE:-nofallback} == nofallback ]]; then
      module load gtest
      module load ${_pbcopper_module}
    else
      # don't want to rely on internet connectivity for CI
      mkdir -p subprojects/packagecache
      cp /mnt/software/m/meson/packagecache/gtest* subprojects/packagecache/
    fi
    ;;
esac

module load ccache

export CC="ccache ${CC:-gcc}"
export CXX="ccache ${CXX:-g++}"
export CCACHE_BASEDIR="${PWD}"

if [[ ${GCC_VERSION} != ICC* ]]; then
  # without -fno-sanitize-recover=all UBSAN failures won't abort the program
  export CFLAGS="${CFLAGS} -fno-sanitize-recover=all"
  export CXXFLAGS="${CXXFLAGS} -fno-sanitize-recover=all"
fi

if [[ -z ${bamboo_planRepository_branchName+x} ]]; then
  : #pass
elif [[ ! -d /pbi/flash/bamboo/ccachedir ]]; then
  echo "[WARNING] /pbi/flash/bamboo/ccachedir is missing"
elif [[ $bamboo_planRepository_branchName == develop ]]; then
  export CCACHE_DIR=/pbi/flash/bamboo/ccachedir/${bamboo_shortPlanKey}.${bamboo_shortJobKey}.develop
  export CCACHE_TEMPDIR=/scratch/bamboo.ccache_tempdir
elif [[ $bamboo_planRepository_branchName == master ]]; then
  export CCACHE_DIR=/pbi/flash/bamboo/ccachedir/${bamboo_shortPlanKey}.${bamboo_shortJobKey}.master
  export CCACHE_TEMPDIR=/scratch/bamboo.ccache_tempdir
elif [[ $USER == bamboo ]]; then
  _shortPlanKey=$(echo ${bamboo_shortPlanKey}|sed -e 's/[0-9]*$//')
  export CCACHE_DIR=/pbi/flash/bamboo/ccachedir/${bamboo_shortPlanKey}.${bamboo_shortJobKey}
  if [[ -d /pbi/flash/bamboo/ccachedir/${_shortPlanKey}.${bamboo_shortJobKey}.develop ]]; then
    ( cd /pbi/flash/bamboo/ccachedir/
      cp -a ${_shortPlanKey}.${bamboo_shortJobKey}.develop $CCACHE_DIR
    )
  fi
  export CCACHE_TEMPDIR=/scratch/bamboo.ccache_tempdir
fi