Skip to content

Commit e3e4c08

Browse files
committed
feat: add setup-gurobi-optimizer function to install Gurobi and configure environment variables
1 parent c2d8262 commit e3e4c08

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

setup_devenv/windows/setup-wsl2.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,5 +353,24 @@ function install-firebase() {
353353
exec -l $SHELL
354354
}
355355

356+
function setup-gurobi-optimizer() {
357+
# depends on docker
358+
local GRB_VERSION="13.0.2"
359+
mkdir -p /opt/gurobitst && \
360+
sudo chown -R $USER:$USER /opt/gurobitst && \
361+
docker create --name temp_container gurobi/optimizer:${GRB_VERSION} && \
362+
docker cp temp_container:/opt/gurobi/linux /opt/gurobitst && \
363+
docker rm temp_container && \
364+
cat >> $HOME/.zshrc << 'EOF'
365+
366+
# GUROBI custom variables
367+
export GUROBI_HOME=/opt/gurobi/linux
368+
export LD_LIBRARY_PATH=${GUROBI_HOME}/lib
369+
export GRB_LICENSE_FILE=/opt/gurobi/gurobi.lic
370+
export PATH=${PATH}:${GUROBI_HOME}/bin
371+
EOF
372+
373+
}
374+
356375
$*
357376
# main "${@:-}"

0 commit comments

Comments
 (0)