gurobi.log files abound!
OngoingHello,
I'm using Gurobi 12.0.2rc0 on Ubuntu Linux 25.04. I've setup my .bashrc in the following way:
export GRB_LICENSE_FILE=/home/myuser/home/misc/config/license_files/gurobi.lic
export GUROBI_HOME="/opt/gurobi1201/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
and gurobi runs as expected.
There are, however gurobi.log
that appear everywhere. Not only do these appear in any directory where gurobi is used from, but also in any directory where .bashrc is sources. So whenever I open a terminal at a certain path, I will find a freshly created gurobi.log.
I've tried to tell gurobi where to place these files with the following:
export GRB_LOGFILE=/home/myuser/.gurobi/gurobi.log
but this doesn't seem to work.
Does anyone have some advice for me on how to avoid creating these files everywhere?
-
Hi Krister,
these appear in any directory where gurobi is used from,
This is normal
but also in any directory where .bashrc is sources
This is not.
export GRB_LOGFILE=/home/myuser/.gurobi/gurobi.log
This seems like an AI hallucination (there is no GRB_LOGFILE variable)
The environment variables you have set look ok, and they would not trigger Gurobi to run (which is really the only way we can get a log file). I'm thinking there is something else going on in your .bashrc
If I open a ticket in our Help Center would you be willing to share your entire .bashrc file there?
- Riley
0 -
Sure.
0 -
these appear in any directory where gurobi is used from,
This is normal
Thanks for your response Riley, is there any way to get gurobi to write a log to somewhere other than the current working directory? I use gurobi on it's own, but snakemake will also use it, meaning anywhere I use snakemake, a gurobi.log file will appear as well. It's a nuisance.
0 -
Hi Krister,
Yes the LogFile parameter is what you need.
You can set its value to either relative or absolute paths to where you want the logfile to be. E.g. in Python:
model.params.LogFile = “/path/to/folder/containing/logs/mylogfile.log”
I will open up the ticket shortly and you will receive an email to this effect.
- Riley
0 -
I'm running other people's snakemake pipelines, therefore I don't want to modify and install the gurobi python API for every pipeline I have access to. It would help to have a global setting or environment variable to this effect!
0 -
Hi Krister,
You can add a file named gurobi.env to a directory where you run Gurobi from. Inside the gurobi.env you can add parameters (one line for each) like so:
LogFile /path/to/folder/containing/logs/mylogfile.log
This is the closest thing to a global setting I can imagine will ever be available.
You could consider creating a shell function to that takes a log filepath (or reads it from an environment variables) and snakemake args, creates the gurobi.env file with that setting, runs snakemake, then deletes the gurobi.env file if you want to automate it further.
- Riley
0 -
OK.
Are you going to make that ticket so that we can get rid of the log files that appear when the .bashrc is read?
0 -
The ticket was created Thursday last week and you should have received two emails in regards to it. Can you check you check your spam/junk folder?
0
Please sign in to leave a comment.
Comments
8 comments