Commit f7335235 authored by gsell's avatar gsell
Browse files

setup.sh: setting of env.variable OTB_OS added

parent ba707377
...@@ -54,7 +54,18 @@ else ...@@ -54,7 +54,18 @@ else
return return
fi fi
declare __os=$(uname -s) export OTB_OS=$(uname -s)
case ${OTB_OS} in
Darwin )
OTB_OS='macOS'
;;
Linux )
:
;;
* )
echo "Unsupported OS -- ${OS}" 1>&2
;;
esac
declare -ix OTB_ERR_ARG=1 declare -ix OTB_ERR_ARG=1
declare -ix OTB_ERR_SETUP=2 declare -ix OTB_ERR_SETUP=2
...@@ -200,7 +211,7 @@ fi ...@@ -200,7 +211,7 @@ fi
# OTB_TOOLSET is used in the boost build recipe # OTB_TOOLSET is used in the boost build recipe
# #
if [[ -z "${OTB_TOOLSET}" ]]; then if [[ -z "${OTB_TOOLSET}" ]]; then
if [[ "${__os}" == 'Darwin' ]]; then if [[ "${OTB_OS}" == 'Darwin' ]]; then
OTB_TOOLSET='clang' OTB_TOOLSET='clang'
else else
OTB_TOOLSET='gcc' OTB_TOOLSET='gcc'
...@@ -209,7 +220,6 @@ if [[ -z "${OTB_TOOLSET}" ]]; then ...@@ -209,7 +220,6 @@ if [[ -z "${OTB_TOOLSET}" ]]; then
fi fi
export OTB_TOOLSET export OTB_TOOLSET
export OTB_PREFIX="${OTB_PREFIX:-${HOME}/OPAL}" export OTB_PREFIX="${OTB_PREFIX:-${HOME}/OPAL}"
export OTB_DOWNLOAD_DIR="${OTB_PREFIX}/tmp/Downloads" export OTB_DOWNLOAD_DIR="${OTB_PREFIX}/tmp/Downloads"
export OTB_SRC_DIR="${OTB_PREFIX}/tmp/src" export OTB_SRC_DIR="${OTB_PREFIX}/tmp/src"
...@@ -251,7 +261,7 @@ elif [[ -n "${ZSH_VERSION}" ]]; then ...@@ -251,7 +261,7 @@ elif [[ -n "${ZSH_VERSION}" ]]; then
done done
fi fi
if [[ "${__os}" == "Linux" ]]; then if [[ "${OTB_OS}" == "Linux" ]]; then
( cd "${OTB_PREFIX}" && ln -fs lib lib64 || return ${OTB_ERR_SETUP};) ( cd "${OTB_PREFIX}" && ln -fs lib lib64 || return ${OTB_ERR_SETUP};)
LIBRARY_PATH="${OTB_PREFIX}/lib64:${LIBRARY_PATH}" LIBRARY_PATH="${OTB_PREFIX}/lib64:${LIBRARY_PATH}"
LD_LIBRARY_PATH="${OTB_PREFIX}/lib64:${LD_LIBRARY_PATH}" LD_LIBRARY_PATH="${OTB_PREFIX}/lib64:${LD_LIBRARY_PATH}"
...@@ -295,7 +305,6 @@ if [[ -n ${OTB_MPI_VERSION} ]]; then ...@@ -295,7 +305,6 @@ if [[ -n ${OTB_MPI_VERSION} ]]; then
fi fi
unset __my_dir unset __my_dir
unset __os
unset __ncores unset __ncores
unset __usage unset __usage
......
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