error in generateMexFastFVA()

190 views
Skip to first unread message

Leo Wayne

unread,
May 1, 2020, 1:07:33 PM5/1/20
to COBRA Toolbox
Hello.

I'm using fastFVA with ibm_cplex 12.10 with matlab r2016b under window 10. But when I run generateMexFastFVA()
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
 > The solver compatibility is not tested with MATLAB R2016b.
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 94)
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.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
this error pop out, so I changed the green line of the code in generateMexFastFVA  since my file is x64_windows_msvc14:


---------------------------------------------------------------------------------------------------------------------------------------------------------------------
% define a special compiler flag to switch for deprecated functions after CPLEX 12.8.0
if cplexVersionNum >= 128
    versionFlag = '-DHIGHER_THAN_128';  % this flag is defined in the .c file
    versionVS = 'vs2015';
else
    versionFlag = '-DLOWER_THAN_128';
%    versionVS = 'vs2013';
    versionVS='msvc14';
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


then run the generateMexFastFVA(). but still an error.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> The solver compatibility is not tested with MATLAB R2016b.
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. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:
Building with 'MinGW64 Compiler (C)'.
Error using mex
gcc: error: \-fexceptions: No such file or directory


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

According to the compatibility table,  I have also tried install the ibm_cplex 12.8, set it at the top of the environment path, and matlab has recognized it when initCobraToolbox. But when I  changeCobraSolver('ibm_cplex','all'), it said that the ibm_cplex is installed  but not working properly.

I also have read the document of fastFVA, and installed ibm_cplex 12.7.1, but it's also not working.

really grateful if someone can help me with that.
COBRAconfigReport.log

Ronan M.T. Fleming

unread,
May 5, 2020, 6:16:45 AM5/5/20
to COBRA Toolbox
Hi Leo,
probably you are the first person to try that combination of OS, cplex
and matlab. I suggest that you install the latest b version of matlab,
the latest version of cplex and try again to debug it.
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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/a572f172-0eff-487b-9319-152b24593d9a%40googlegroups.com.



--
--
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
&
Adjunct Lecturer,
School of Medicine,
National University of Ireland, Galway.
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile: +353 873 413 072
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.)

Leo Wayne

unread,
May 6, 2020, 7:46:33 PM5/6/20
to COBRA Toolbox
hi ronan.

thank you for your reply.

I have tried ibm_cplex 12.10 with matlab r2019b, but it's still the same problem.

and when initCobraToolbox, the configuring solver enviornment variable is like this.

[---*] ILOG_CPLEX_PATH: C:\Program Files\ibm\ILOG\CPLEX_Studio1210\cplex\matlab\x64_win64
[---*] GUROBI_PATH: C:\gurobi801\win64\matlab

but with the matlab r2016b, the stars are at the beginning. 

and also, according to https://github.com/opencobra/cobratoolbox/blob/master/docs/source/installation/compatMatrix.rst ,on win 10, the ibm_cplex 12.8 and 12.10 should be compatible with matlab r2016b.
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-...@googlegroups.com.

Leo Wayne

unread,
May 7, 2020, 6:43:23 AM5/7/20
to COBRA Toolbox
hi Ronan,

Also, would you be so nice to give some recommendations on which combination to use? 

thank you.

I also tried to look into the code of generateMexFastFVA. I believe the problem is at 

CFLAGS = [versionFlag ' -O3 -lstdc++ -xc++ -Wall -Werror -march=native -save-temps -shared-libgcc -v '];
cmd = ['-output cplexFVA' cplexVersion ' -largeArrayDims ' dynamicLinker ' CFLAGS="\$CFLAGS" -I"' include '" "' filename '" ' library];

I tried changing CFFLAGS to COMPFLAGS (https://github.com/cjlin1/libsvm/issues/55), but not working.

I tried deleting the \ in "\$CFLAGS" (https://www.mathworks.com/matlabcentral/answers/279171-using-mingw-compiler-and-open-mp) and ended up in this error

In file included from C:\Program Files\ibm\ILOG\CPLEX_Studio1210\cplex\include\ilcplex/cplex.h:17:0,
                 from D:\softwares\matlabr2017b\cobratoolbox16\external\analysis\fastFVAmex\cplexFVA.c:54:
C:\Program Files\ibm\ILOG\CPLEX_Studio1210\cplex\include\ilcplex/cpxconst.h:185:13: error: size of array 'CPXSIZE_BITS_TEST' is
negative
 typedef int CPXSIZE_BITS_TEST[sizeof(CPXSIZE) == sizeof(size_t) ? 1 : -1];
             ^
D:\softwares\matlabr2017b\cobratoolbox16\external\analysis\fastFVAmex\cplexFVA.c:71:8: error: unknown type name 'CPXFILEptr'
 static CPXFILEptr LogFile = NULL;
        ^
D:\softwares\matlabr2017b\cobratoolbox16\external\analysis\fastFVAmex\cplexFVA.c:71:29: warning: initialization makes integer from
pointer without a cast [-Wint-conversion]
 static CPXFILEptr LogFile = NULL;
                             ^
D:\softwares\matlabr2017b\cobratoolbox16\external\analysis\fastFVAmex\cplexFVA.c: In function 'freelicence':
D:\softwares\matlabr2017b\cobratoolbox16\external\analysis\fastFVAmex\cplexFVA.c:732:12: error: unknown type name 'CPXFILEptr'
     extern CPXFILEptr LogFile;
            ^
D:\softwares\matlabr2017b\cobratoolbox16\external\analysis\fastFVAmex\cplexFVA.c:737:17: warning: comparison between pointer and
integer
     if (LogFile != NULL){
                 ^
D:\softwares\matlabr2017b\cobratoolbox16\external\analysis\fastFVAmex\cplexFVA.c:753:21: warning: assignment makes integer from
pointer without a cast [-Wint-conversion]
             LogFile = NULL;

Since I'm a beginner at Matlab, this is really as far as I can go now.



On Tuesday, May 5, 2020 at 6:16:45 PM UTC+8, Ronan M.T. Fleming wrote:
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-...@googlegroups.com.

Ronan M.T. Fleming

unread,
May 7, 2020, 8:16:36 PM5/7/20
to COBRA Toolbox
Hi Leo,
cplex is compatible with those matlab versions. The issue is with the
cplexFVA.c code that is calling cplex. It seems that it makes
reference to a pointer that cplex no longer use. The cplexFVA.c code
needs to be updated to use cplex 12.9+ or use an older version of
cplex.
Regards,
Ronan

The following type definition, deprecated in CPLEX V12.8.0, has been
removed: CPXFILEptr.
https://www.ibm.com/support/knowledgecenter/SS9UKU_12.9.0/com.ibm.cplex.zos.help/CPLEX/ReleaseNotes/topics/releasenotes1290/removed.html
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/a68620f1-f7fa-4b76-b9bb-114a858e5898%40googlegroups.com.

Leo Wayne

unread,
May 8, 2020, 9:56:54 PM5/8/20
to COBRA Toolbox
hi ronan.
i have installed ibm_cplex 12.8, but when i changeCobraSolver(), it's ibm_cplex is installed but  not working properly.
Reply all
Reply to author
Forward
0 new messages