LoadError: Unable to locate gurobi installation. Build Errors

679 views
Skip to first unread message

varu...@gmail.com

unread,
Oct 26, 2016, 2:03:54 PM10/26/16
to julia-opt
Hello,

I'm currently trying to solve a model using Gurobi rather than CPLEX and thus I installed the academic version of it.
I'm not sure if I modified the environment variables correctly but I appended the three lines to the end of bashrc file.
I'm still not able to fix the problem with build errors though. I tried entering const libGurobi=  the path and saved it on
a deps.jl file but that didn't work too. I'd be glad if you guys could help me. Thanks

Joey Huchette

unread,
Oct 26, 2016, 3:18:21 PM10/26/16
to julia-opt
What are the build errors?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.

varu...@gmail.com

unread,
Oct 26, 2016, 4:09:41 PM10/26/16
to julia-opt, huch...@mit.edu

Hi Joey, The build errors are as follows:

WARNING: Gurobi had build errors. - packages with build errors remain installed in /home/prof_knetze/.julia/v0.5 - build the package(s) and all dependencies with `Pkg.build("Gurobi")` - build a single package by running its `deps/build.jl` script


On Wednesday, 26 October 2016 21:18:21 UTC+2, Joey Huchette wrote:
What are the build errors?
On Wed, Oct 26, 2016 at 2:03 PM, <varu...@gmail.com> wrote:
Hello,

I'm currently trying to solve a model using Gurobi rather than CPLEX and thus I installed the academic version of it.
I'm not sure if I modified the environment variables correctly but I appended the three lines to the end of bashrc file.
I'm still not able to fix the problem with build errors though. I tried entering const libGurobi=  the path and saved it on
a deps.jl file but that didn't work too. I'd be glad if you guys could help me. Thanks

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+...@googlegroups.com.

Joey Huchette

unread,
Oct 26, 2016, 5:17:09 PM10/26/16
to julia-opt

Can you run Pkg.build("Gurobi") and send the complete output? This should (hopefully) give a more informative error message.


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Oct 27, 2016, 4:15:37 AM10/27/16
to julia-opt, huch...@mit.edu
This is the complete output. These were the three lines that I appended to the bashrc file after installing Gurobi

GUROBI_HOME="/opt/gurobi700/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"


INFO: Building Gurobi
===============================[ ERROR: Gurobi ]================================

LoadError: Unable to locate Gurobi installation. Note that this must be downloaded separately from gurobi.com
while loading /home/prof_knetze/.julia/v0.5/Gurobi/deps/build.jl, in expression starting on line 44

================================================================================

================================[ BUILD ERRORS ]================================



WARNING: Gurobi had build errors.

 - packages with build errors remain installed in /home/prof_knetze/.julia/v0.5
 - build the package(s) and all dependencies with `Pkg.build("Gurobi")`
 - build a single package by running its `deps/build.jl` script

================================================================================

Joey Huchette

unread,
Oct 27, 2016, 5:12:44 PM10/27/16
to julia-opt

Can you verify the contents of the GUROBI_HOME directory (i.e. output of ls $GUROBI_HOME).


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Oct 28, 2016, 1:37:46 AM10/28/16
to julia-opt, huch...@mit.edu
ls $GUROBI_HOME
bin      EULA.pdf  include  matlab  ReleaseNotes.html  scr
docs   examples   lib        R          setup.py

Joey Huchette

unread,
Oct 28, 2016, 10:37:20 AM10/28/16
to julia-opt

Ah, if you’re trying to use Gurobi version 7.0 you may need to update the Gurobi.jl package (Pkg.update()).


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Oct 28, 2016, 10:58:35 AM10/28/16
to julia-opt, huch...@mit.edu
That didn't work Joey. The problem still persists

Joey Huchette

unread,
Oct 28, 2016, 11:15:08 AM10/28/16
to julia-opt

Can you try Libdl.dlopen_e(joinpath(ENV["GUROBI_HOME"],"lib","libgurobi70.so")) and see what this outputs?


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Oct 28, 2016, 12:13:17 PM10/28/16
to julia-opt, huch...@mit.edu
bash: syntax error near unexpected token `joinpath'

Joey Huchette

unread,
Oct 28, 2016, 12:14:37 PM10/28/16
to julia-opt
This is julia code.

To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Oct 28, 2016, 12:19:34 PM10/28/16
to julia-opt, huch...@mit.edu
Ahh, I'm extremely sorry. I tried it on the julia terminal and I get a keyError: key "GUROBI_HOME" not found

Joey Huchette

unread,
Oct 28, 2016, 12:37:48 PM10/28/16
to julia-opt

No problem. This indicates that the GUROBI_HOME environment variable is not being properly set. Looking back at your earlier message, you need to put export GUROBI_HOME="/opt/gurobi700/linux64" in your .bashrc (note the export).


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Oct 28, 2016, 12:40:15 PM10/28/16
to julia-opt, huch...@mit.edu
I set it exactly the way you said on the .bashrc file in the home directory. I can run gurobi examples using the terminal but I can't use it in JuMP

Martin Castin

unread,
Nov 1, 2016, 3:24:52 AM11/1/16
to julia-opt, huch...@mit.edu
Hello, I have exactly the same problem as you do. Did someone find any solution?

Joey Huchette

unread,
Nov 1, 2016, 4:14:22 PM11/1/16
to julia-opt

It’s unclear to me what “can’t use it in JuMP” means. What code are you running? Are there error messages? What do they say?

Can you provide the output from Libdl.dlopen_e(joinpath(ENV[“GUROBI_HOME”],”lib”,”libgurobi70.so”)) and then try Pkg.build("Gurobi") again?

-Joey


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Nov 2, 2016, 2:31:59 AM11/2/16
to julia-opt, huch...@mit.edu
Hey Joey,

Sorry about that. What I meant to say was that i could run the example problems provided by Gurobi on the terminal by running the command gurobi_cl /opt/grobi700/linux64/examples/data/coins.lp. This works absolutely fine. However, when I set Gurobi as the solver for the JuMP model, I always get the same build error I spoke of. When I run the command  you sent me, I get a key error. To quickly explain how I performed the installation of Gurobi, I extracted the tar.gz file in /opt and then installed the licence key. The next thing I did was to add the environment variables to the bashrc file in the home directory. Below is the output I got for running the commands you sent me. Additionally,  the bashrc file that is located in my home directory "/home/prof_knetze" contains the following lines

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
# export PATH="/opt/MiniZincIDE-2.0.13-bundle-linux-x86_64:$PATH"
export GUROBI_HOME="/opt/gurobi700/linux64"

export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${GUROBI_HOME}/lib"







Joey Huchette

unread,
Nov 2, 2016, 10:37:46 AM11/2/16
to julia-opt

If you’re still getting the same key error, then the environment variable is still not being set properly, explaining the build error. From the screenshot, it appears you are using Juno? I’m not sure if that might explain the issue; I’d suggest opening an issue with the Juno repository, or on the julia-users mailing list.

(Not certain, but a quick-and-dirty fix might just be to do ENV["GUROBI_HOME"] = "/opt/gurobi700/linux64"; Pkg.build("Gurobi")).


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

varu...@gmail.com

unread,
Nov 2, 2016, 12:54:02 PM11/2/16
to julia-opt, huch...@mit.edu
Thanks for your time Joe. The solution seemed to work in the sense that I didn't get a build error this time when I tried "Pkg.add(Gurobi)". It showed a different error when I typed "using Gurobi" into the REPL. This was the error I got. I shall raise this issue with the Juno repository

WARNING: Module Compat with uuid 246268599510607 is missing from the cache.
This may mean module Compat does not support precompilation but is imported by a module that does.
ERROR: LoadError: Declaring __precompile__(false) is not allowed in files that are being precompiled.
 in require(::Symbol) at ./loading.jl:385
 in include_from_node1(::String) at ./loading.jl:488
 in macro expansion; at ./none:2 [inlined]
 in anonymous at ./<missing>:?
 in eval(::Module, ::Any) at ./boot.jl:234
 in process_options(::Base.JLOptions) at ./client.jl:239
 in _start() at ./client.jl:318
while loading /home/prof_knetze/.julia/v0.5/Gurobi/src/Gurobi.jl, in expression starting on line 14


Failed to precompile Gurobi to /home/prof_knetze/.julia/lib/v0.5/Gurobi.ji.
 in compilecache(::String) at ./loading.jl:593
 in require(::Symbol) at ./loading.jl:422

varu...@gmail.com

unread,
Nov 2, 2016, 12:57:06 PM11/2/16
to julia-opt, huch...@mit.edu
Just a quick thing. You guessed it right. It was certainly the problem with Juno as I tried the same command "using Gurobi" on the julia terminal that I opened from the command line interface and it clearly worked! I'm sorry I got you all worked up and thanks so much for your time.

Joey Huchette

unread,
Nov 6, 2016, 7:21:06 PM11/6/16
to julia-opt

This looks like a precompilation error with the Compat package; hopefully Pkg.update() will fix this.

-Joey


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages