opencobra / cobratoolbox

The COnstraint-Based Reconstruction and Analysis Toolbox. Documentation:
https://opencobra.github.io/cobratoolbox
Other
253 stars 318 forks source link

No MILP solver found #870

Closed cjos238 closed 7 years ago

cjos238 commented 7 years ago

Every time I try to run fluxVariability.m with allowLoops set to false, it generates the following error. Error using solveCobraMILP (line 79) No MILP solver found. Run >> changeCobraSolver(solverName);

Error in fluxVariability>calcSolForEntry (line 231) LPsolution = solveCobraMILP(addLoopLawConstraints(LPproblem, model));

Error in fluxVariability (line 204) parfor i = 1:length(rxnNameList)

My MATLAB says GUROBI is installed but it appears some problem with the path. Any clues on how I set this up for future use. I didn't get this error earlier in the previous version I had from November 2016, but been having issues since I got the newer version of COBRA Toolbox 10 days ago. Any help on this end is appreciated. Please do let me know if you need more information on this.

I hereby confirm that I have:

(Note: You may replace [] with [X] to check the box)

laurentheirendt commented 7 years ago

May you provide the output of generateSystemConfigReport? Are you on the very latest version of the COBRA Toolbox?

I recommend that we continue the discussion in our forum. Thanks.

cjos238 commented 7 years ago

Hi Laurent, Thanks for the prompt reply. Thanks for suggesting generateSystemConfigReport. I identified a problem with the path and change it by running setenv('GUROBI_PATH','E:\gurobi701');. However, that didn't fix the problem.

I did find a hint to fixing the original issue in one of the forum discussions called Cannot use fluxVariability function. I made following changes:

  1. added the following line immediately before parfor i = 1:length(rxnNameList) global CBT_MILP_SOLVER; milpsolver = CBT_MILP_SOLVER;
  2. added the following line immediately inside the parfor changeCobraSolver(milpsolver,'MILP',0,1);

I have the code running, please do let me know if you think I should make additional changes to the function file for it to run properly.

Thank you for reminding me about the forums! 👍

laurentheirendt commented 7 years ago

May you provide the output of generateSystemConfigReport? gurobi is not installed in a standard location, so you have to set the environment variables yourself as explained here.

It looks like your issue is related to how the MILP solver should be set when having multiple workers. Eventually, this note on parallel programming also helps.

laurentheirendt commented 7 years ago

Closing - let's continue in the forum.