opencobra / cobratoolbox

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

generateMexFastFVA depends on stale CPLEX and MATLAB versions #1596

Open jep38 opened 4 years ago

jep38 commented 4 years ago

Problem: when using MATLAB 2019a with CPLEX 12.10 on Windows 10x64 [enterprise and professional SKUs], generateMexFastFVA.m produces the following warning and error:

>> generateMexFastFVA
 > The solver compatibility is not tested with MATLAB R2019a.
Warning: As the ibm_cplex interface is not compatible, the generated MEX file might not be
compatible. 
> In generateMexFastFVA (line 34) 
 > The version of CPLEX is 1210.
Error using generateMexFastFVA (line 93)
The CPLEX library C:\Program
Files\ibm\ILOG\CPLEX_Studio1210\cplex\lib\x64_windows_vs2013\stat_mda does not exist. Please
install the CPLEX solver as explained here.

I hereby confirm that I have:

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

Background The CobraToolbox solver compatibility matrix describes CPLEX versions to 12.8 and MATLAB versions to 2018b. The latest release of CPLEX, 12.10, includes a change to deprecate CPXFILEptr which is used in cplexFVA.c. In addition, the folder hierarchy in the default CPLEX install path has been renamed, causing the generateMexFastFVA.m to fail.

Partial solution I've attached a simple fix for the folder name problem associated with CPLEX 12.10. This is the cause of the error in line 93 above.

I've also added some detail to the readme.md file that addresses the question posted in this link: (https://github.com/opencobra/cobratoolbox/files/4707494/README.zip) [README.zip]

generateMexFastFVA.m The attached generateMexFastFVA.m file produces the following error which seems to be related to this thread: https://groups.google.com/forum/#!topic/cobra-toolbox/oFzL2Lkbz58

>> generateMexFastFVA
 > The solver compatibility is not tested with MATLAB R2019a.
Warning: As the ibm_cplex interface is not compatible, the generated MEX file might not be
compatible. 
> In generateMexFastFVA (line 34) 
 > The version of CPLEX is 1210.
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
     variables with more than 2^32-1 elements. You will be required
     to update your code to utilize the new API.
     You can find more information about this at:
     https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
Building with 'MinGW64 Compiler (C)'.
Error using mex
gcc: error: \-fexceptions: No such file or directory

Error in generateMexFastFVA (line 151)
    eval(['mex ' cmd]);

[generateMexFastFVA.zip] (https://github.com/opencobra/cobratoolbox/files/4707464/generateMexFastFVA.zip)

Thank you! john

rmtfleming commented 4 years ago

Please provide this most welcome contribution as a pull request. https://opencobra.github.io/cobratoolbox/stable/contributing.html

almut-heinken commented 4 years ago

@jep38 Dear John, we are having the same issue with

Error using mex gcc: error: -fexceptions: No such file or directory

Error in generateMexFastFVA (line 151) eval(['mex ' cmd]);

being displayed when running generateMexFastFVA. Would it be possible for you to explain how you solved the problem? Did you submit a pull request already? Thank you very much in advance! Kind regards, Almut

jep38 commented 4 years ago

Hi All,

Please accept my apologies -- work got busy and I've neglected to submit the pull request. I intend to submit a partial fix, but it won't happen for another couple of weeks. john

almut-heinken commented 4 years ago

Hi John, no problem, take your time. Kind regards, Almut

almut-heinken commented 3 years ago

Hi @jep38 May I ask if you had the chance to submit a pull request? Could you maybe otherwise explain how you solved the problem? Thank you very much in advance! Kind regards, Almut

trjhensen commented 3 years ago

Hi everyone. I found in another thread that the fastFVA function uses a type definition which is removed in cplex version 12.9. The depreciated type definition is "CPXFILEptr". To be able to run fastFVA, cplex 12.8 needs to be used. cplex 12.8 does not work with MATLAB 2018b and 2020b. Cplex 12.8 is tested for MATLAB 2016b, so that might work. However, this didn't work for me.

Source: https://groups.google.com/g/cobra-toolbox/c/oFzL2Lkbz58/m/oayT80zdBAAJ?pli=1

Here is more info about the removed feature: https://www.ibm.com/support/knowledgecenter/SS9UKU_12.9.0/com.ibm.cplex.zos.help/CPLEX/ReleaseNotes/topics/releasenotes1290/removed.html

rmtfleming commented 3 years ago

HI, would someone please update the "FastFVA code code should be updated for use in newer versions of cplex"? Lots of people are using open source code and they should all, in some way, contribute to its maintenance. Regards, Ronan

On Wed, 3 Feb 2021 at 11:30, trjhensen notifications@github.com wrote:

Hi everyone. I found in another thread that the fastFVA code uses a type definition that is removed in cplex version 12.9. The depreciated type definition is CPXFILEptr. That means that the FastFVA code code should be updated for use in newer versions of cplex.

To be able to run fastFVA now, cplex 12.8 needs to be used. cplex 12.8 does not work with MATLAB 2018b and 2020b. It is however tested for MATLAB 2016b, so that should work.

Source: https://groups.google.com/g/cobra-toolbox/c/oFzL2Lkbz58/m/oayT80zdBAAJ?pli=1

Here is more info about the removed feature: https://www.ibm.com/support/knowledgecenter/SS9UKU_12.9.0/com.ibm.cplex.zos.help/CPLEX/ReleaseNotes/topics/releasenotes1290/removed.html

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/opencobra/cobratoolbox/issues/1596#issuecomment-772440115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEOWDH3IZWSBDIACCCNTS5EXVBANCNFSM4NPDFXDA .

--

Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.

Assistant Professor, Division of Systems Biomedicine and Pharmacology, Leiden Academic Centre for Drug Research, Faculty of Science, Leiden University. https://www.universiteitleiden.nl/en/staffmembers/ronan-fleming & H2020 Project Coordinator, Systems Medicine of Mitochondrial Parkinson’s Disease, http://sysmedpd.eu & Senior Lecturer, School of Medicine, National University of Ireland, Galway.

Peer-reviewed publications: https://goo.gl/FZPG23 Mobile: +353 852 109 806 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.)

trjhensen commented 3 years ago

Dear Ronan, I am sorry for the mistake. I have updated my previous post. Kind regards, Tim

francismore1 commented 5 months ago

Please how do I activate CPLEX as my solver on MATLAB? I am so lost trying to do this

rmtfleming commented 5 months ago

IBM have decided not to release a MATLAB interface to the new version 20.1 of CPLEX. The previous version of CPLEX (12.10) can still be downloaded and used, apparently for the next 5 years. https://www.ibm.com/support/pages/downloading-ibm-ilog-cplex-optimization-studio-v12100

Please would everyone that uses CPLEX via MATLAB go to this page https://ibm-data-and-ai.ideas.aha.io/ideas/CPLEX-I-112 and request that IBM bring back the MATLAB interface?

On Sat, 22 Jun 2024 at 20:39, Okechukwu Francis @.***> wrote:

Please how do I activate CPLEX as my solver on MATLAB? I am so lost trying to do this

— Reply to this email directly, view it on GitHub https://github.com/opencobra/cobratoolbox/issues/1596#issuecomment-2184166289, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEORVPOSIZ2SVFPSO34DZIXHGLAVCNFSM6AAAAABJXVTSB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBUGE3DMMRYHE . You are receiving this because you commented.Message ID: @.***>

--

Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.

Associate Professor, School of Medicine, University of Galway, Ireland. Coordinator of the Horizon Europe project "Reconstruction and Computational Modelling for Inherited Metabolic Diseases" (Recon4IMD https://www.recon4imd.org/)

Peer-reviewed publications: https://goo.gl/FZPG23 Mobile: +353 852 109 806 Github: @rmtfleming https://github.com/rmtfleming