Problem installing cobra toolbox

903 views
Skip to first unread message

Qausar

unread,
Jan 30, 2016, 7:56:28 PM1/30/16
to COBRA Toolbox
Dear all, 

I'm trying to install cobra toolbox on my PC:

Windows 10
Matlab 2013b
Gurobi 6.5.0


However, at compiler setting, for choosing compiler, the Matlab didn't detect the compiler available although I have installed the Visual C++. The error I got:

>> mex -setup
 
Welcome to mex -setup.  This utility will help you set up  
a default compiler.  For a list of supported compilers, see  
 
Please choose your compiler for building MEX-files: 
 
Would you like mex to locate installed compilers [y]/n? y
 
No supported SDK or compiler was found on this computer. 
For a list of supported compilers, see  
 
Unable to complete successfully.


Currently, I'm not sure whether the problem is non-compatible with the Windows 10 or the MSVC I've downloaded is not supported for Windows 10.

Please help.

Thank you.

Ronan M.T. Fleming

unread,
Jan 31, 2016, 3:03:52 AM1/31/16
to cobra-...@googlegroups.com

Hi
Those instructions are out of date. Clone the latest code from the git repo. Get Gurobi 650 as no mex -setup required plus libsbml is also packaged with cobra toolbox now and should work fine.
Regards
Ronan

--

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

Qausar

unread,
Jan 31, 2016, 4:06:09 AM1/31/16
to COBRA Toolbox
Thank you Ronan.

The git repo, refer to this: https://opencobra.github.io/cobratoolbox/
Is there any guidelines that I can follow to install the cobra? 

Thank you.

Ronan M.T. Fleming

unread,
Jan 31, 2016, 6:51:03 AM1/31/16
to cobra-...@googlegroups.com
Hi,

for a windows user, this is how I imaging the steps:

1. Install gurobi 6.*
http://www.gurobi.com/documentation/
including "Setting up Gurobi for MATLAB"

4. In matlab, navigate to yourpath/cobratoolbox/external then run the following command in the matlab command line
addpath_recurse('~/work/code/cobratoolbox',{'obsolete','m2html','docs'});

4. In matlab, run the command
initCobraToolbox()

Then you should a message like this:

>> initCobraToolbox
Define LP solver...
LP solver: gurobi6

Define MILP solver...
MILP solver: gurobi6

Define QP solver...
QP solver: gurobi6

Define MIQP solver...
MIQP solver: gurobi6

Installing the SBMLToolbox.

* Doing preliminary checks of runtime environment ...
  - This appears to be MATLAB and not Octave.
  - MATLAB reports the OS is 64-bit Linux.

Checking for libSBML MATLAB binding

Document written
libSBML MATLAB binding found and working

Installation successful
TranslateSBML worked with the test .xml file: Ecoli_core_ECOSAL.xml

Regards,

Ronan

 
--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Senior research associate (EN) == Chercheur (FR),
Principal investigator,
Systems Biochemistry Group,
wwwen.uni.lu/lcsb/research/systems_biochemistry
Luxembourg Centre for Systems Biomedicine,
University of Luxembourg,
Campus Belval,
6, avenue du Swing,
L-4367 Belvaux.
&
National Centre of Excellence in Research on Parkinson’s disease
www.parkinson.lu
&
Adjunct Assistant Professor,
Division of Analytical Biosciences,
Leiden Academic Centre for Drug Research,
Faculty of Science,
University of Leiden.
http://analyticalbiosciences.leidenuniv.nl
----------------------------------------------------------------------------
Mobile:  +352 621 175 112
Office: +352 466 644 5528
Skype: ronan.fleming
----------------------------------------------------------------------------
(This message is confidential and may contain privileged information. It is intended for the named recipient only. If you receive it in error please notify me and permanently delete the original message and any copies.)
Message has been deleted

gianluca mattei

unread,
Feb 3, 2016, 4:11:01 AM2/3/16
to COBRA Toolbox
Hi
I had the same problem. Gurobi and W10 seems to be not compatible (for example you'll need .NET framework 4.0 not available for W 10) and it requires some workarounds to use last version of the solver. Try using glpk instead of gurobi, this will save you a lot of time.

Ronan M.T. Fleming

unread,
Feb 3, 2016, 4:46:07 AM2/3/16
to cobra-...@googlegroups.com, Ben Heavner
Dear Gianluca et al,

please follow this gurobi guide to install:

I reiterate, there is no need for gurobi_mex any longer. We still keep that interface for backward compatibility, but I don't actually know anyone who still uses it.

Ben,
please remove or update your webpage as it refers to a time before there existed a native matlab interface for gurobi and may be causing confusion out there about how to install solvers interfaced to the COBRA toolbox. Ideally, if you want to write a new readme, then make a pull request and we will add it to the git repo.

Regards,
Ronan

--

Ben

unread,
Feb 3, 2016, 12:13:05 PM2/3/16
to COBRA Toolbox, bhea...@gmail.com
You bet. I should be able to update that page next week. It is pretty old, for sure. I've long been pleasantly surprised at how useful that particular set of notes has been for the community.

-b

Qausar

unread,
Feb 4, 2016, 3:04:07 AM2/4/16
to COBRA Toolbox, bhea...@gmail.com
Hi,

Thanks for the guidelines.

I've installed everything according to the guidelines, however when I'm trying to set up the Gurobi for Matlab, this error occur:
 
Error using gurobi_setup (line 90)
Invalid MEX-file 'C:\Program Files (x86)\gurobi\win64\matlab\gurobi.mexw64': The specified module could not be found.

However, in that directory, the specified module is already there. 

Thank you

Ronan M.T. Fleming

unread,
Feb 4, 2016, 4:18:27 AM2/4/16
to cobra-...@googlegroups.com, Ben Heavner
Hi Qausar,
this is a problem with how you installed gurobi. They have a google group:
Someone else reported the same problem I think, and a solution is there:
Regards,
Ronan

Qausar

unread,
Feb 4, 2016, 3:43:35 PM2/4/16
to COBRA Toolbox, bhea...@gmail.com
Dear all,

Thank you for your helpfulness, I've successfully installed the COBRA toolbox on my desktop. Thank you very much.

Huansheng Cao

unread,
Feb 8, 2016, 9:17:41 PM2/8/16
to COBRA Toolbox
Hi there, 
my systems: 64-bit win7, matlab 2014a, cobra cloned from github.
I have done exactly the same thing as Ronan instructed, but only got 12 of 32 tests passed. before I install Gurobi 6.05, I got 15 of 32 tests passed. please help
Tests passed: 
>> initCobraToolbox()
Define LP solver...
LP solver: gurobi6 

Define MILP solver...
MILP solver: gurobi6

Define QP solver...
QP solver: gurobi6

Define MIQP solver...
MIQP solver: gurobi6

Define CB map output...
CB map output: svg

TranslateSBML worked with the test .xml file: Ecoli_core_ECOSAL.xml
>> testAll()
Solver set to MPS. This function will write out a .MPS file and return a matrix string for the LP problem
Solver set to MPS. This function will output an MPS matrix string for the MILP problem
testBuildMPS successfully passed
Error in testC13Fitting
Error in testDeletionStudy
testElementalBalance successfully passed
ans =
     1
Error in testFASTCORE
Error in testFBA
Error in testFVA
|J|=4112  Error in testFastcc
|J|=6  |A|=5
....
....


testBuildMPS
testElementalBalance
testFluxConsistency
testGDLS
testGrowthExpMatch
testMaps
testModelManipulation
modelCitations_update
testRobustnessAnalysis
testSBML
testgpSampler
testSubspaces


Tests not passed: 
testC13Fitting
testDeletionStudy
testFASTCORE
testFBA
testFVA
testFastcc
testMOMA
modelCitations
sbmlTestModelToMat
testModels
testModelsAlgorithmically
testNullspace
testOptKnock
testRank
testSampleCbModel
testDifferentLPSolvers
testSolvers
testStoichiometricConsistency
testTissueModel
testpFBA
IT IS NOT NECESSARY FOR THE COBRA TOOLBOX TO PASS ALL TESTS TO FUNCTION; HOWEVER, IT MUST PASS THE TESTS THAT ARE RELEVANT TO YOUR PARTICULAR PROBLEM!!!
Tests may not pass for several reasons.  Some of the most common issues:
1.  The correct solver is not installed.  Certain tests require LP, MILP, QP or NLP solvers.  See changeCobraSolvers.m for a complete list of supported solvers.
These tests will fail when running testAll unless one has the tomlab suite installed.  If all of the functions that you require for your use function then do not worry about them: testC13Fitting, testGDLS, testMOMA, testOptKnock, testSolvers
If a particular test fails, you can run that test individually for more information
ans =
12 of 32 tests completed successfully.

Giu Bon

unread,
Feb 9, 2016, 10:45:28 AM2/9/16
to COBRA Toolbox
Hi,
I'm also a noob in here. The same happens to me when using gurobi6 as LP solver for FBA.
Try to use tomlab. It worked fine to me.
Then, in order to save it as your first LP solver, try to open the initCobraToolbox file, look for % Define LP solver
and add tomlab_cplex as your first solver

CobraLPSolver = {'tomlab_cplex', 'cplx', ...}


Or better if you wait for somebody more expert. However, this advice can't be harmful to you pc, so you can try it easy.

Let us know
Reply all
Reply to author
Forward
0 new messages