Skip to content

Commit 0c752e3

Browse files
committed
260510.115722.CST [skip ci] again, correct the setting of compiler_options according to Append Compiler Options in https://www.mathworks.com/help/matlab/ref/mex.html
1 parent 34bf97f commit 0c752e3

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/test_matlab_windows.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,5 @@ jobs:
123123
root_dir = pwd();
124124
cd(fullfile(root_dir, 'matlab/tests'));
125125
test_classical = true;
126-
% With MinGW, if we set verbose to true, MATLAB will crash with the message "ERROR: MATLAB error Exit Status: 0xc0000409".
127-
% To be investigated whether this is a bug of MATLAB or MinGW. Setting verbose to false is a workaround.
128-
verbose = ~strcmpi('${{ matrix.compiler }}', 'mingw');
126+
verbose = true;
129127
testprima_ex(test_classical, verbose);

matlab/setup_tools/compile.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,15 @@ function compile(solvers, mexdir, fortd, gateways, options)
129129
compiler_configurations.Name);
130130
end
131131

132-
% Finally, set `compiler_options` so that `extra_compiler_options` is appended to COMPFLAGS (on
133-
% Windows with Microsoft Visual Studio compilers) or to FFLAGS (on other platforms) when MEX is
134-
% called with `compiler_options`. See Append Compiler Options in
132+
% Finally, set `compiler_options` so that `extra_compiler_options` is appended to the compiler flags
133+
% when MEX is called with `compiler_options`. See Append Compiler Options in
135134
% https://www.mathworks.com/help/matlab/ref/mex.html
136135
% N.B.: on Windows with MinGW, the compiler is gfortran, and the option should be passed via
137-
% FFLAGS rather than COMPFLAGS.
136+
% FCCOMPFLAGS rather than COMPFLAGS.
138137
if ispc && contains(compiler_manufacturer, 'intel') % on Windows with Microsoft Visual Studio compilers
139138
compiler_options = ['COMPFLAGS="$COMPFLAGS ', extra_compiler_options, '"'];
139+
elseif ispc && contains(compiler_manufacturer, 'gnu') % on Windows with MinGW
140+
compiler_options = ['FCCOMPFLAGS="$FCCOMPFLAGS ', extra_compiler_options, '"'];
140141
else % with MinGW (on Windows), macOS, and Linux compilers
141142
compiler_options = ['FFLAGS="$FFLAGS ', extra_compiler_options, '"'];
142143
end

0 commit comments

Comments
 (0)