Commit 116d314d authored by Blaise Li's avatar Blaise Li
Browse files

Merge branch 'master' of gitlab.pasteur.fr:bli/bioinfo_utils

parents 45c23c03 3bd05d83
......@@ -12,5 +12,6 @@ To get them, you need to do more stuff after cloning this repository:
# Enter it
cd bioinfo_utils
# Get the submodules
git submodule update --init
# https://stackoverflow.com/a/55570998/1878788
git submodule update --init --remote --merge
......@@ -14,6 +14,11 @@ function error_exit
exit 1
}
function try_load_gmp_module
{
(module --version 2> /dev/null && module load gmp) || :
}
config_file="${HOME}/.stack/config.yaml"
stack --version 2> /dev/null \
......@@ -22,7 +27,7 @@ stack --version 2> /dev/null \
if [ "${config_file}" ]
then
stack exec -- ghc --version > /dev/null \
|| (module load gmp \
|| (try_load_gmp_module \
&& stack setup \
&& INCLUDE_PATH=$(echo ${CMAKE_INCLUDE_PATH} | tr ":" ",") \
&& LIBRARY_PATH=$(echo ${CMAKE_LIBRARY_PATH} | tr ":" ",") \
......@@ -37,7 +42,7 @@ then
}
else
stack exec -- ghc --version > /dev/null \
|| (module load gmp && stack setup) \
|| (try_load_gmp_module && stack setup) \
|| error_exit "stack setup failed"
# https://unix.stackexchange.com/a/60690/55127
# Delay variable evaluation in order to adapt to loaded libraries
......@@ -50,15 +55,22 @@ fi
# cd ${HOME} to ignore local project stack config
hlint --version 2> /dev/null \
|| (module load gmp && (cd ${HOME} && make_stack_options && stack ${stack_options} install hlint)) \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} install hlint)) \
|| error_exit "hlint install failed"
scan --version 2> /dev/null \
|| (module load gmp && (cd ${HOME} && make_stack_options && stack ${stack_options} install scan)) \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} install scan)) \
|| error_exit "scan install failed"
doctest --version 2> /dev/null \
|| (module load gmp && (cd ${HOME} && make_stack_options && stack ${stack_options} install doctest)) \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} install doctest)) \
|| error_exit "doctest install failed"
make_stack_options
stack ${stack_options} build --exec "hlint src/Main.hs" --exec "scan -j False src/Main.hs" --exec "doctest src/Main.hs"
stack install
if [ $(id -u) = 0 ]
then
# We don't want things to be installed in root's home directory.
stack install --local-bin-path "/usr/local/bin"
else
stack install
fi
Supports Markdown
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