Commit e5f8d340 authored by Chris Burr's avatar Chris Burr
Browse files

Add host_os_conda script

parent 87d382f6
Pipeline #1641088 failed with stages
in 1 minute and 4 seconds
#!/bin/bash
###############################################################################
# (c) Copyright 2018-2019 CERN #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "LICENSE". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
set -euo pipefail
IFS=$'\n\t'
# Known platforms from: https://conda-static.anaconda.org/conda-forge/index.html
# linux-32
# linux-64
# linux-aarch64
# linux-ppc64le
# osx-64
if [ -z "${force_host_os:-}" ] ; then
_os=$(uname -s)
case $_os in
'Linux')
_os='linux'
;;
'Darwin')
_os='osx'
;;
*) ;;
esac
_arch=$(uname -m)
case $_arch in
'x86_64')
_arch='64'
;;
'ppc64')
_arch='ppc64le'
;;
'aarch64')
_arch='aarch64'
;;
'i686')
_arch='32'
;;
*) ;;
esac
host_os="${_os}-${_arch}"
# Fix up for systems with really old glibc versions
if [[ "${host_os}" == "linux-64" ]]; then
_libc_type=$(getconf GNU_LIBC_VERSION | cut -d " " -f 1)
_libc_major=$(getconf GNU_LIBC_VERSION | cut -d " " -f 2 | cut -d '.' -f 1)
_libc_minor=$(getconf GNU_LIBC_VERSION | cut -d " " -f 2 | cut -d '.' -f 2)
if [ "${_libc_type}" == "glibc" ] && [ "${_libc_major}" -eq "2" ]; then
if [ "${_libc_minor}" -lt "12" ]; then
# CentOS 5
host_os="linux-64@glibc-2.5"
fi
fi
fi
else
(>&2 echo "warning: overriding host os detection (using ${force_host_os})")
_os=${force_host_os}
fi
echo "${host_os}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment