Update path.sh to avoid warning when there is no gurobi.

This commit is contained in:
Mikaël Capelle 2017-03-27 14:17:15 +02:00
parent 8caa124986
commit 79210f8ee6

19
path.sh
View File

@ -4,19 +4,20 @@ PYTHONPATH=${PYTHONPATH}:${HOME}/Dev/python/libs
PYTHONPATH=${PYTHONPATH}:/local/lib/python3.4
PYTHONPATH=${PYTHONPATH}:/usr/local/lib/python3.4
GUROBI_PATH=$(ls -d $HOME/.softwares/gurobi*/linux64 2> /dev/null)
if [ -e "$GUROBI_PATH" ]; then
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GUROBI_PATH}/lib
PATH=${PATH}:${GUROBI_PATH}/bin
PYTHONPATH=${PYTHONPATH}:${GUROBI_PATH}/lib/python3.4_utf32
export GRB_LICENSE_FILE=${GUROBI_PATH}/gurobi.lic
fi
MYSOFT_PATH=$HOME/.softwares
if [ -e "$MYSOFT_PATH" ]; then
PATH=${PATH}:${MYSOFT_PATH}/bin
HAS_GUROBI=$(ls ${MYSOFT_PATH} | grep "gurobi")
if [ ! -z "${HAS_GUROBI}" ]; then
GUROBI_PATH=$(ls -d $HOME/.softwares/gurobi*/linux64)
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GUROBI_PATH}/lib
PATH=${PATH}:${GUROBI_PATH}/bin
PYTHONPATH=${PYTHONPATH}:${GUROBI_PATH}/lib/python3.4_utf32
export GRB_LICENSE_FILE=${GUROBI_PATH}/gurobi.lic
fi
fi
export PATH